Browse Source

no message

aXin-0810 9 months ago
parent
commit
41d924e569
3 changed files with 34 additions and 35 deletions
  1. 4 0
      src/styles/sidebar.scss
  2. 2 0
      src/styles/variables.scss
  3. 28 35
      src/views/setting/account/index.vue

+ 4 - 0
src/styles/sidebar.scss

@@ -100,12 +100,16 @@
     & .el-submenu .el-menu-item {
       min-width: $sideBarWidth !important;
       background-color: $subMenuBg !important;
+      color: $subMenuText !important;
 
       &:hover {
         background-color: $menuHover !important;
         color: $menuHoverText !important;
       }
     }
+    & .el-submenu .is-active {
+      color: $menuActiveText !important;
+    }
 
     .el-menu-item.is-active {
       background-color: $menuActiveBg !important;

+ 2 - 0
src/styles/variables.scss

@@ -14,6 +14,7 @@ $menuHover: #3d8ffd;
 $menuHoverText: #fff;
 // 子级菜单区域背景
 $subMenuBg: #e7eaf0;
+$subMenuText: #89979c;
 
 $sideBarWidth: 210px;
 
@@ -45,4 +46,5 @@ $min-height: 720px;
   navbarBg: $navbarBg;
   navbarText: $navbarText;
   navbarActiveText: $navbarActiveText;
+  subMenuText: $subMenuText;
 }

+ 28 - 35
src/views/setting/account/index.vue

@@ -177,7 +177,13 @@
                 <el-cascader
                   style="width: 100%"
                   :options="departmentList"
-                  :props="{ checkStrictly: true, value: 'adminDeptId', label: 'deptName' }"
+                  :props="{
+                    checkStrictly: true,
+                    emitPath: false,
+                    multiple: true,
+                    value: 'adminDeptId',
+                    label: 'deptName'
+                  }"
                   v-model="addForm.rwaide"
                   clearable
                 >
@@ -357,13 +363,13 @@ export default {
         account: '', // 账号
         nickName: '', // 用户名
         role: '', // 角色组
-        adminWebsitId: '',
-        adminDeptId: '',
+        adminWebsitId: [],
+        adminDeptId: [],
         newPassword: '', // 新密码
         confirmPassword: '', // 确认密码
         pubNotice: true,
         linkPhone: '',
-        rwaide: ''
+        rwaide: []
       },
       addFormRules: {
         account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
@@ -565,7 +571,7 @@ export default {
                 adminWebsitId: res.data.adminWebsitId,
                 adminDeptId: res.data.adminDeptId,
                 linkPhone: res.data.linkPhone,
-                rwaide: res.data.adminWebsitId || res.data.adminDeptId
+                rwaide: [...res.data.adminWebsitId, ...res.data.adminDeptId]
               }
             })
           }
@@ -586,12 +592,21 @@ export default {
     submitAddForm(removeTab) {
       this.$refs.addForm.validate(valid => {
         if (valid) {
-          let rwaide = null
-          if (this.addForm.rwaide instanceof Array) {
-            rwaide = this.addForm.rwaide[this.addForm.rwaide.length - 1]
-          } else {
-            rwaide = this.addForm.rwaide
-          }
+          let rwaideObjs = (function (node, ids) {
+            const result = []
+            function recurse(currentNode) {
+              if (ids.has(currentNode.adminDeptId)) {
+                result.push(currentNode)
+              }
+              if (currentNode.children) {
+                currentNode.children.forEach(child => recurse(child))
+              }
+            }
+            for (var item of node) {
+              recurse(item)
+            }
+            return result
+          })(this.departmentList, new Set([...this.addForm.rwaide]))
           let params = {
             userName: this.addForm.account,
             nickName: this.addForm.nickName,
@@ -599,30 +614,8 @@ export default {
             password: this.addForm.newPassword,
             pubNotice: this.addForm.pubNotice,
             linkPhone: this.addForm.linkPhone,
-            ...(() => {
-              var aaa = list => {
-                for (var item of list) {
-                  if (item.adminDeptId == rwaide) {
-                    return item.isWebsit
-                  } else if (item?.children && item?.children?.length) {
-                    var data = aaa(item?.children)
-                    if (data !== undefined) {
-                      return data
-                    }
-                  }
-                }
-                return undefined
-              }
-              if (aaa(this.departmentList)) {
-                return {
-                  adminWebsitId: rwaide
-                }
-              } else {
-                return {
-                  adminDeptId: rwaide
-                }
-              }
-            })()
+            adminDeptId: rwaideObjs.filter(item => !item.isWebsit).map(item => item.adminDeptId),
+            adminWebsitId: rwaideObjs.filter(item => item.isWebsit).map(item => item.adminDeptId)
           }
           if (this.addFormType == 'edit') {
             params.adminUserId = this.editId