From 6f81691ab09d586470426ee0bfa99cec83797f7b Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期一, 23 六月 2025 15:52:24 +0800 Subject: [PATCH] 实验运行模块 图片换真实上传 --- laboratory/src/views/dataManagement/schemeManagement/stop-experiment.vue | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 deletions(-) diff --git a/laboratory/src/views/dataManagement/schemeManagement/stop-experiment.vue b/laboratory/src/views/dataManagement/schemeManagement/stop-experiment.vue index c94ed74..c96466f 100644 --- a/laboratory/src/views/dataManagement/schemeManagement/stop-experiment.vue +++ b/laboratory/src/views/dataManagement/schemeManagement/stop-experiment.vue @@ -87,7 +87,7 @@ </div> <img v-if="imgSrc" - :src="imgSrc" + :src="getFullUrl(imgSrc)" alt="签名" class="signature-preview" /> @@ -101,6 +101,7 @@ <SignatureCanvas :visible="signatureCanvasVisible" + @close="signatureCanvasVisible=false" @confirm="handleSignatureConfirm" /> </Card> @@ -110,6 +111,8 @@ import AiEditor from '@/components/AiEditor' import SignatureCanvas from "@/components/SignatureCanvas.vue" import { getDetail, applicationTermination } from './service' +import {queryDetail} from '@/components/service.js' +import {getFullUrl} from '@/utils/utils.js' export default { name: 'StopExperiment', @@ -134,11 +137,20 @@ this.id = this.$route.query.id if (this.id) { this.getExperimentDetail() + this.open() } else { this.$message.error('参数错误,缺少实验ID') } }, methods: { + getFullUrl, + open(){ + queryDetail().then(res=>{ + if(res){ + this.imgSrc=res.signPicture + } + }) + }, // 获取实验详情 async getExperimentDetail() { try { @@ -151,7 +163,6 @@ this.$message.warning('未获取到实验详情') } } catch (error) { - console.error('获取实验详情失败:', error) this.$message.error('获取实验详情失败') } finally { this.loading = false @@ -197,8 +208,10 @@ }, handleSignatureConfirm(imageData) { this.signatureCanvasVisible = false - // this.imgSrc = imageData - this.imgSrc = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' + this.imgSrc = ""; // 先清空 + this.$nextTick(() => { + this.imgSrc = imageData; + }); }, async handleConfirm() { if (!this.imgSrc) { @@ -228,16 +241,12 @@ stopFile: filePaths, // 中止文件路径,多个文件路径通过逗号拼接 stopFileName: fileNames // 中止文件名称,多个文件名称通过逗号拼接 } - - console.log('提交的数据:', formData) - await applicationTermination(formData) this.$message.success('提交成功') this.handleDialogClose() // 提交成功后返回列表页 this.$router.go(-1) } catch (error) { - console.error('提交失败:', error) this.$message.error('提交失败') } finally { this.loading = false -- Gitblit v1.7.1