|
|
@@ -17,7 +17,7 @@ import {
|
|
|
refreshDictCache,
|
|
|
updateSystemDictType
|
|
|
} 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 { cloneDeep } from "lodash";
|
|
|
|
|
|
@@ -145,6 +145,9 @@ const tableConfig: PlusColumn[] = [
|
|
|
|
|
|
const { buttons } = useTable();
|
|
|
|
|
|
+// 权限
|
|
|
+const perms = resolveDirective("perms");
|
|
|
+
|
|
|
buttons.value = [
|
|
|
{
|
|
|
// 修改
|
|
|
@@ -160,7 +163,8 @@ buttons.value = [
|
|
|
state.isCreate = false;
|
|
|
state.dialogVisible = true;
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ directives: [[perms, "system:dict:edit"]]
|
|
|
},
|
|
|
{
|
|
|
// 删除
|
|
|
@@ -187,7 +191,8 @@ buttons.value = [
|
|
|
} catch (e) {
|
|
|
ElMessage.error("删除失败");
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ directives: [[perms, "system:dict:remove"]]
|
|
|
}
|
|
|
];
|
|
|
|
|
|
@@ -335,7 +340,12 @@ const { form, confirmLoading, rules, dialogVisible } = toRefs(state);
|
|
|
</template>
|
|
|
<template #table-title>
|
|
|
<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 size="default" type="default" @click="handleRefresh">
|