|
|
@@ -18,7 +18,12 @@
|
|
|
>
|
|
|
<template #table-title>
|
|
|
<el-row class="button-row">
|
|
|
- <el-button size="default" type="success" @click="handleCreate">
|
|
|
+ <el-button
|
|
|
+ v-perms="'ipInterface:index:add'"
|
|
|
+ size="default"
|
|
|
+ type="success"
|
|
|
+ @click="handleCreate"
|
|
|
+ >
|
|
|
新增
|
|
|
</el-button>
|
|
|
</el-row>
|
|
|
@@ -55,7 +60,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { computed, reactive, ref, toRefs } from "vue";
|
|
|
+import { computed, reactive, ref, resolveDirective, toRefs } from "vue";
|
|
|
import type { FormRules } from "element-plus";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import {
|
|
|
@@ -351,6 +356,8 @@ const normalizeParams = (params: Record<string, any>) => {
|
|
|
|
|
|
const { buttons } = useTable();
|
|
|
|
|
|
+const perms = resolveDirective("perms");
|
|
|
+
|
|
|
buttons.value = [
|
|
|
{
|
|
|
// 修改
|
|
|
@@ -365,7 +372,8 @@ buttons.value = [
|
|
|
Object.assign(form.value, normalizeParams(params.row));
|
|
|
state.isCreate = false;
|
|
|
state.dialogVisible = true;
|
|
|
- }
|
|
|
+ },
|
|
|
+ directives: [[perms, "ipInterface:index:edit"]]
|
|
|
},
|
|
|
{
|
|
|
// 修改
|
|
|
@@ -381,7 +389,8 @@ buttons.value = [
|
|
|
descriptionsData.value = {
|
|
|
interfaceConfig: val.row.interfaceConfig
|
|
|
};
|
|
|
- }
|
|
|
+ },
|
|
|
+ directives: [[perms, "ipInterface:index:detail"]]
|
|
|
},
|
|
|
{
|
|
|
// 删除
|
|
|
@@ -407,7 +416,8 @@ buttons.value = [
|
|
|
} catch (e) {
|
|
|
ElMessage.error("删除失败");
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ directives: [[perms, "ipInterface:index:remove"]]
|
|
|
}
|
|
|
];
|
|
|
|