فهرست منبع

2022/10/14 getRoleList方法的修改

Cheng 3 سال پیش
والد
کامیت
d74f165671
5فایلهای تغییر یافته به همراه98 افزوده شده و 71 حذف شده
  1. 21 13
      src/views/department/index.vue
  2. 21 13
      src/views/group/index.vue
  3. 21 13
      src/views/position/index.vue
  4. 17 18
      src/views/role/index.vue
  5. 18 14
      src/views/user/index.vue

+ 21 - 13
src/views/department/index.vue

@@ -268,19 +268,27 @@ export default {
 						this.tenantList = response.data
 					})
 			},
-    getRoleList(){
-        this.$api.getAllRoleList().then(response => {
-        this.roleList = response.data
-        var a = this.userinfo.rList.findIndex((item) => {
-							return item.roleId == 1;
-							});
-							if(a == -1){
-								this.roleList[0].disabled=true
-							}else{
-								this.roleList[0].disabled=false
-							}
-      })
-    },
+      getRoleList() {
+        this.$api.getAllRoleList().then((response) => {
+          this.roleList = response.data;
+          var a = this.userinfo.rList.findIndex((item) => {
+              return item.roleId == 1;
+              });
+              if(a == -1){
+                var b = this.roleList.findIndex(i=>{
+                  return i.id == 1
+                })
+                if(b !=-1){
+                  this.roleList[b].disabled=true
+                }
+                
+              }else{
+                this.roleList[0].disabled=false
+              }
+          
+        
+        });
+      },
     submit() {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {

+ 21 - 13
src/views/group/index.vue

@@ -202,19 +202,27 @@ export default {
 						this.tenantList = response.data
 					})
 			},
-    getRoleList(){
-      this.$api.getAllRoleList().then(response => {
-        this.roleList = response.data 
-        var a = this.userinfo.rList.findIndex((item) => {
-							return item.roleId == 1;
-							});
-							if(a == -1){
-								this.roleList[0].disabled=true
-							}else{
-								this.roleList[0].disabled=false
-							}
-      })
-    },
+      getRoleList() {
+        this.$api.getAllRoleList().then((response) => {
+          this.roleList = response.data;
+          var a = this.userinfo.rList.findIndex((item) => {
+              return item.roleId == 1;
+              });
+              if(a == -1){
+                var b = this.roleList.findIndex(i=>{
+                  return i.id == 1
+                })
+                if(b !=-1){
+                  this.roleList[b].disabled=true
+                }
+                
+              }else{
+                this.roleList[0].disabled=false
+              }
+          
+        
+        });
+      },
     getList() {
       this.loading = true
       this.$api.getGroupList(this.queryParams).then(response => {

+ 21 - 13
src/views/position/index.vue

@@ -234,19 +234,27 @@ export default {
 						this.tenantList = response.data
 					})
 			},
-    getRoleList(){
-      this.$api.getAllRoleList().then(response => {
-        this.roleList = response.data
-        var a = this.userinfo.rList.findIndex((item) => {
-							return item.roleId == 1;
-							});
-							if(a == -1){
-								this.roleList[0].disabled=true
-							}else{
-								this.roleList[0].disabled=false
-							}
-      })
-    },
+      getRoleList() {
+        this.$api.getAllRoleList().then((response) => {
+          this.roleList = response.data;
+          var a = this.userinfo.rList.findIndex((item) => {
+              return item.roleId == 1;
+              });
+              if(a == -1){
+                var b = this.roleList.findIndex(i=>{
+                  return i.id == 1
+                })
+                if(b !=-1){
+                  this.roleList[b].disabled=true
+                }
+                
+              }else{
+                this.roleList[0].disabled=false
+              }
+          
+        
+        });
+      },
     submit() {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {

+ 17 - 18
src/views/role/index.vue

@@ -376,18 +376,17 @@ export default {
   methods: {
     // getCheckedNodes()
 
-    a() {
-      console.log(this.personnel.position)
+    // a() {
+    //   console.log(this.personnel.position)
 
-    },
-    b() {
-      console.log(this.name)
-      this.personnel.departmentIds=[]
-      this.name.forEach(item => {
-        this.personnel.departmentIds.push(item[item.length-1])
-      })
-      // console.log(this.personnel)
-    },
+    // },
+    // b() {
+    //   console.log(this.name)
+    //   this.personnel.departmentIds=[]
+    //   this.name.forEach(item => {
+    //     this.personnel.departmentIds.push(item[item.length-1])
+    //   })
+    // },
     getPremissData(id, name, data) {
       // console.log(id, name, data)
       this.pdata = {
@@ -500,7 +499,7 @@ export default {
     handleSelectionChange(val) {
       // console.log(val,this.$refs.multipleTable.selection)
       this.multipleSelection = val;
-      console.log(val)
+      // console.log(val)
     },
     normalizer(node) {
       return {
@@ -586,13 +585,13 @@ export default {
     getclient() {
       this.$api.getAllDepartmentList().then(response => {
         this.department = response.data
-        console.log(this.department)
+        // console.log(this.department)
       })
     },
     getPositionList() {
       this.$api.getAllPositionList().then(response => {
         this.positionList = response.data
-        console.log(this.positionList)
+        // console.log(this.positionList)
       })
     },
     submit() {
@@ -651,7 +650,7 @@ export default {
       })
       this.$api.getPersonnelList(this.personnel).then(response => {
         this.personnelTableData = response.data
-        console.log(response)
+        // console.log(response)
         this.personnelTotal = response.pageColumn.total
         this.load = false
       }).catch(error => {
@@ -687,15 +686,15 @@ export default {
     closeDrawer() {
       this.drawer = false
       this.multipleSelection = ''
-      console.log(this.distributionParam)
-      console.log(this.multipleSelection)
+      // console.log(this.distributionParam)
+      // console.log(this.multipleSelection)
     },
     addRolePersonnelBatch() {
       this.distributionParam.personnelIds = []
       this.multipleSelection.forEach(item => {
         this.distributionParam.personnelIds.push(item.id)
       })
-      console.log(this.distributionParam)
+      // console.log(this.distributionParam)
       this.$api.addRolePersonnelBatch(this.distributionParam).then(response => {
       })
     }

+ 18 - 14
src/views/user/index.vue

@@ -700,20 +700,24 @@ import ret from "bluebird/js/release/util";
 					})
 			},
 			getRoleList() {
-				this.$api.getAllRoleList().then((response) => {
-					this.roleList = response.data;
-					var a = this.userinfo.rList.findIndex((item) => {
-							return item.roleId == 1;
-							});
-							if(a == -1){
-								this.roleList[0].disabled=true
-							}else{
-								this.roleList[0].disabled=false
-							}
-					
-				
-				});
-			},
+        this.$api.getAllRoleList().then((response) => {
+          this.roleList = response.data;
+          var a = this.userinfo.rList.findIndex((item) => {
+              return item.roleId == 1;
+              });
+              if(a == -1){
+                var b = this.roleList.findIndex(i=>{
+                  return i.id == 1
+                })
+                if(b !=-1){
+                  this.roleList[b].disabled=true
+                }
+                
+              }else{
+                this.roleList[0].disabled=false
+              }
+        });
+      },
 			showInputLabel() {
 				// console.log(this.positionAndDepartment.hasOwnProperty('department'))
 				if(this.positionAndDepartment.hasOwnProperty('department')==true){