瀏覽代碼

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

zhongxiaoyu 3 年之前
父節點
當前提交
54798dc4f1

+ 1 - 26
src/components/usergrouptree/index.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: zk
  * @Date: 2022-02-09 15:47:09
- * @LastEditTime: 2022-02-21 07:38:53
+ * @LastEditTime: 2022-02-21 10:07:44
  * @LastEditors: your name
  * @Description: 用户组树
  * @FilePath: \Foshan4A4.0\src\components\usergrouptree\index.vue
@@ -34,7 +34,6 @@
           <span
             slot-scope="{ data }"
             class="custom-tree-node"
-            :class="{ 'single-checked': data.GroupId === singleCheckedNodeKey }"
           >
             {{ data.GroupName }}
           </span>
@@ -80,16 +79,6 @@ export default {
       pageSize: 20
     }
   },
-  computed: {
-    singleCheckedNodeKey() {
-      const checkedKeys = this.$refs.tree.getCheckedNodes()
-      if (this.type && checkedKeys.length === 1) {
-        return checkedKeys[0].GroupId
-      } else {
-        return undefined
-      }
-    }
-  },
   watch: {
     checkedKeys: {
       handler(val) {
@@ -182,20 +171,6 @@ export default {
         left: 3px;
       }
     }
-
-    .custom-tree-node {
-      position: relative;
-      &.single-checked::before {
-        content: '';
-        width: 3px;
-        height: 3px;
-        background: #6e81bc;
-        border-radius: 50%;
-        position: absolute;
-        left: 0;
-        top: 0;
-      }
-    }
   }
 }
 </style>

+ 15 - 14
src/views/accountGroupManagement/components/accountGroupEdit.vue

@@ -2,7 +2,7 @@
   <div class="bf-postmanagementadd">
     <div class="postmanagementadd_header">
       <div class="postmanagementadd_top">
-        <div class="tltleLeft">编辑账号组</div>
+        <div class="tltleLeft">{{ pageTitle }}</div>
         <div
           class="btn"
           style="margin-top: 20px"
@@ -54,7 +54,7 @@
               nodekey="GroupId"
               :type="true"
               :defaultProps="defaultProps"
-              :checkedKeys="[GroupUpId]"
+              :checkedKeys="accountGroupTreeCheckedList"
               @getTreeData="getAccountGroupChecked"
             />
           </div>
@@ -141,7 +141,7 @@ import PermissionList from '@/components/permissionlist/index.vue'
 // import Dialog from '@/layout/components/Dialog/index.vue'
 
 import { RoleAuths } from '@/api/apiAuthority'
-import { GetGroupDetails, EditGroupAcc, SaveGroup } from '@/api/AccountGroup.js'
+import { GetGroupDetails, EditGroup, SaveGroup } from '@/api/AccountGroup.js'
 // import treeData from '../minixs/treeData'
 import { mapGetters } from 'vuex'
 
@@ -161,10 +161,11 @@ export default {
       GroupId: 0,
       GroupUpId: this.$route.query.GroupUpId,
       // dialogVisible: false,
-      OpenRole: 0,
+      openRole: 0,
       authTo: {},
       authList: [],
-      accountGroupTreeCheckedTemp: [], // 账号组书当前勾选项
+      accountGroupTreeCheckedList: [], // 账号组树初始勾选项
+      accountGroupTreeCheckedTemp: [], // 账号组树当前勾选项
       roleListCheckedList: [], // 角色列表初始勾选项
       roleListCheckedTemp: [], // 角色列表当前勾选项
       permissionTreeChckedKeys: [], // 权限树初始勾选项
@@ -177,7 +178,7 @@ export default {
       editForm: {
         name: '',
         desc: '',
-        isUsed: ''
+        isUsed: 0
       },
       rules: {
         // 表单验证
@@ -202,12 +203,14 @@ export default {
     } else {
       obj = this.systemSet
     }
+    console.log(obj)
     const { OpenRole } = obj
     this.openRole = OpenRole
     this.accountGroupTreeCheckedTemp.push(this.GroupUpId)
     this.queryType = this.GroupUpId === -1 ? 'all' : 'group'
   },
   mounted() {
+    this.accountGroupTreeCheckedList = [this.GroupUpId]
     this.roleType = 'roleByUpId'
     if (this.doesGroupExist) {
       this.GroupId = this.$route.query.GroupId
@@ -265,15 +268,13 @@ export default {
     },
     // 获取当前勾选的账号组
     getAccountGroupChecked(arr) {
-      console.log(arr)
-      this.accountGroupTreeCheckedTemp.length = 0
       if (arr && arr.length && arr[0] !== -1) {
         this.queryType = 'group'
-        const GroupUpId = arr[0]
-        this.accountGroupTreeCheckedTemp.push(GroupUpId)
+        const GroupUpId = arr[0].GroupId
+        this.accountGroupTreeCheckedTemp = [GroupUpId]
       } else {
         this.queryType = 'all'
-        this.accountGroupTreeCheckedTemp.push(-1)
+        this.accountGroupTreeCheckedTemp = [-1]
       }
     },
     // 角色选取
@@ -344,7 +345,7 @@ export default {
         AuthList,
         GroupName: this.editForm.name,
         GroupDesc: this.editForm.desc,
-        GroupUpId: this.accountGroupTreeCheckedTemp[0],
+        GroupUpid: this.accountGroupTreeCheckedTemp[0],
         RoleList: this.roleListCheckedTemp
       }
 
@@ -352,7 +353,7 @@ export default {
         this.saveEditGroup({
           ...params,
           GroupId: this.GroupId,
-          Status: this.editForm.isUsed
+          Status: this.editForm.isUsed || 0
         })
       } else {
         this.saveAddGroup(params)
@@ -360,7 +361,7 @@ export default {
     },
     async saveEditGroup(params) {
       try {
-        const res = await EditGroupAcc(params)
+        const res = await EditGroup(params)
         if (res.code === 0) {
           this.$message.success(res.message)
           setTimeout(() => {

+ 2 - 2
src/views/accountGroupManagement/components/accountGroupHome.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-08 09:27:43
- * @LastEditTime: 2022-02-21 06:40:55
+ * @LastEditTime: 2022-02-21 09:49:21
  * @LastEditors: your name
  * @Description: 用户组管理
  * @FilePath: \Foshan4A2.0\src\views\accountGroupManagement\components\home.vue
@@ -307,7 +307,7 @@ export default {
     renderAdd(data) {
       this.$router.push({
         path: "/accountGroup/Add",
-        query: { GroupUpid: data.GroupId },
+        query: { GroupUpId: data.GroupId },
       });
     },
     // 修改组织

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

@@ -1,7 +1,7 @@
 <!--
  * @Author: Badguy
  * @Date: 2022-02-15 11:37:42
- * @LastEditTime: 2022-02-21 06:29:19
+ * @LastEditTime: 2022-02-21 09:53:36
  * @LastEditors: your name
  * @Description: 编辑账号
  * have a nice day!
@@ -343,8 +343,8 @@ export default {
       accountForm: {
         name: null,
         pwd: null,
-        desc: null
-        // status: true,
+        desc: null,
+        status: 0
       },
       accountGroupTreeProps: {
         children: 'children',
@@ -393,9 +393,10 @@ export default {
         })
         if (res.code === 0) {
           // console.log(res.returnData)
-          const { UserDesc, UserName, GroupList, TacList, AuthList, RoleList } = res.returnData
+          const { UserDesc, UserName, GroupList, TacList, AuthList, RoleList, Status } = res.returnData
           this.accountForm.name = UserName
           this.accountForm.desc = UserDesc
+          this.accountForm.status = Status
           this.$store.state.auth.authList = AuthList
 
           AuthList &&
@@ -451,12 +452,11 @@ export default {
     },
     // 获取当前勾选的账号组
     getAccountGroupChecked(arr) {
-      this.accountGroupTreeCheckedTemp.length = 0
       if (arr && arr.length) {
         const GroupIds = arr.map(item => item.GroupId)
-        this.accountGroupTreeCheckedTemp.push(...GroupIds)
+        this.accountGroupTreeCheckedTemp = GroupIds
       } else {
-        this.accountGroupTreeCheckedTemp.push(-1)
+        this.accountGroupTreeCheckedTemp = [-1]
       }
     },
     // 获取当前勾选的角色列表
@@ -492,7 +492,7 @@ export default {
         AuthList,
         GroupList: this.accountGroupTreeCheckedTemp.map(groupId => ({ GroupId: groupId })),
         RoleList: this.roleListCheckedTemp,
-        Status: 0,
+        Status: this.accountForm.status || 0,
         TacList: this.loginPolicyCheckedTemp,
         UserDesc: this.accountForm.desc,
         UserName: this.accountForm.name,
@@ -609,11 +609,11 @@ export default {
       }
     }
   }
-  .content {
+  ::v-deep .content {
     width: 100%;
     height: calc(100% - 274px);
     box-sizing: border-box;
-    ::v-deep .el-empty {
+    .el-empty {
       padding: 0;
     }
     .content-card {

+ 1 - 1
src/views/accountManagement/components/accountHome.vue

@@ -163,7 +163,7 @@ export default {
     }
   },
   created() {
-    if (this.searchInfo === '') {
+    if (!this.searchInfo) {
       this.accountList()
     } else {
       console.log(this.searchInfo)