瀏覽代碼

第三版侧边栏的问题

lex-xin 5 年之前
父節點
當前提交
f50a2e5f7e

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 1 - 0
dist/static/css/chunk-0db4f000.b7f7855d.css

@@ -0,0 +1 @@
+.el-button--primary[data-v-1a6b09b5],.el-button--primary[data-v-1a6b09b5]:active,.el-button--primary[data-v-1a6b09b5]:focus,.el-button--primary[data-v-1a6b09b5]:hover{background:#14928a;border-color:#14928a;color:#fff}.el-row[data-v-1a6b09b5]{margin-top:40px}.el-col[data-v-1a6b09b5]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:20px;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-right:50%}.el-input-group[data-v-1a6b09b5]{width:200px;margin:0 20px}[data-v-1a6b09b5] .el-tree-node__content{height:40px!important}

+ 0 - 1
dist/static/css/chunk-1b39bb46.c7b67249.css

@@ -1 +0,0 @@
-.el-button--primary[data-v-2358822a],.el-button--primary[data-v-2358822a]:active,.el-button--primary[data-v-2358822a]:focus,.el-button--primary[data-v-2358822a]:hover{background:#14928a;border-color:#14928a;color:#fff}.el-row[data-v-2358822a]{margin-top:40px}.el-col[data-v-2358822a]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:20px;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-right:50%}.el-input-group[data-v-2358822a]{width:200px;margin:0 20px}[data-v-2358822a] .el-tree-node__content{height:40px!important}

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.ce7af55c.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-0db4f000.2c3d0548.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-1b39bb46.5190a390.js


+ 38 - 12
src/views/categroyManager/insideSetting/adminOperation.vue

@@ -61,6 +61,7 @@ export default {
       },
       checkAll: false,
       splice: [],
+      allChildIds: [], // 所有子编号
       slideCount: 0
     }
   },
@@ -122,9 +123,9 @@ export default {
           this.isIndeterminate = roleData.menuIds.length > 0 && roleData.menuIds.length < this.slideCount
 
           console.time('time')
-          this.getParent(roleData.menuIds, tempData)
+          let tSplice = this.getParent(roleData.menuIds, tempData)
           console.timeEnd('time')
-          let checkIds = this.spliceParent(this.splice, roleData.menuIds)
+          let checkIds = this.spliceParent(tSplice, roleData.menuIds)
           roleData.menuIds = checkIds
           this.result = roleData
         }
@@ -180,17 +181,42 @@ export default {
       //     }
       //   })
       // })
+      this.getAllChildIds(data)
+      let tempAllChildIds = this.allChildIds
+      checkIds.map((id, index) => {
+        if(!tempAllChildIds.includes(id)) {
+          checkIds.splice(index, 1)
+        }
+      })
+      return checkIds
+      // 获取所有最子集编号
+      // let countChild = []
+      // data.forEach((item, index) => {
+        // checkIds.map(id => {
+        //   if(item.id === id && item.children && item.children.length) {
+        //     if(!this.splice.includes(id)) {
+        //       this.splice.push(id)
+        //     }
+        //   }
+        //   if(item.children) {
+        //     this.getParent(checkIds, item.children)
+        //   }
+        // })
+      //   if(item.children && item.children.length) {
+
+      //   } else {
+      //     countChild.push(item.id)
+      //   }
+      // })
+    },
+    getAllChildIds(data) {
+      // 获取所有最子集编号
       data.forEach((item, index) => {
-        checkIds.map(id => {
-          if(item.id === id && item.children && item.children.length) {
-            if(!this.splice.includes(id)) {
-              this.splice.push(id)
-            }
-          }
-          if(item.children) {
-            this.getParent(checkIds, item.children)
-          }
-        })
+        if(item.children && item.children.length) {
+          this.getAllChildIds(item.children)
+        } else {
+          this.allChildIds.push(item.id)
+        }
       })
     },
     //删除父级项

Some files were not shown because too many files changed in this diff