Procházet zdrojové kódy

修改账号编辑、账号组编辑

zhongxiaoyu před 3 roky
rodič
revize
89c9e12965

+ 1 - 11
src/views/accountGroupManagement/components/accountGroupEdit.vue

@@ -330,17 +330,7 @@ export default {
     },
     // 账号组编辑保存
     async handleSaveEdit() {
-      const AuthList = []
-      this.permissionTreeChckedTemp.forEach(item => {
-        AuthList.push(item.AuthList)
-      })
-      AuthList.forEach((item, index) => {
-        this.authArrs.forEach(item2 => {
-          if (item.AuthId === item2.AuthId) {
-            AuthList[index] = item2.AuthList
-          }
-        })
-      })
+      const AuthList = this.permissionTreeChckedTemp.map(auth => auth.AuthList)
       const params = {
         AuthList,
         GroupName: this.editForm.name,

+ 5 - 5
src/views/accountManagement/components/accountEdit.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: Badguy
  * @Date: 2022-02-15 11:37:42
- * @LastEditTime: 2022-02-21 11:16:55
+ * @LastEditTime: 2022-02-21 11:47:11
  * @LastEditors: your name
  * @Description: 编辑账号
  * have a nice day!
@@ -349,7 +349,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['systemSet']),
+    ...mapGetters(['systemSet', 'authArrs']),
     pageTitle() {
       return this.doesAccountExist ? '编辑账号' : '新增账号'
     }
@@ -393,7 +393,7 @@ export default {
           this.accountForm.name = UserName
           this.accountForm.desc = UserDesc
           this.accountForm.status = Status
-          this.$store.state.auth.authList = AuthList
+          this.$store.dispatch('auth/changeAuthList', AuthList)
 
           AuthList &&
             AuthList.length &&
@@ -498,7 +498,6 @@ export default {
         AuthList,
         GroupList: this.accountGroupTreeCheckedTemp.map(groupId => ({ GroupId: groupId })),
         RoleList: this.roleListCheckedTemp,
-        Status: this.accountForm.status || 0,
         TacList: this.loginPolicyCheckedTemp,
         UserDesc: this.accountForm.desc,
         UserName: this.accountForm.name,
@@ -507,7 +506,8 @@ export default {
       if (this.doesAccountExist) {
         this.saveEditAccount({
           ...params,
-          UserId: this.userId
+          UserId: this.userId,
+          Status: this.accountForm.status || 0
         })
       } else {
         this.saveAddAccount(params)