From 92944404285800526192b65d91b2ec58cd5c1c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E7=BB=A7=E7=BB=AD=E5=90=B9?= <17611323298@163.com> Date: Wed, 24 May 2023 14:27:10 +0800 Subject: [PATCH] =?UTF-8?q?bi=E5=A4=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/admin/user/index.vue | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/views/admin/user/index.vue b/src/views/admin/user/index.vue index ec18e18..36ed6d9 100644 --- a/src/views/admin/user/index.vue +++ b/src/views/admin/user/index.vue @@ -650,6 +650,7 @@ v-model="formTwo.deptId" filterable clearable + multiple value-key="key" style="width: 370px" placeholder="请选择部门" @@ -1158,7 +1159,7 @@ export default { formTwo: { username: "", //手机号 userRoleType: "", //身份 - deptId: "", //部门 + deptId: [], //部门 roleId: "", //角色 newRoleId: "", showPhoneStatus: 0, //手机号显隐 @@ -1302,7 +1303,7 @@ export default { }, }, created() { - this.addOperatingLog() + this.addOperatingLog(); // 获取显隐的列表 this.setTableOption(); this.setTableOptions(); @@ -1350,14 +1351,16 @@ export default { methods: { // 添加日志 addOperatingLog() { - this.$api.http.addOperatingLog({logType: 1}) + this.$api.http.addOperatingLog({ logType: 1 }); }, // 重设配置项 resetAdminUserIndexsOptions() { - this.showColumns = this.$tableOption.adminUserIndexs.column.map(item => { - return item.prop - }) + this.showColumns = this.$tableOption.adminUserIndexs.column.map( + (item) => { + return item.prop; + } + ); }, // 检测是否可以展示某些字段 checkOption() { @@ -1403,7 +1406,7 @@ export default { exportMethodPost("admin/user/orgUserListExport", "组织用户", obj); }, cleartap() { - this.formTwo.deptId = ""; + this.formTwo.deptId = []; console.log(this.formTwo); }, // 区域改变 @@ -2385,7 +2388,9 @@ export default { this.formTwo.orgType = row.orgType; this.formTwo.houseId = row.houseId; this.formTwo.newRoleId = row.roleId; - this.formTwo.deptId = row.deptId; + if (row.deptId) { + this.formTwo.deptId = row.deptId.split(",") || []; + } this.formTwo.userRoleType = row.userRoleType + ""; console.log(this.formTwo); // 获取角色列表 @@ -2405,8 +2410,11 @@ export default { editSureTwo() { this.$refs.formTwo.validate((valid) => { if (valid) { - console.log(this.formTwo); - this.$api.api.editRoleAndDept(this.formTwo).then((res) => { + const params = { + ...this.formTwo, + deptId: this.formTwo.deptId.join(',') + } + this.$api.api.editRoleAndDept(params).then((res) => { this.$message.success("修改成功"); this.dialogFormVisibleTwo = false; this.roleList();