|
@@ -40,14 +40,14 @@
|
|
|
v-model:expanded-row-keys="state.expandedRowKeys"
|
|
|
:columns="state.columns"
|
|
|
:data="state.tableData"
|
|
|
- expand-column-key="eventFullName"
|
|
|
+ expand-column-key="eventName"
|
|
|
fixed
|
|
|
:width="width"
|
|
|
:height="height"
|
|
|
ref="virtuallyTableRef"
|
|
|
- :scrollbar-always-on="true"
|
|
|
- :row-height="40"
|
|
|
- :header-height="40"
|
|
|
+ :scrollbar-always-on="true"
|
|
|
+ :row-height="40"
|
|
|
+ :header-height="40"
|
|
|
>
|
|
|
</el-table-v2>
|
|
|
</template>
|
|
@@ -67,7 +67,6 @@ import { throttle } from '@/utils/tools';
|
|
|
import other from '@/utils/other';
|
|
|
import { treeEventClassAll, treeEventClassDelete } from '@/api/auxiliary/eventClass';
|
|
|
import { auth } from '@/utils/authFunction';
|
|
|
-import { useResizeObserver } from '@vueuse/core';
|
|
|
// 引入组件
|
|
|
const EventAdd = defineAsyncComponent(() => import('@/views/auxiliary/eventClass/component/Event-add.vue')); // 新增事件
|
|
|
const EventEdit = defineAsyncComponent(() => import('@/views/auxiliary/eventClass/component/Event-edit.vue')); // 修改事件
|
|
@@ -189,8 +188,8 @@ const state = reactive<any>({
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- key: 'eventFullName',
|
|
|
- dataKey: 'eventFullName',
|
|
|
+ key: 'eventName',
|
|
|
+ dataKey: 'eventName',
|
|
|
title: '区域名称',
|
|
|
width: 600,
|
|
|
},
|
|
@@ -221,10 +220,13 @@ const state = reactive<any>({
|
|
|
title: '操作',
|
|
|
width: 100,
|
|
|
cellRenderer: (data: any) => {
|
|
|
- return (
|
|
|
- auth('auxiliary:eventClass:edit') ?
|
|
|
- <el-button link type="primary" onClick={() => onEdit(data)}>修改</el-button> : ''
|
|
|
- )
|
|
|
+ return auth('auxiliary:eventClass:edit') ? (
|
|
|
+ <el-button link type="primary" onClick={() => onEdit(data)}>
|
|
|
+ 修改
|
|
|
+ </el-button>
|
|
|
+ ) : (
|
|
|
+ ''
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
],
|
|
@@ -236,7 +238,7 @@ const formatTable = (list: any[], keyword: string) => {
|
|
|
if (!list.length || !Array.isArray(list)) return [];
|
|
|
let emptyArr: any[] = [];
|
|
|
list.map((item) => {
|
|
|
- if (item.eventFullName.includes(keyword)) {
|
|
|
+ if (item.eventName.includes(keyword)) {
|
|
|
if (item.children && Array.isArray(item.children) && item.children.length > 0) {
|
|
|
item.children = formatTable(item.children, keyword);
|
|
|
}
|
|
@@ -331,7 +333,7 @@ const getNames = (arr: any) => {
|
|
|
if (!arr) return [];
|
|
|
arr.forEach((v: any) => {
|
|
|
if (v.checked) {
|
|
|
- names.value.push(v.eventFullName);
|
|
|
+ names.value.push(v.eventName);
|
|
|
}
|
|
|
if (v.children?.length) {
|
|
|
getNames(v.children);
|
|
@@ -347,10 +349,10 @@ const onDelete = () => {
|
|
|
ElMessageBox.confirm(`此操作将永久删除选择的【${idArray.value.length}】个事件, 是否继续?`, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- autofocus: false,
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true,
|
|
|
+ cancelButtonClass: 'default-button',
|
|
|
+ autofocus: false,
|
|
|
})
|
|
|
.then(() => {
|
|
|
treeEventClassDelete(idArray.value).then(() => {
|
|
@@ -376,9 +378,9 @@ const queryList = async () => {
|
|
|
};
|
|
|
// 修改
|
|
|
const eventEditRef = ref<RefType>();
|
|
|
-const onEdit = (data:any)=>{
|
|
|
+const onEdit = (data: any) => {
|
|
|
eventEditRef.value.openDialog(data.rowData);
|
|
|
-}
|
|
|
+};
|
|
|
// 页面加载时
|
|
|
onMounted(() => {
|
|
|
queryList();
|