林倩 3 жил өмнө
parent
commit
3a463b4cce

+ 76 - 88
src/pages/admin-manage/noBindEditor.vue

@@ -22,15 +22,13 @@
       <!--</el-tab-pane>-->
     </el-tabs>
     <div v-footer>
-     <dg-button @click="handleCancel">取消</dg-button>
-    <dg-button type="primary" @click="handleSaveOrg">保存</dg-button>
-
+      <dg-button @click="handleCancel">取消</dg-button>
+      <dg-button type="primary" @click="handleSaveOrg">保存</dg-button>
     </div>
   </div>
 </template>
 
 <script>
-import * as commonApi from '@/api/common';
 import * as adminApi from '@/api/admin-manage';
 import { mapGetters } from 'vuex';
 export default {
@@ -124,70 +122,68 @@ export default {
       const that = this;
       let node, parentNode;
 
-      return adminApi
-        .orgRange(params)
-        .then((res) => {
-          // 渲染树节点
-          resolve(res || []);
-          if (res.length) {
-            that.$nextTick(() => {
-              res.forEach((item) => {
-                node = that.$refs.tree.getNode(item.id);
-                parentNode = item.pid ? that.$refs.tree.getNode(item.pid) : null;
-                // 父节点存在
-                if (parentNode) {
-                  // 父节点勾选
-                  if (parentNode.checked) {
-                    if (that.tempChecks.indexOf(item.pid) > -1) {
+      return adminApi.orgRange(params).then((res) => {
+        // 渲染树节点
+        resolve(res || []);
+        if (res.length) {
+          that.$nextTick(() => {
+            res.forEach((item) => {
+              node = that.$refs.tree.getNode(item.id);
+              parentNode = item.pid ? that.$refs.tree.getNode(item.pid) : null;
+              // 父节点存在
+              if (parentNode) {
+                // 父节点勾选
+                if (parentNode.checked) {
+                  if (that.tempChecks.indexOf(item.pid) > -1) {
+                    node.checked = true;
+                    node.indeterminate = false;
+                    that.tempChecks.push(item.id);
+                  } else {
+                    if (item.checked == '2') {
                       node.checked = true;
                       node.indeterminate = false;
-                      that.tempChecks.push(item.id);
-                    } else {
-                      if (item.checked == '2') {
-                        node.checked = true;
-                        node.indeterminate = false;
-                      } else if (item.checked == '0') {
-                        node.checked = false;
-                        node.indeterminate = false;
-                      } else if (item.checked == '1') {
-                        node.checked = false;
-                        node.indeterminate = true;
-                      }
-                    }
-                  } else if (!parentNode.checked) {
-                    if (that.tempNoChecks.indexOf(item.pid) > -1) {
-                      that.tempNoChecks.push(item.id);
+                    } else if (item.checked == '0') {
                       node.checked = false;
                       node.indeterminate = false;
-                    } else {
-                      if (item.checked == '2') {
-                        node.checked = true;
-                        node.indeterminate = false;
-                      } else if (item.checked == '0') {
-                        node.checked = false;
-                        node.indeterminate = false;
-                      } else if (item.checked == '1') {
-                        node.checked = false;
-                        node.indeterminate = true;
-                      }
+                    } else if (item.checked == '1') {
+                      node.checked = false;
+                      node.indeterminate = true;
                     }
                   }
-                } else {
-                  if (item.checked == '2') {
-                    node.checked = true;
-                    node.indeterminate = false;
-                  } else if (item.checked == '0') {
+                } else if (!parentNode.checked) {
+                  if (that.tempNoChecks.indexOf(item.pid) > -1) {
+                    that.tempNoChecks.push(item.id);
                     node.checked = false;
                     node.indeterminate = false;
-                  } else if (item.checked == '1') {
-                    node.checked = false;
-                    node.indeterminate = true;
+                  } else {
+                    if (item.checked == '2') {
+                      node.checked = true;
+                      node.indeterminate = false;
+                    } else if (item.checked == '0') {
+                      node.checked = false;
+                      node.indeterminate = false;
+                    } else if (item.checked == '1') {
+                      node.checked = false;
+                      node.indeterminate = true;
+                    }
                   }
                 }
-              });
+              } else {
+                if (item.checked == '2') {
+                  node.checked = true;
+                  node.indeterminate = false;
+                } else if (item.checked == '0') {
+                  node.checked = false;
+                  node.indeterminate = false;
+                } else if (item.checked == '1') {
+                  node.checked = false;
+                  node.indeterminate = true;
+                }
+              }
             });
-          }
-        })
+          });
+        }
+      });
     },
     // 复选框被点击时
     checkClick(data, node) {
@@ -288,11 +284,9 @@ export default {
     getAllMenu() {
       const that = this;
       const { id } = this.user;
-      adminApi
-        .getAllMenu(id)
-        .then((res) => {
-          that.allMenu = res;
-        })
+      adminApi.getAllMenu(id).then((res) => {
+        that.allMenu = res;
+      });
     },
     // 菜单范围
     getSelfMenu() {
@@ -302,18 +296,16 @@ export default {
         userId: this.id
       };
       let node;
-      adminApi
-        .menuRange(params)
-        .then((res) => {
-          that.$nextTick(() => {
-            res.forEach((key) => {
-              node = that.$refs.menuTree.getNode(key);
-              if (node && node.isLeaf) {
-                that.$refs.menuTree.setChecked(key, true);
-              }
-            });
+      adminApi.menuRange(params).then((res) => {
+        that.$nextTick(() => {
+          res.forEach((key) => {
+            node = that.$refs.menuTree.getNode(key);
+            if (node && node.isLeaf) {
+              that.$refs.menuTree.setChecked(key, true);
+            }
           });
-        })
+        });
+      });
     },
     handleSaveOrg() {
       // const { halfCheckKeys, checksKeys } = this;
@@ -358,12 +350,11 @@ export default {
       // 区别修改或新增
       const apiName = this.type === 'create' ? 'saveOrgRange' : 'saveAppRange';
 
-      adminApi[apiName](params)
-        .then((res) => {
-          that.success();
-          // that.$emit("success", true); // 不必刷新表格
-          that.$emit('oneSaveOrg', true);
-        })
+      adminApi[apiName](params).then((res) => {
+        that.success();
+        // that.$emit("success", true); // 不必刷新表格
+        that.$emit('oneSaveOrg', true);
+      });
     },
     handleSaveMenu() {
       const that = this;
@@ -381,13 +372,11 @@ export default {
       }
       params['type'] = this.type == 'create' ? 'TEMP' : '';
       params['userId'] = this.id;
-      adminApi
-        .saveMenuRange(params)
-        .then((res) => {
-          that.success();
-          // that.$emit("success");
-          that.$emit('oneSaveMenu', true);
-        })
+      adminApi.saveMenuRange(params).then((res) => {
+        that.success();
+        // that.$emit("success");
+        that.$emit('oneSaveMenu', true);
+      });
     },
     success(message = '操作成功!') {
       const that = this;
@@ -401,7 +390,6 @@ export default {
   computed: {
     ...mapGetters(['user'])
   },
-  created() {
-  }
+  created() {}
 };
 </script>

+ 0 - 1
src/pages/appfun-auth-manage/app-role-manage/index.vue

@@ -89,7 +89,6 @@ export default {
       });
     }
   },
-  // 页面创建完成$data可访问 $el不可以访问
   created() {}
 };
 </script>

+ 0 - 5
src/pages/appfun-auth-manage/role-auth-manage/persionView.vue

@@ -1,8 +1,3 @@
-<!--
-    
-    @Author:
-    @Date:
--->
 <template>
   <dg-row gutter="1rem">
     <dg-col :span="12">