|
@@ -16,7 +16,7 @@
|
|
|
}" :striped="true" ref="tableRef" @page-num-change="handlePageNumChange"
|
|
}" :striped="true" ref="tableRef" @page-num-change="handlePageNumChange"
|
|
|
@page-size-change="handlePageSizeChange">
|
|
@page-size-change="handlePageSizeChange">
|
|
|
<template #tableTitle>
|
|
<template #tableTitle>
|
|
|
- <el-button type="primary" @click="openCreateDrawer" :icon="Plus">添加</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="openCreateDrawer" :icon="Plus" v-permission="{ action: [PERM_DEVICE.NVR_ADD] }">添加</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
<template #empty>
|
|
<template #empty>
|
|
|
<div class="empty-content flex flex-col items-center">
|
|
<div class="empty-content flex flex-col items-center">
|
|
@@ -42,6 +42,8 @@ import { columns } from './overviewColumns';
|
|
|
import { BasicTable, TableActionIcons, BasicColumn } from '@/components/Table';
|
|
import { BasicTable, TableActionIcons, BasicColumn } from '@/components/Table';
|
|
|
import CreateDrawer from './components/CreateDrawer.vue';
|
|
import CreateDrawer from './components/CreateDrawer.vue';
|
|
|
import { deleteNVRListItem, getNVRList, NVRListItemAll } from '@/api/camera/camera-nvr';
|
|
import { deleteNVRListItem, getNVRList, NVRListItemAll } from '@/api/camera/camera-nvr';
|
|
|
|
|
+import { PERM_DEVICE } from '@/types/permission/constants';
|
|
|
|
|
+import { useUserStore } from '@/store/modules/user';
|
|
|
|
|
|
|
|
const nvrList = ref<NVRListItemAll[]>([]);
|
|
const nvrList = ref<NVRListItemAll[]>([]);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
@@ -103,6 +105,8 @@ const handleDelete = (row) => {
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const userStore = useUserStore();
|
|
|
|
|
+
|
|
|
//操作列
|
|
//操作列
|
|
|
const actionColumn: BasicColumn = reactive({
|
|
const actionColumn: BasicColumn = reactive({
|
|
|
width: 200,
|
|
width: 200,
|
|
@@ -111,23 +115,30 @@ const actionColumn: BasicColumn = reactive({
|
|
|
key: 'action',
|
|
key: 'action',
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
render(record) {
|
|
render(record) {
|
|
|
|
|
+ const actions: any[] = [];
|
|
|
|
|
+
|
|
|
|
|
+ if (userStore.checkPermission(PERM_DEVICE.NVR_EDIT)) {
|
|
|
|
|
+ actions.push({
|
|
|
|
|
+ label: '修改',
|
|
|
|
|
+ icon: editIcon,
|
|
|
|
|
+ onClick: handleEdit.bind(null, record.row),
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (userStore.checkPermission(PERM_DEVICE.NVR_DELETE)) {
|
|
|
|
|
+ actions.push({
|
|
|
|
|
+ label: '删除',
|
|
|
|
|
+ icon: deleteIcon,
|
|
|
|
|
+ onClick: handleDelete.bind(null, record.row),
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return h(TableActionIcons as any, {
|
|
return h(TableActionIcons as any, {
|
|
|
space: 20,
|
|
space: 20,
|
|
|
color: '#629bf9',
|
|
color: '#629bf9',
|
|
|
style: 'img',
|
|
style: 'img',
|
|
|
size: 16,
|
|
size: 16,
|
|
|
- actionIcons: [
|
|
|
|
|
- {
|
|
|
|
|
- label: '修改',
|
|
|
|
|
- icon: editIcon,
|
|
|
|
|
- onClick: handleEdit.bind(null, record.row),
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '删除',
|
|
|
|
|
- icon: deleteIcon,
|
|
|
|
|
- onClick: handleDelete.bind(null, record.row),
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ actionIcons: actions
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|