Browse Source

权限分配

gks 1 year ago
parent
commit
042654f6a1
2 changed files with 15 additions and 11 deletions
  1. 8 6
      src/views/AuxiliaryIndex/index.vue
  2. 7 5
      src/views/RightDistribution/index.vue

+ 8 - 6
src/views/AuxiliaryIndex/index.vue

@@ -45,7 +45,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['norm:NORMROLE:add']"
+          v-if="checkPermi(['norm:NORMROLE:add'])"
           >新增</el-button
         >
       </el-col>
@@ -57,7 +57,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['norm:NORMROLE:edit']"
+          v-if="checkPermi(['norm:NORMROLE:edit'])"
           >修改</el-button
         >
       </el-col>
@@ -69,7 +69,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['norm:NORMROLE:remove']"
+          v-if="checkPermi(['norm:NORMROLE:remove'])"
           >删除</el-button
         >
       </el-col>
@@ -130,7 +130,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['norm:NORMROLE:edit']"
+            v-if="checkPermi(['norm:NORMROLE:edit'])"
             >修改</el-button
           >
           <el-button
@@ -138,7 +138,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['norm:NORMROLE:remove']"
+            v-if="checkPermi(['norm:NORMROLE:remove'])"
             >删除</el-button
           >
         </template>
@@ -157,7 +157,7 @@
     <el-dialog :title="title" :visible.sync="open" width="35%" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="选择角色" prop="senId">
-          <el-select filterable v-model="form.senId" placeholder="请选择">
+          <el-select filterable   v-model="form.senId" placeholder="请选择">
             <el-option
               v-for="(item) in roleList"
               :key="item.value"
@@ -202,6 +202,7 @@ import {
 import { listQUOTAFEE } from "@/api/norm/QUOTAFEE";
 
 import { listRole } from "@/api/system/role";
+import { checkPermi } from "@/utils/permission.js";
 
 export default {
   name: "NORMROLE",
@@ -297,6 +298,7 @@ export default {
     this.getRoleList();
   },
   methods: {
+    checkPermi,
     changeInd(i) {
       this.form.feeId = this.indList[i].normId;
       this.form.fname = this.indList[i].normName;

+ 7 - 5
src/views/RightDistribution/index.vue

@@ -45,7 +45,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['norm:NORMROLE:add']"
+          v-if="checkPermi(['norm:NORMROLE:add'])"
           >新增</el-button
         >
       </el-col>
@@ -57,7 +57,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['norm:NORMROLE:edit']"
+          v-if="checkPermi(['norm:NORMROLE:edit'])"
           >修改</el-button
         >
       </el-col>
@@ -69,7 +69,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['norm:NORMROLE:remove']"
+          v-if="checkPermi(['norm:NORMROLE:remove'])"
           >删除</el-button
         >
       </el-col>
@@ -126,7 +126,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['norm:NORMROLE:edit']"
+            v-if="checkPermi(['norm:NORMROLE:edit'])"
             >修改</el-button
           >
           <el-button
@@ -134,7 +134,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['norm:NORMROLE:remove']"
+            v-if="checkPermi(['norm:NORMROLE:remove'])"
             >删除</el-button
           >
         </template>
@@ -197,6 +197,7 @@ import {
 } from "@/api/portal/RightDistribution/RightDistribution";
 
 import { listRole } from "@/api/system/role";
+import { checkPermi } from "@/utils/permission.js";
 
 export default {
   name: "NORMROLE",
@@ -290,6 +291,7 @@ export default {
     this.getRoleList();
   },
   methods: {
+    checkPermi,
     statusChange(val) {
       if (val.status == 0) {
         setNORMROLEStart(val.id).then((res) => {