审核时处理图片,调用接口

This commit is contained in:
yy2205 2025-05-16 15:09:17 +08:00
parent 5491ab64b9
commit 357c977e98
2 changed files with 38 additions and 11 deletions

View File

@ -1,4 +1,7 @@
import axios from 'axios' import axios from 'axios'
const apiUrl = 'https://zzxmc.gw12320.com/processImage'
const imageAddress = 'F://陕西省咸阳市礼泉县心电图FTP/ecgimage/'
const originImageAddress = 'https://zzxmc.gw12320.com/ecgimage/'
// 超声组件 API // 超声组件 API
export const processImageApi = { export const processImageApi = {
@ -8,18 +11,14 @@ export const processImageApi = {
startY:100, startY:100,
height:400, height:400,
width:900, width:900,
options:{watermarkFontSize:40} options:{watermarkFontSize:40,enableAreaCover:true}
},{}], },{}],
processImg: async (params: any) => { processImg: async (params: any) => {
try { try {
const response = await axios({ const response = await axios({
method: 'post', method: 'post',
url: 'https://zzxmc.gw12320.com/processImage', url: apiUrl,
data: params, data: params,
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'
},
withCredentials: true withCredentials: true
}) })
return response.data return response.data
@ -27,5 +26,24 @@ export const processImageApi = {
console.error('Error fetching image:', error) console.error('Error fetching image:', error)
throw error throw error
} }
},
urlToAddress:(url)=>{
// https://zzxmc.gw12320.com/ecgimage/北屯中心/K021180213001N0003_20250418162136.jpg
if (!url){
return
}
console.log(imageAddress)
const str = url.replace(originImageAddress,imageAddress)
console.log(str)
return str;
},
addressToUrl:(address)=>{
if (!address){
return
}
console.log(imageAddress)
const str = address.replace(imageAddress,originImageAddress)
console.log(str)
return str;
} }
} }

View File

@ -801,19 +801,28 @@ const open = async (row: any) => {
} }
// //
async function process() { async function process() {
const processResponse = await processImageApi.processImg() let data = Object.assign({},processImageApi.paramsList[0])
data.imagePath = "F:\\陕西省咸阳市礼泉县心电图FTP\\ecgimage\\北屯中心卫生院\\K021180213001N0003_20250418161404.jpg"
// data.imagePath = queryParams.value.ecgJsonDataFilePath
// 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
console.log(data)
data.imagePath = processImageApi.urlToAddress(data.imagePath)
const processResponse = await processImageApi.processImg(data)
console.log(processResponse) console.log(processResponse)
if (applyFormVO.value.reportstatus === '已分析') { if (applyFormVO.value.reportstatus === '已分析') {
// //
await message.delConfirm('是否进行审核操作', '审核') await message.delConfirm('是否进行审核操作', '审核')
// const response = await PatientexamlistApi.examine(keyid.value,Profilevo.value.doctorname,Profilevo.value.doctorID) const response = await PatientexamlistApi.examine(keyid.value,Profilevo.value.doctorname,Profilevo.value.doctorID)
// if (response) { if (response) {
message.alertSuccess('审核成功') message.alertSuccess('审核成功')
// await getPatientexamlist(keyid.value) await getPatientexamlist(keyid.value)
emit('success') emit('success')
savedisabled.value = true savedisabled.value = true
// } }
} else if (applyFormVO.value.reportstatus === '已审核') { } else if (applyFormVO.value.reportstatus === '已审核') {
message.warning('已经审核,无需再次审核') message.warning('已经审核,无需再次审核')
} else { } else {