|
|
@@ -3,17 +3,18 @@ import type { VbenFormProps } from '@vben/common-ui';
|
|
3
|
3
|
|
|
4
|
4
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
5
|
5
|
|
|
6
|
|
-import { ref } from 'vue';
|
|
7
|
|
-
|
|
8
|
6
|
import { Page, useVbenDrawer } from '@vben/common-ui';
|
|
9
|
7
|
|
|
10
|
|
-import { ElMessageBox, ElMessage } from 'element-plus';
|
|
|
8
|
+import { ElMessage, ElMessageBox } from 'element-plus';
|
|
11
|
9
|
|
|
12
|
10
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
|
11
|
+import {
|
|
|
12
|
+ deleteEmergencyMaterial,
|
|
|
13
|
+ emergencyMaterialList,
|
|
|
14
|
+} from '#/api/oilstation/emergency/emergency';
|
|
13
|
15
|
|
|
14
|
16
|
import { queryFormSchema, tableColumns } from './emergency-data';
|
|
15
|
17
|
import EmergencyDrawerComp from './emergency-drawer.vue';
|
|
16
|
|
-import { emergencyMaterialList, deleteEmergencyMaterial } from '#/api/oilstation/emergency/emergency';
|
|
17
|
18
|
|
|
18
|
19
|
const formOptions: VbenFormProps = {
|
|
19
|
20
|
commonConfig: {
|
|
|
@@ -45,14 +46,14 @@ const gridOptions: VxeGridProps = {
|
|
45
|
46
|
pageNum: page.currentPage,
|
|
46
|
47
|
pageSize: page.pageSize,
|
|
47
|
48
|
};
|
|
48
|
|
-
|
|
|
49
|
+
|
|
49
|
50
|
// 调用API获取数据
|
|
50
|
51
|
const response = await emergencyMaterialList(params);
|
|
51
|
|
- console.log('查询应急防护列表响应:', response)
|
|
|
52
|
+ console.log('查询应急防护列表响应:', response);
|
|
52
|
53
|
const data = response || {};
|
|
53
|
|
- return {
|
|
54
|
|
- items: data.rows|| [],
|
|
55
|
|
- total: data.total || 0
|
|
|
54
|
+ return {
|
|
|
55
|
+ items: data.rows || [],
|
|
|
56
|
+ total: data.total || 0,
|
|
56
|
57
|
};
|
|
57
|
58
|
} catch (error) {
|
|
58
|
59
|
console.error('查询应急防护列表失败:', error);
|
|
|
@@ -139,6 +140,7 @@ function deleteHandle() {
|
|
139
|
140
|
:disabled="
|
|
140
|
141
|
!(basicTableApi?.grid?.getCheckboxRecords?.()?.length > 0)
|
|
141
|
142
|
"
|
|
|
143
|
+ v-access:code="['oilstation:emergency:remove']"
|
|
142
|
144
|
@click="deleteHandle"
|
|
143
|
145
|
>
|
|
144
|
146
|
批量删除
|
|
|
@@ -146,6 +148,7 @@ function deleteHandle() {
|
|
146
|
148
|
<ElButton
|
|
147
|
149
|
type="primary"
|
|
148
|
150
|
@click="openDrawer"
|
|
|
151
|
+ v-access:code="['oilstation:emergency:add']"
|
|
149
|
152
|
>
|
|
150
|
153
|
新增应急防护
|
|
151
|
154
|
</ElButton>
|
|
|
@@ -157,19 +160,14 @@ function deleteHandle() {
|
|
157
|
160
|
size="small"
|
|
158
|
161
|
type="primary"
|
|
159
|
162
|
plain
|
|
|
163
|
+ v-access:code="['oilstation:emergency:edit']"
|
|
160
|
164
|
@click="handleEdit(row)"
|
|
161
|
165
|
>
|
|
162
|
166
|
编辑
|
|
163
|
167
|
</ElButton>
|
|
164
|
168
|
<ElPopconfirm title="确认删除" @confirm="confirmEvent(row)">
|
|
165
|
169
|
<template #reference>
|
|
166
|
|
- <ElButton
|
|
167
|
|
- size="small"
|
|
168
|
|
- type="danger"
|
|
169
|
|
- plain
|
|
170
|
|
- >
|
|
171
|
|
- 删除
|
|
172
|
|
- </ElButton>
|
|
|
170
|
+ <ElButton size="small" type="danger" plain> 删除 </ElButton>
|
|
173
|
171
|
</template>
|
|
174
|
172
|
</ElPopconfirm>
|
|
175
|
173
|
</ElSpace>
|