1
lzhe
2024-05-24 c9ce5e7f9a9ef52c66baf4f8a6e8d9e48b7cb251
src/views/console/authority/role/index.vue
@@ -29,7 +29,7 @@
               <div class="treeMain">
                  <el-tabs tab-position="left" class="demo-tabs" v-model="menuActiveName" @tab-click="menuHandleClick">
                     <el-tab-pane v-for="item in menuGrantList" :label="item.title" :name="item.title">
                        <el-tree v-if="showtree" :data="treeData" :props="{ label: 'title',children: 'children'}" node-key="id" show-checkbox @check-change="treeHandleCheckChange" :default-checked-keys="treeCheck" default-expand-all />
                        <el-tree ref="tree" v-if="showtree" :data="treeData" :props="{ label: 'title',children: 'children'}" node-key="id" show-checkbox @check-change="treeHandleCheckChange" :default-checked-keys="treeCheck" default-expand-all />
                     </el-tab-pane>
                  </el-tabs>
                  <div class="roleSubmit"><el-button type="primary" :loading="submitIsSaveing" @click="roleSubmit()">保 存</el-button></div>
@@ -130,28 +130,16 @@
            var obj = {
               apiScopeIds: [],
               dataScopeIds: [],
               menuIds: ["1519970491499069442", "1519971258746322945", "1519972116229832706", "1519972350729175041"],
               menuIds: this.$refs.tree[0].getCheckedKeys(),
               roleIds: [this.tableLiId]
            }
            // 0: "1519970491499069442"
            // 1: "1519971258746322945"
            // 2: "1519972116229832706"
            // 3: "1519972350729175041"
            // 4: "1519972501539569666"
            // 5: "1123598815738675201"
            // 6: "1483632111746801666"
            // 7: "1470274120439566338"
            // 8: "1503966666579030018"
            // 9: "1529388585562615809"
            // 10: "1529365139944321026"
            // this.$HTTP.post(`/api/blade-system/role/grant`,obj).then(res=> {
            //    this.isSaveing = false;
            //    if(res.code == 200) {
            //       this.userVisible = false;
            //       this.$message.success("操作成功");
            //       this.getBladeList(this.tableLiId);  //获取人员列表
            //    }
            // })
            this.isSaveing = true;
            this.$HTTP.post(`/api/blade-system/role/grant`,obj).then(res=> {
               this.isSaveing = false;
               if(res.code == 200) {
                  this.$message.success("操作成功");
               }
            })
         },
         menuHandleClick(tab, event) {
            this.setTreeList(this.menuGrantList,event.target.innerText);  //tree
@@ -234,7 +222,11 @@
               if(res.code == 200) {
                  this.userVisible = false;
                  this.$message.success("操作成功");
                  this.getBladeList(this.tableLiId);  //获取人员列表
                  this.$HTTP.get(`/api/blade-user/${this.tableLiId}/list`).then(res=> {
                     if(res.code == 200) {
                        this.roleHeaderList = res.data;
                     }
                  })
               }
            })
         },
@@ -275,7 +267,6 @@
                  res.data[0].active = true;
                  this.tableData = res.data;
                  this.getBladeList(this.tableData[0],0);  //默认第一个角色获
                  console.log(this.tableData[0],this.tableData[0].id)
               }
            })
         },
@@ -378,7 +369,7 @@
   line-height: 41px;
   font-size: 14px;
   text-align: center;
   background-color: #3b8e8e;
   background-color: #409eff;
   color: #fff;
}
.rolePage .roleContainer ul {
@@ -398,7 +389,7 @@
}
.rolePage .roleContainer ul li .active {
   font-weight: bold;
   color: #3b8e8e;
   color: #409eff;
}
.rolePage .roleContainer ul li:hover {
   background-color: #f5f7fa;
@@ -420,7 +411,7 @@
.role-main-title {
   padding: 6px 10px;
    font-size: 14px;
    background-color: #d8e8d8;
    background-color: #9dc7f2;
    margin-bottom: 8px;
    border-radius: 2px;
}
@@ -440,7 +431,7 @@
    text-overflow: ellipsis;
}
.role-main-header ul li.titleActive {
   border: 1px solid #3b8e8e;
   border: 1px solid #409eff;
}
.role-main-header ul li.role-header-add {
   display: inline-block;