diff --git a/src/pages/authority/user/organizationuser.vue b/src/pages/authority/user/organizationuser.vue index 71c460243b8bbbf837ef6627fe4badc943f8a33f..50f630e6040aa031a7d3882b70bb3d317e51b311 100644 --- a/src/pages/authority/user/organizationuser.vue +++ b/src/pages/authority/user/organizationuser.vue @@ -18,7 +18,7 @@

用户账号:

- +

登录密码:

@@ -36,7 +36,7 @@

用户类型:

- +

IP白名单:

- + +
+ + {{tag}} + + + + 新增 +

联系人:

@@ -171,9 +193,13 @@ export default { desc: "", person: "", date: "", - ip: "", + ip: [], domain: "", }, + dynamicTags: ['标签一', '标签二', '标签三'], + inputVisible: false, + inputValue: '', + ip_arr:[], now_user: 0, //0:普通用户,1:组织管理员,2:超级管理员 typeoptions: [ { @@ -245,14 +271,6 @@ export default { baseinfo: {}, }; }, - watch: { - 'form.type'(n,o){ - this.form.systemname = '' - this.form.domain = '' - this.form.ip = '' - this.form.origin = '' - } - }, computed: {}, created() { this.get_now_user(); @@ -261,6 +279,31 @@ export default { }, mounted() {}, methods: { + change_type(){ + this.form.systemname = '' + this.form.domain = '' + this.form.ip = [] + this.form.origin = '' + }, + handleClose(tag) { + this.form.ip.splice(this.form.ip.indexOf(tag), 1); + }, + + showInput() { + this.inputVisible = true; + this.$nextTick(_ => { + this.$refs.saveTagInput.$refs.input.focus(); + }); + }, + + handleInputConfirm() { + let inputValue = this.inputValue; + if (inputValue) { + this.form.ip.push(inputValue); + } + this.inputVisible = false; + this.inputValue = ''; + }, get_now_page() { console.log(this.$route); if (this.$route.path.indexOf("add") !== -1) { @@ -314,7 +357,7 @@ export default { desc: data.description, person: data.create_user, date: data.create_date, - ip: this.transform_func(data.ip_whitelist), + ip: data.ip_whitelist, domain: data.domain_name, }; }else{ @@ -374,7 +417,7 @@ export default { is_admin: this.form.type, state: this.form.able, // 用户状态,1——启用,0 禁用 domain_name: this.form.domain, // - ip_whitelist: this.form.ip.split(";"), // + ip_whitelist: this.form.ip, // description: this.form.desc, //描述 link_man: this.form.contact, }; @@ -405,7 +448,7 @@ export default { state: this.form.able, // 用户状态,1——启用,0 禁用 domain_name: this.form.domain, // ip_whitelist: - this.form.ip && this.form.ip.length ? this.form.ip.split(";") : [], // + this.form.ip && this.form.ip.length ? this.form.ip : [], // description: this.form.desc, //描述 link_man: this.form.contact, }; @@ -423,12 +466,23 @@ export default { this.$message.error("修改失败"); }); }, + check_user(){ + return this.$http + .get(`/apaas/backmgt/user/checkUserId?user_id=${this.form.account}`) + }, onSubmit(formName) { console.log("submit!"); this.$refs[formName].validate((valid) => { if (valid) { if (this.edit_flag == 0) { - this.add_user(); + this.check_user().then((res)=>{ + console.log(res); + if(res.data.success){ + this.add_user(); + }else{ + this.$message.error(res.data.errMsg) + } + }) } else { this.set_user(); } @@ -437,6 +491,7 @@ export default { return false; } }); + }, check_account(){ @@ -473,11 +528,11 @@ export default { background-color: #f7f8f9; width: 1022px; } -.shortpass .el-input__inner { +.info_contain .shortpass .el-input__inner { background-color: #f7f8f9; width: 888px; } -.shortpass .el-input { +.info_contain .shortpass .el-input { width: 888px; } .info_contain .el-textarea__inner { @@ -494,6 +549,26 @@ export default { .info_contain .el-input.is-disabled .el-input__inner { background-color: #e3e4e6; } + .el-tag + .el-tag { + margin-left: 10px; + } + .button-new-tag { + margin-left: 10px; + height: 32px; + line-height: 30px; + padding-top: 0; + padding-bottom: 0; + } + .info_contain .input-new-tag { + width: 90px; + margin-left: 10px; + vertical-align: bottom; + } + .info_contain .input-new-tag .el-input__inner { + width: 90px; + margin-left: 10px; + vertical-align: bottom; + }