zouzs 1 долоо хоног өмнө
parent
commit
fa0ebf89cc

+ 13 - 4
src/views/system/code/index.vue

@@ -9,7 +9,7 @@ import {
   PlusPageInstance,
   PlusPageInstance,
   useTable
   useTable
 } from "plus-pro-components";
 } from "plus-pro-components";
-import { computed, reactive, ref, toRefs } from "vue";
+import { computed, reactive, ref, resolveDirective, toRefs } from "vue";
 import { ElMessage } from "element-plus";
 import { ElMessage } from "element-plus";
 import { cloneDeep } from "lodash";
 import { cloneDeep } from "lodash";
 import {
 import {
@@ -63,6 +63,8 @@ const tableConfig: PlusColumn[] = [
 
 
 const { buttons } = useTable();
 const { buttons } = useTable();
 
 
+const perms = resolveDirective("perms");
+
 buttons.value = [
 buttons.value = [
   {
   {
     // 修改
     // 修改
@@ -78,7 +80,8 @@ buttons.value = [
         state.isCreate = false;
         state.isCreate = false;
         state.dialogVisible = true;
         state.dialogVisible = true;
       });
       });
-    }
+    },
+    directives: [[perms, "system:code:edit"]]
   },
   },
   {
   {
     // 删除
     // 删除
@@ -105,7 +108,8 @@ buttons.value = [
       } catch (e) {
       } catch (e) {
         ElMessage.error("删除失败");
         ElMessage.error("删除失败");
       }
       }
-    }
+    },
+    directives: [[perms, "system:code:remove"]]
   }
   }
 ];
 ];
 
 
@@ -228,7 +232,12 @@ const { form, confirmLoading, rules, dialogVisible } = toRefs(state);
       </template>
       </template>
       <template #table-title>
       <template #table-title>
         <el-row class="button-row">
         <el-row class="button-row">
-          <el-button size="default" type="success" @click="handleCreate">
+          <el-button
+            v-perms="'system:code:add'"
+            size="default"
+            type="success"
+            @click="handleCreate"
+          >
             新增
             新增
           </el-button>
           </el-button>
         </el-row>
         </el-row>

+ 23 - 5
src/views/system/dept/index.vue

@@ -22,7 +22,12 @@
     >
     >
       <template #table-title>
       <template #table-title>
         <el-row class="button-row">
         <el-row class="button-row">
-          <el-button size="default" type="success" @click="handleCreate">
+          <el-button
+            v-perms="'system:dept:add'"
+            size="default"
+            type="success"
+            @click="handleCreate"
+          >
             新增
             新增
           </el-button>
           </el-button>
           <el-button size="default" type="default" @click="toggleExpandAll">
           <el-button size="default" type="default" @click="toggleExpandAll">
@@ -52,7 +57,14 @@
 </template>
 </template>
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
-import { computed, nextTick, reactive, ref, toRefs } from "vue";
+import {
+  computed,
+  nextTick,
+  reactive,
+  ref,
+  resolveDirective,
+  toRefs
+} from "vue";
 import type { FormRules } from "element-plus";
 import type { FormRules } from "element-plus";
 import { ElMessage } from "element-plus";
 import { ElMessage } from "element-plus";
 import {
 import {
@@ -347,6 +359,9 @@ const handleClose = () => {
   console.log(dialogForm.value.formInstance);
   console.log(dialogForm.value.formInstance);
 };
 };
 
 
+// 权限
+const perms = resolveDirective("perms");
+
 buttons.value = [
 buttons.value = [
   {
   {
     // 修改
     // 修改
@@ -362,7 +377,8 @@ buttons.value = [
         state.isCreate = false;
         state.isCreate = false;
         state.dialogVisible = true;
         state.dialogVisible = true;
       });
       });
-    }
+    },
+    directives: [[perms, "system:dept:edit"]]
   },
   },
   {
   {
     // 新增
     // 新增
@@ -379,7 +395,8 @@ buttons.value = [
       };
       };
       state.isCreate = true;
       state.isCreate = true;
       state.dialogVisible = true;
       state.dialogVisible = true;
-    }
+    },
+    directives: [[perms, "system:dept:add"]]
   },
   },
   {
   {
     // 删除
     // 删除
@@ -406,7 +423,8 @@ buttons.value = [
       } catch (e) {
       } catch (e) {
         ElMessage.error("删除失败");
         ElMessage.error("删除失败");
       }
       }
-    }
+    },
+    directives: [[perms, "system:dept:remove"]]
   }
   }
 ];
 ];
 
 

+ 14 - 4
src/views/system/dict/index.vue

@@ -17,7 +17,7 @@ import {
   refreshDictCache,
   refreshDictCache,
   updateSystemDictType
   updateSystemDictType
 } from "@/api/system/dict";
 } from "@/api/system/dict";
-import { computed, reactive, ref, toRefs } from "vue";
+import { computed, reactive, ref, resolveDirective, toRefs } from "vue";
 import { ElMessage } from "element-plus";
 import { ElMessage } from "element-plus";
 import { cloneDeep } from "lodash";
 import { cloneDeep } from "lodash";
 
 
@@ -145,6 +145,9 @@ const tableConfig: PlusColumn[] = [
 
 
 const { buttons } = useTable();
 const { buttons } = useTable();
 
 
+// 权限
+const perms = resolveDirective("perms");
+
 buttons.value = [
 buttons.value = [
   {
   {
     // 修改
     // 修改
@@ -160,7 +163,8 @@ buttons.value = [
         state.isCreate = false;
         state.isCreate = false;
         state.dialogVisible = true;
         state.dialogVisible = true;
       });
       });
-    }
+    },
+    directives: [[perms, "system:dict:edit"]]
   },
   },
   {
   {
     // 删除
     // 删除
@@ -187,7 +191,8 @@ buttons.value = [
       } catch (e) {
       } catch (e) {
         ElMessage.error("删除失败");
         ElMessage.error("删除失败");
       }
       }
-    }
+    },
+    directives: [[perms, "system:dict:remove"]]
   }
   }
 ];
 ];
 
 
@@ -335,7 +340,12 @@ const { form, confirmLoading, rules, dialogVisible } = toRefs(state);
       </template>
       </template>
       <template #table-title>
       <template #table-title>
         <el-row class="button-row">
         <el-row class="button-row">
-          <el-button size="default" type="success" @click="handleCreate">
+          <el-button
+            v-perms="'system:dict:add'"
+            size="default"
+            type="success"
+            @click="handleCreate"
+          >
             新增
             新增
           </el-button>
           </el-button>
           <el-button size="default" type="default" @click="handleRefresh">
           <el-button size="default" type="default" @click="handleRefresh">

+ 7 - 1
src/views/system/logininfor/index.vue

@@ -329,6 +329,7 @@ const { form, dialogVisible } = toRefs(state);
       <template #table-title>
       <template #table-title>
         <el-row class="button-row">
         <el-row class="button-row">
           <el-button
           <el-button
+            v-perms="'system:logininfor:remove'"
             size="default"
             size="default"
             :disabled="multipleSelection.length === 0"
             :disabled="multipleSelection.length === 0"
             type="danger"
             type="danger"
@@ -336,7 +337,12 @@ const { form, dialogVisible } = toRefs(state);
           >
           >
             删除
             删除
           </el-button>
           </el-button>
-          <el-button size="default" type="danger" @click="handleClear">
+          <el-button
+            v-perms="'system:logininfor:remove'"
+            size="default"
+            type="danger"
+            @click="handleClear"
+          >
             清空日志
             清空日志
           </el-button>
           </el-button>
         </el-row>
         </el-row>

+ 25 - 5
src/views/system/menu/index.vue

@@ -22,7 +22,12 @@
     >
     >
       <template #table-title>
       <template #table-title>
         <el-row class="button-row">
         <el-row class="button-row">
-          <el-button size="default" type="success" @click="handleCreate">
+          <el-button
+            v-perms="'system:menu:add'"
+            size="default"
+            type="success"
+            @click="handleCreate"
+          >
             新增
             新增
           </el-button>
           </el-button>
           <el-button size="default" type="default" @click="toggleExpandAll">
           <el-button size="default" type="default" @click="toggleExpandAll">
@@ -56,7 +61,16 @@
 </template>
 </template>
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
-import { computed, h, nextTick, onMounted, reactive, ref, toRefs } from "vue";
+import {
+  computed,
+  h,
+  nextTick,
+  onMounted,
+  reactive,
+  ref,
+  resolveDirective,
+  toRefs
+} from "vue";
 import type { FormRules } from "element-plus";
 import type { FormRules } from "element-plus";
 import { ElMessage } from "element-plus";
 import { ElMessage } from "element-plus";
 import {
 import {
@@ -595,6 +609,9 @@ const handleClose = () => {
   console.log(dialogForm.value.formInstance);
   console.log(dialogForm.value.formInstance);
 };
 };
 
 
+// 权限
+const perms = resolveDirective("perms");
+
 buttons.value = [
 buttons.value = [
   {
   {
     // 修改
     // 修改
@@ -610,7 +627,8 @@ buttons.value = [
         state.isCreate = false;
         state.isCreate = false;
         state.dialogVisible = true;
         state.dialogVisible = true;
       });
       });
-    }
+    },
+    directives: [[perms, "system:menu:edit"]]
   },
   },
   {
   {
     // 新增
     // 新增
@@ -642,7 +660,8 @@ buttons.value = [
       };
       };
       state.isCreate = true;
       state.isCreate = true;
       state.dialogVisible = true;
       state.dialogVisible = true;
-    }
+    },
+    directives: [[perms, "system:menu:add"]]
   },
   },
   {
   {
     // 删除
     // 删除
@@ -668,7 +687,8 @@ buttons.value = [
       } catch (e) {
       } catch (e) {
         ElMessage.error("删除失败");
         ElMessage.error("删除失败");
       }
       }
-    }
+    },
+    directives: [[perms, "system:menu:remove"]]
   }
   }
 ];
 ];
 
 

+ 7 - 1
src/views/system/operlog/index.vue

@@ -369,6 +369,7 @@ const { form, dialogVisible } = toRefs(state);
       <template #table-title>
       <template #table-title>
         <el-row class="button-row">
         <el-row class="button-row">
           <el-button
           <el-button
+            v-perms="'system:operlog:remove'"
             size="default"
             size="default"
             :disabled="multipleSelection.length === 0"
             :disabled="multipleSelection.length === 0"
             type="danger"
             type="danger"
@@ -376,7 +377,12 @@ const { form, dialogVisible } = toRefs(state);
           >
           >
             删除
             删除
           </el-button>
           </el-button>
-          <el-button size="default" type="danger" @click="handleClear">
+          <el-button
+            v-perms="'system:operlog:remove'"
+            size="default"
+            type="danger"
+            @click="handleClear"
+          >
             清空日志
             清空日志
           </el-button>
           </el-button>
         </el-row>
         </el-row>