From d23181c2f673a6f911a61572099cebb84a84d2d8 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期五, 18 八月 2023 10:22:33 +0800 Subject: [PATCH] 用户管理 新增bug --- Source/UBCS-WEB/src/views/system/user.vue | 71 ++++++++++++++++++----------------- 1 files changed, 36 insertions(+), 35 deletions(-) diff --git a/Source/UBCS-WEB/src/views/system/user.vue b/Source/UBCS-WEB/src/views/system/user.vue index 10fa0a1..212e197 100644 --- a/Source/UBCS-WEB/src/views/system/user.vue +++ b/Source/UBCS-WEB/src/views/system/user.vue @@ -809,7 +809,6 @@ }); }, nodeClick(data) { - console.log(data) this.treeDeptId = data.id; this.page.currentPage = 1; this.onLoad(this.page); @@ -842,24 +841,22 @@ }); }, rowSave(row, done, loading) { - const prop = this.findObject(this.option.group, 'tenantId'); - console.log('2',prop) - row.deptId = row.deptId.join(","); - row.roleId = row.roleId.join(","); - row.postId = row.postId.join(","); - console.log('3',row) - add(row).then(() => { - this.initFlag = false; - this.onLoad(this.page); - this.$message({ - type: "success", - message: "鎿嶄綔鎴愬姛!" + row.deptId = row.deptId.join(","); + row.roleId = row.roleId.join(","); + row.postId = row.postId.join(","); + console.log('3',row) + add(row).then(() => { + this.initFlag = false; + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + done(); + }, error => { + window.console.log(error); + loading(); }); - done(); - }, error => { - window.console.log(error); - loading(); - }); }, rowUpdate(row, index, done, loading) { row.deptId = row.deptId.join(","); @@ -1032,24 +1029,28 @@ }, beforeOpen(done, type) { console.log(type) - if (["edit", "view"].includes(type)) { - getUser(this.form.id).then(res => { - this.form = res.data.data; - if (this.form.hasOwnProperty("deptId")) { - this.form.deptId = this.form.deptId.split(","); - } - if (this.form.hasOwnProperty("roleId")) { - this.form.roleId = this.form.roleId.split(","); - } - if (this.form.hasOwnProperty("postId")) { - this.form.postId = this.form.postId.split(","); - } - }); + if(this.treeDeptId){ + if (["edit", "view"].includes(type)) { + getUser(this.form.id).then(res => { + this.form = res.data.data; + if (this.form.hasOwnProperty("deptId")) { + this.form.deptId = this.form.deptId.split(","); + } + if (this.form.hasOwnProperty("roleId")) { + this.form.roleId = this.form.roleId.split(","); + } + if (this.form.hasOwnProperty("postId")) { + this.form.postId = this.form.postId.split(","); + } + }); + } + const prop = this.findObject(this.option.group, 'tenantId'); + console.log('1',prop) + this.initFlag = true; + done(); + }else { + this.$message.warning('璇烽�夋嫨涓�鏉℃墍灞炵鎴�') } - const prop = this.findObject(this.option.group, 'tenantId'); - console.log('1',prop) - this.initFlag = true; - done(); }, currentChange(currentPage) { this.page.currentPage = currentPage; -- Gitblit v1.9.3