Parcourir la source

岗位管理角色列表选择修改

zhongxiaoyu il y a 3 ans
Parent
commit
3af110d9e8

+ 11 - 0
src/components/rolelist/index.vue

@@ -162,6 +162,10 @@ export default {
     GroupIds: {
       type: Array,
       default: () => []
+    },
+    selectedRoleId: {
+      type: Number,
+      default: 0
     }
   },
   data() {
@@ -255,6 +259,13 @@ export default {
         }
       },
       deep: true
+    },
+    selectedRoleId: {
+      handler(val) {
+        if (val === -1) {
+          this.msg = -1
+        }
+      }
     }
   },
   computed: {

+ 6 - 2
src/views/accountGroupManagement/components/accountGroupEdit.vue

@@ -74,6 +74,7 @@
                 :check-box-list="roleListCheckedList"
                 :number="8"
                 :active="true"
+                :selected-role-id="currentSelectedRoleId"
                 @checkChange="getRoleListChecked"
                 @checkClick="selectRole"
                 @role-list-change="roleListCheckedFilter"
@@ -178,7 +179,7 @@ export default {
       needType: '',
       groupIds: [],
       queryIds: [],
-      currentSelectedRoleId: 0,
+      currentSelectedRoleId: -1,
       checkedRoles: [],
       editForm: {
         name: '',
@@ -320,7 +321,10 @@ export default {
         role => arr.findIndex(item => item.RoleId === role.RoleId) > -1
       )
       this.roleListCheckedList = this.roleListCheckedCopy.map(role => role.RoleId)
-      console.log(this.roleListCheckedTemp)
+      if (arr.findIndex(item => item.RoleId === this.currentSelectedRoleId) === -1) {
+        this.checkedRoles = []
+        this.currentSelectedRoleId = -1
+      }
     },
     // 获取当前编辑的权限规则
     getRulesOfCompetency(obj) {