From 07f9f8657d057a38792c3822acc9b08d83478967 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 07 五月 2026 14:23:10 +0800
Subject: [PATCH] 合并代码
---
src/views/safeProduction/safetyTrainingAssessment/index.vue | 51 ++++++++++++++++-----------------------------------
1 files changed, 16 insertions(+), 35 deletions(-)
diff --git a/src/views/safeProduction/safetyTrainingAssessment/index.vue b/src/views/safeProduction/safetyTrainingAssessment/index.vue
index cbc35b8..2c98308 100644
--- a/src/views/safeProduction/safetyTrainingAssessment/index.vue
+++ b/src/views/safeProduction/safetyTrainingAssessment/index.vue
@@ -239,7 +239,7 @@
<el-descriptions-item label="闄勪欢鍒楄〃:">
<el-button type="primary"
size="small"
- @click="downLoadFile(endform)">闄勪欢鍒楄〃</el-button>
+ @click="openFileDialog(endform)">闄勪欢鍒楄〃</el-button>
</el-descriptions-item>
</el-descriptions>
<!-- <el-divider style="margin: 20px 0;" /> -->
@@ -358,23 +358,13 @@
</span>
</template>
</el-dialog>
- <!-- 闄勪欢鍒楄〃寮圭獥 -->
- <FileListDialog ref="fileListRef"
- 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="闄勪欢鍒楄〃" />
+ <!-- todo 闄勪欢棰勮鐩稿叧 -->
+ <FileList v-if="fileDialogVisible" v-model:visible="fileDialogVisible" record-type="safe_training" :record-id="recordId" />
</div>
</template>
<script setup>
import { Search } from "@element-plus/icons-vue";
- import FileListDialog from "@/components/Dialog/FileListDialog.vue";
import {
onMounted,
ref,
@@ -403,6 +393,7 @@
import useUserStore from "@/store/modules/user";
import dayjs from "dayjs";
const userStore = useUserStore();
+ const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
// 琛ㄥ崟楠岃瘉瑙勫垯
const rules = {
@@ -621,7 +612,7 @@
name: "闄勪欢",
type: "text",
clickFun: row => {
- downLoadFile(row);
+ openFileDialog(row);
},
color: "#007AFF",
},
@@ -783,27 +774,17 @@
form.value.principalMobile = selectedUser.phonenumber;
}
};
- /**
- * 涓嬭浇鏂囦欢
- *
- * @param row 涓嬭浇鏂囦欢鐨勭浉鍏充俊鎭璞�
- */
- const fileListRef = ref(null);
- const fileListDialogVisible = ref(false);
- const currentFileRow = ref(null);
- const downLoadFile = row => {
- currentFileRow.value = row;
- safeTrainingFileListPage({
- safeTrainingId: row.id,
- current: filePagination.value.current,
- size: filePagination.value.size,
- }).then(res => {
- if (fileListRef.value) {
- fileListRef.value.open(res.data.records);
- filePagination.value.total = res.data?.total || 0;
- }
- });
- };
+
+ // 鎵撳紑闄勪欢寮圭獥
+ const recordId =ref(0)
+ const fileDialogVisible = ref(false)
+
+ // 鎵撳紑闄勪欢寮规
+ const openFileDialog = async (row) => {
+ recordId.value = row.id
+ fileDialogVisible.value = true
+ }
+
// 涓婁紶闄勪欢
const handleUpload = async () => {
if (!currentFileRow.value) {
--
Gitblit v1.9.3