From d3b3a480d01d237dc05f9c6dde5cf73d474779a3 Mon Sep 17 00:00:00 2001 From: yy2205 <2238220225@qq.com> Date: Mon, 19 May 2025 17:00:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=B7=B2=E6=9C=89=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E5=8D=AB=E7=94=9F=E9=99=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/processImage/index.ts | 54 +++++++++++++++++++++++++++++------ src/views/ECG/ECGForm.vue | 10 +++++-- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/src/api/processImage/index.ts b/src/api/processImage/index.ts index 68e2b4b0..4bc81fcb 100644 --- a/src/api/processImage/index.ts +++ b/src/api/processImage/index.ts @@ -3,17 +3,55 @@ import axios from 'axios' const apiUrl = 'https://pacs.gw12320.com/adminecg/admin-api/tblist/ecganalysisparas/rpc-processImage' const imageAddress = 'F://陕西省咸阳市礼泉县心电图FTP/ecgimage/' const originImageAddress = 'https://zzxmc.gw12320.com/ecgimage/' +// const apiUrl = 'https://localhost:48080/admin-api/tblist/ecganalysisparas/rpc-processImage' +// const imageAddress = 'F://陕西省咸阳市礼泉县心电图FTP/ecgimage/' +// const originImageAddress = 'https://zzxmc.gw12320.com/ecgimage/' // 超声组件 API export const processImageApi = { // 查询模版表数据 - paramsList:[{ - startX:1800, - startY:100, - height:400, - width:900, - options:{watermarkFontSize:40,enableAreaCover:true,enableOcr:false} - },{}], + paramsList:{ + "礼泉县裴寨卫生院":{ + startX:1800, + startY:100, + height:400, + width:900, + step:"诊断结果:", + options:{watermarkFontSize:40} + }, + "药王洞卫生院":{ + startX:1200, + startY:140, + height:350, + width:950, + step:" 诊断结果:", + options:{watermarkFontSize:40} + }, + "史德卫生院":{ + startX:990, + startY:2910, + height:400, + width:800, + step:" ", + options:{watermarkFontSize:40} + }, + "礼泉县城关卫生院":{ + startX:2700, + startY:340, + height:600, + width:2400, + step:"诊断结果:", + options:{watermarkFontSize:40} + }, + "北屯中心卫生院":{ + startX:1800, + startY:100, + height:400, + width:900, + step:"诊断结果:", + options:{watermarkFontSize:40} + } + }, processImg: async (params: any) => { try { const response = await axios({ @@ -22,7 +60,7 @@ export const processImageApi = { data: params, withCredentials: true }) - return response.data + return response } catch (error) { console.error('Error fetching image:', error) throw error diff --git a/src/views/ECG/ECGForm.vue b/src/views/ECG/ECGForm.vue index feba83dd..aa4f3886 100644 --- a/src/views/ECG/ECGForm.vue +++ b/src/views/ECG/ECGForm.vue @@ -814,11 +814,17 @@ async function process() { // data.imagePath = "https://zzxmc.gw12320.com/ecgimage/%E5%8C%97%E5%B1%AF%E4%B8%AD%E5%BF%83%E5%8D%AB%E7%94%9F%E9%99%A2/K021180213001N0003_20250418162136.jpg" data.examId = rowinfo.value.examId data.orgId = rowinfo.value.orgId - data.watermarkText = "诊断结果:\n"+ queryParams.value.doctorDiagResult + let header = processImageApi.paramsList[rowinfo.value.orgName] + data.watermarkText = header + queryParams.value.doctorDiagResult // console.log(data) data.imagePath = processImageApi.urlToAddress(data.imagePath) const processResponse = await processImageApi.processImg(data) - if (!processResponse.data.updateSuccess){ + // 1. 解析外层 JSON 的 data 字符串 + const dataObj = JSON.parse(response.data); + +// 2. 直接获取 updateSuccess 的值 + const updateSuccess = dataObj.updateSuccess; + if (!updateSuccess){ message.warning('诊断图片生成异常') } console.log(processResponse)