From 026d4d630d2de6253a2e17192e06abe674fdf7b0 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 02 二月 2026 10:30:01 +0800
Subject: [PATCH] 安全生产模块所有附件页面
---
src/views/safeProduction/dangerInvestigation/index.vue | 44 ++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/src/views/safeProduction/dangerInvestigation/index.vue b/src/views/safeProduction/dangerInvestigation/index.vue
index d585fc3..fb148e6 100644
--- a/src/views/safeProduction/dangerInvestigation/index.vue
+++ b/src/views/safeProduction/dangerInvestigation/index.vue
@@ -419,8 +419,11 @@
v-model="fileListDialogVisible"
:show-upload-button="true"
:show-delete-button="true"
+ :is-show-pagination="true"
+ :page="filePagination"
:upload-method="handleUpload"
:delete-method="handleFileDelete"
+ @pagination="paginationSearch"
title="闄勪欢鍒楄〃" />
</div>
</template>
@@ -913,6 +916,11 @@
const statusStr = shippingStatus ? String(shippingStatus).trim() : "";
return statusStr === "寰呭彂璐�" || statusStr === "瀹℃牳鎷掔粷";
};
+ const filePagination = ref({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
/**
* 涓嬭浇鏂囦欢
@@ -924,9 +932,15 @@
const currentFileRow = ref(null);
const downLoadFile = row => {
currentFileRow.value = row;
- fileListPage({ safeHiddenId: row.id }).then(res => {
+ fileListPage({
+ safeHiddenId: row.id,
+ current: filePagination.value.current,
+ size: filePagination.value.size,
+ }).then(res => {
if (fileListRef.value) {
- fileListRef.value.open(res.data.records);
+ fileListRef.value.open(res.data.records || []);
+ console.log("res.data", res.data);
+ filePagination.value.total = res.data.total || 0;
}
});
};
@@ -1012,6 +1026,8 @@
// 閲嶆柊鍔犺浇鏂囦欢鍒楄〃
const listRes = await fileListPage({
safeHiddenId: currentFileRow.value.id,
+ current: filePagination.value.current,
+ size: filePagination.value.size,
});
if (listRes.code === 200 && fileListRef.value) {
const fileList = (listRes.data?.records || []).map(item => ({
@@ -1021,6 +1037,7 @@
...item,
}));
fileListRef.value.setList(fileList);
+ filePagination.value.total = listRes.data?.total || 0;
}
// 杩斿洖鏂版枃浠朵俊鎭�
resolve({
@@ -1048,6 +1065,26 @@
input.click();
});
};
+ // 鍒嗛〉鏌ヨ鏂囦欢鍒楄〃
+ const paginationSearch = async (page, size) => {
+ filePagination.value.current = page;
+ filePagination.value.size = size;
+ const listRes = await fileListPage({
+ safeHiddenId: currentFileRow.value.id,
+ current: filePagination.value.current,
+ size: filePagination.value.size,
+ });
+ if (listRes.code === 200) {
+ const fileList = (listRes.data?.records || []).map(item => ({
+ name: item.name,
+ url: item.url,
+ id: item.id,
+ ...item,
+ }));
+ fileListRef.value.setList(fileList);
+ filePagination.value.total = listRes.data?.total || 0;
+ }
+ };
// 鍒犻櫎闄勪欢
const handleFileDelete = async row => {
try {
@@ -1058,6 +1095,8 @@
if (currentFileRow.value && fileListRef.value) {
const listRes = await fileListPage({
safeHiddenId: currentFileRow.value.id,
+ current: filePagination.value.current,
+ size: filePagination.value.size,
});
if (listRes.code === 200) {
const fileList = (listRes.data?.records || []).map(item => ({
@@ -1067,6 +1106,7 @@
...item,
}));
fileListRef.value.setList(fileList);
+ filePagination.value.total = listRes.data?.total || 0;
}
}
return true; // 杩斿洖 true 琛ㄧず鍒犻櫎鎴愬姛锛岀粍浠朵細鏇存柊鍒楄〃
--
Gitblit v1.9.3