Kaynağa Gözat

修改逻辑

“front-end” 3 yıl önce
ebeveyn
işleme
77b76987de
1 değiştirilmiş dosya ile 99 ekleme ve 89 silme
  1. 99 89
      src/pages/main/file/flieList.vue

+ 99 - 89
src/pages/main/file/flieList.vue

@@ -134,7 +134,7 @@
               class="btn-check"
               size="medium"
               @click="addFile"
-              :disabled="uploadStatus ===false"
+              :disabled="uploadStatus === false"
             >
               上传附件
             </el-button>
@@ -376,7 +376,7 @@ export default {
   },
   data() {
     return {
-        uploadStatus:true,
+      uploadStatus: true,
       jurisdiction: {}, //权限列表
       isSuper: "", //是否为超级管理员
       loadinged: false,
@@ -477,7 +477,7 @@ export default {
       paramsSearch: {
         isFile: "1",
         id: "",
-        auth:''
+        auth: "",
       },
 
       fileInfo: {
@@ -848,25 +848,30 @@ export default {
       this.formData.id = nodeData.id;
       delete Object["children"];
       this.actionName = nodeData.title;
-      if(this.actionName ==='C市场' ||this.actionName === 'H市场'||this.actionName ==='N市场+线上' || this.actionName === '业务综合'||this.actionName ==='渠道'){
-          this.isSuper = '2'//权限
-          this.uploadStatus = false;
-      }else{
-          this.uploadStatus = true;
-          if(this.jurisdiction.isSuper === '1'){
-              this.isSuper ='1'
-          }
+      if (
+        this.actionName === "C市场" ||
+        this.actionName === "H市场" ||
+        this.actionName === "N市场+线上" ||
+        this.actionName === "业务综合" ||
+        this.actionName === "渠道"
+      ) {
+        this.isSuper = "2"; //权限
+        this.uploadStatus = false;
+      } else {
+        this.uploadStatus = true;
+        if (this.jurisdiction.isSuper === "1") {
+          this.isSuper = "1";
+        }
       }
-        this.subType = "修改";
-        this.params.type = "";
-        this.params.title = "";
-        this.params.collection = "";
-        this.params.catalogId = nodeData.id;
-        this.params.id = nodeData.id;
-        this.infolist.parentId = nodeData.id;
-        this.pageSize = 1; //切换树重置分页
-        this.getList(this.params, this.pageSize);
-
+      this.subType = "修改";
+      this.params.type = "";
+      this.params.title = "";
+      this.params.collection = "";
+      this.params.catalogId = nodeData.id;
+      this.params.id = nodeData.id;
+      this.infolist.parentId = nodeData.id;
+      this.pageSize = 1; //切换树重置分页
+      this.getList(this.params, this.pageSize);
     },
     //获取权限
     async getQuan() {
@@ -878,23 +883,27 @@ export default {
         },
         data: {},
       }).then((res) => {
-        if(res.data){
-            this.isSuper = res.data[0].isSuper || "";
-            this.jurisdiction = res.data[0];
+        if (res.data) {
+          this.isSuper = res.data[0].isSuper || "";
+          this.jurisdiction = res.data[0];
+          if (this.jurisdiction.isSuper === "1") {
+            this.params.auth = "";
+          } else {
             switch (this.jurisdiction.roleDuty) {
-                case "二级经理":
-                    this.params.auth = 2;
-                    this.paramsSearch =2
-                    break;
-                case "三级经理":
-                    this.params.auth = 3;
-                    this.paramsSearch.auth =3
-                    break;
-                case "员工":
-                    this.params.auth = 1;
-                    this.paramsSearch =1
-                    break;
+              case "二级经理":
+                this.params.auth = 2;
+                this.paramsSearch = 2;
+                break;
+              case "三级经理":
+                this.params.auth = 3;
+                this.paramsSearch.auth = 3;
+                break;
+              case "员工":
+                this.params.auth = 1;
+                this.paramsSearch = 1;
+                break;
             }
+          }
         }
       });
       await this.getData();
@@ -904,7 +913,7 @@ export default {
       this.actionName = "";
       this.params.id = "";
       this.getList(this.params, this.pageSize);
-      this.$router.go(0)
+      this.$router.go(0);
     },
     // 获取目录
     async getData() {
@@ -917,62 +926,63 @@ export default {
         data: { isFile: "0" },
       }).then((res) => {
         if (res.data && res.data.length > 0) {
-            res.data.map((item) =>{
-                if (this.jurisdiction.isSuper === "1"){//全部加入list
-                    this.menuList = res.data;
-                    console.log(this.menuList)
-                }else{ //不是超级管理员
-                    if(item.powerSwitch === 0){ //不是固定文件夹
-                        this.menuList.push(item)
-                    }
-                    if(this.jurisdiction.roleType ==='省公司') {
-                            if(item.powerSwitch === 1){ //是固定文件夹
-                                if (
-                                    this.jurisdiction.roleId === item.id ||
-                                    this.jurisdiction.parentId === item.id
-                                ) {
-                                    this.menuList.push(item);
-                                    if (
-                                        this.jurisdiction.roleDuty === "三级经理" ||
-                                        this.jurisdiction.roleDuty === "员工"
-                                    ) {
-                                        //小弟
-                                        // this.menuList.push(res.data[i]);
-                                        this.menuList.map((item) =>{
-                                            if(item.id === this.jurisdiction.roleId ||this.jurisdiction.parentId===item.id){
-                                                item.childDept.map((items) =>{
-                                                    if(items.id === this.jurisdiction.roleId){
-                                                        item.childDept = [];
-                                                        item.childDept.push(items)
-                                                    }
-                                                })
-                                            }
-                                        })
-
-                                    }
-                                }
+          res.data.map((item) => {
+            if (this.jurisdiction.isSuper === "1") {
+              //全部加入list
+              this.menuList = res.data;
+              console.log(this.menuList);
+            } else {
+              //不是超级管理员
+              if (item.powerSwitch === 0) {
+                //不是固定文件夹
+                this.menuList.push(item);
+              }
+              if (this.jurisdiction.roleType === "省公司") {
+                if (item.powerSwitch === 1) {
+                  //是固定文件夹
+                  if (
+                    this.jurisdiction.roleId === item.id ||
+                    this.jurisdiction.parentId === item.id
+                  ) {
+                    this.menuList.push(item);
+                    if (
+                      this.jurisdiction.roleDuty === "三级经理" ||
+                      this.jurisdiction.roleDuty === "员工"
+                    ) {
+                      //小弟
+                      // this.menuList.push(res.data[i]);
+                      this.menuList.map((item) => {
+                        if (
+                          item.id === this.jurisdiction.roleId ||
+                          this.jurisdiction.parentId === item.id
+                        ) {
+                          item.childDept.map((items) => {
+                            if (items.id === this.jurisdiction.roleId) {
+                              item.childDept = [];
+                              item.childDept.push(items);
                             }
+                          });
+                        }
+                      });
                     }
-
-
+                  }
                 }
-
-
-            })
-            // if (this.jurisdiction.isSuper == "1") {
-            //   this.menuList = res.data;
-            // }else{
-            //     for (let i = 0; i < res.data.length ; i++) {
-            //         if(this.jurisdiction.roleType ==='省公司' && res.data[i].id === '99999999999999999'){
-            //             this.menuList.push(res.data[i])
-            //         }
-            //         else {
-            //
-            //         }
-            //     }
-            // }
+              }
             }
-
+          });
+          // if (this.jurisdiction.isSuper == "1") {
+          //   this.menuList = res.data;
+          // }else{
+          //     for (let i = 0; i < res.data.length ; i++) {
+          //         if(this.jurisdiction.roleType ==='省公司' && res.data[i].id === '99999999999999999'){
+          //             this.menuList.push(res.data[i])
+          //         }
+          //         else {
+          //
+          //         }
+          //     }
+          // }
+        }
       });
     },
     // 获取权限