|
|
@@ -91,8 +91,13 @@
|
|
|
<template #action="scope">
|
|
|
<div class="action-container--div">
|
|
|
<ActionButton text="查看" @click="handleViewDetail(scope.row.id)" />
|
|
|
- <ActionButton text="编辑" @click="handleEditVehicleInfo(scope.row.id)" />
|
|
|
<ActionButton
|
|
|
+ text="编辑"
|
|
|
+ v-if="accidentManagePermission"
|
|
|
+ @click="handleEditVehicleInfo(scope.row.id)"
|
|
|
+ />
|
|
|
+ <ActionButton
|
|
|
+ v-if="accidentManagePermission"
|
|
|
text="删除"
|
|
|
:popconfirm="{
|
|
|
title: '是否删除该交通事故记录?',
|
|
|
@@ -307,16 +312,6 @@
|
|
|
tableConfig.loading = false;
|
|
|
};
|
|
|
|
|
|
- // 动态生成表格列配置
|
|
|
- const getTableColumns = () => {
|
|
|
- if (accidentManagePermission.value) {
|
|
|
- return ACCIDENT_LIST_TABLE_COLUMNS;
|
|
|
- } else {
|
|
|
- // 过滤掉操作列
|
|
|
- return ACCIDENT_LIST_TABLE_COLUMNS.filter((column) => column.prop !== 'action' && column.type !== 'selection');
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
getTableData();
|
|
|
accidentManagePermission.value = Boolean(
|
|
|
@@ -325,7 +320,6 @@
|
|
|
tableConfig.maxHeight = accidentManagePermission.value
|
|
|
? ACCIDENT_LIST_TABLE_MAX_HEIGHT_PERMISSION
|
|
|
: ACCIDENT_LIST_TABLE_MAX_HEIGHT_DEFAULT;
|
|
|
- tableConfig.columns = getTableColumns();
|
|
|
});
|
|
|
</script>
|
|
|
|