From 81925b42980f09b2f505d980fb215ed1df0c6e50 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 25 Oct 2021 11:05:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=92=E8=89=B2=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/system/list/staff.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pages/system/list/staff.vue b/src/pages/system/list/staff.vue index 7e295ac..f2ad4b5 100644 --- a/src/pages/system/list/staff.vue +++ b/src/pages/system/list/staff.vue @@ -52,7 +52,7 @@ - + e.roleId); this.roleList.forEach(i => { let obj = { roleId: "", roleName: "", cascaderValue: [] }; - if (value.includes(i.id)) { + if (value.includes(i.id) && !ids.includes(i.id)) { obj.roleId = i.id; obj.roleName = i.roleName; this.teacherForm.roleAndDeptList.push(obj); @@ -421,6 +420,12 @@ export default { this.teacherForm.roleAndDeptList.splice(0); } }, + roleRemove(value) { // 处理移除角色 + let index = this.teacherForm.roleAndDeptList.findIndex(i => i.roleId === value); + if (index !== -1) { + this.teacherForm.roleAndDeptList.splice(index, 1); + } + }, async saveSure(teacherForm) { this.$refs[teacherForm].validate((valid) => { if (valid) {