From 89fd9ab312c0aef9fcab89fbbaee4add5baa7c57 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期二, 27 十月 2026 09:43:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/CNAS/process/method/methodVerification/component/calibrationsFileDia.vue | 37 ++++++++++++++++++++++---------------
1 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/src/views/CNAS/process/method/methodVerification/component/calibrationsFileDia.vue b/src/views/CNAS/process/method/methodVerification/component/calibrationsFileDia.vue
index cccee81..0730d60 100644
--- a/src/views/CNAS/process/method/methodVerification/component/calibrationsFileDia.vue
+++ b/src/views/CNAS/process/method/methodVerification/component/calibrationsFileDia.vue
@@ -2,6 +2,8 @@
<div>
<el-dialog v-model="filesDialogVisible" title="鏌ョ湅鏍″噯璇佷功" width="80%" @closed="closeFilesLook">
<div>
+ <el-alert v-if="!tableLoading && tableData.length === 0" type="info" :closable="false"
+ title="鎵�閫夎澶囨殏鏃犳牎鍑嗚瘉涔�"/>
<limsTable
ref="yearTable"
:column="columnData"
@@ -18,7 +20,7 @@
fullscreen
title="鏌ョ湅闄勪欢" top="5vh" width="800px">
<filePreview v-if="lookDialogVisible" :currentFile="{}"
- :fileUrl="javaApi+'/img/'+currentInfo.fileUrl" style="max-height: 90vh;overflow-y: auto;"/>
+ :fileUrl="fileUrl(currentInfo)" style="max-height: 90vh;overflow-y: auto;"/>
</el-dialog>
</div>
</template>
@@ -26,7 +28,8 @@
<script>
import filePreview from '@/components/Preview/filePreview.vue';
import limsTable from '@/components/Table/lims-table.vue'
-import file from '@/utils/file';
+
+import { getCurrentCalibrationFiles } from '@/api/cnas/process/method/methodVerification'
export default {
name: 'calibrationsFileDia',
@@ -88,10 +91,24 @@
},
// 鏂规硶闆嗗悎
methods: {
- openDia(row) {
+ fileUrl(row) {
+ const image = /\.(png|jpe?g|gif|bmp|webp)$/i.test(row.fileUrl || '')
+ return this.javaApi + (image ? '/img/' : '/word/') + row.fileUrl
+ },
+ openDia(row = {}) {
this.filesDialogVisible = true
this.info = row
- this.tableData = this.info.calibrationsFileList
+ this.tableData = row.calibrationsFileList || []
+ if (row.useCurrentDevices) {
+ const deviceIds = [...new Set((row.machineAttachmentList || []).map(device => device.deviceId).filter(Boolean))]
+ if (!deviceIds.length) return
+ this.tableLoading = true
+ getCurrentCalibrationFiles({deviceIds: deviceIds.join(',')}).then(res => {
+ if (res.code === 200) this.tableData = res.data || []
+ }).finally(() => {
+ this.tableLoading = false
+ })
+ }
},
closeFilesLook () {
this.filesDialogVisible = false
@@ -103,17 +120,7 @@
},
// 涓嬭浇
upload (row) {
- let url = '';
- if(row.type==1){
- url = this.javaApi+'/img/'+row.fileUrl
- file.downloadIamge(url,row.fileName)
- }else{
- url = this.javaApi+'/word/'+row.fileUrl
- const link = document.createElement('a');
- link.href = url;
- link.download = row.fileName;
- link.click();
- }
+ return this.$download.attachment(row, row.fileName)
},
}
};
--
Gitblit v1.9.3