修改order为id
This commit is contained in:
parent
af1e5f6d18
commit
68936a6ab3
Binary file not shown.
28
frontend/src/renderer/public/pdf.worker.min.js
vendored
Normal file
28
frontend/src/renderer/public/pdf.worker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -635,7 +635,11 @@ export const historyAPI = {
|
|||||||
|
|
||||||
// 删除检测会话及其相关的检测数据
|
// 删除检测会话及其相关的检测数据
|
||||||
sessionsDelById(id) {
|
sessionsDelById(id) {
|
||||||
return api.delete(`api/detection/sessions/${id}`, {})
|
return api.delete(`/api/detection/sessions/${id}`, {})
|
||||||
|
},
|
||||||
|
// 删除pdf报告
|
||||||
|
deletePDF(id) {
|
||||||
|
return api.delete(`/api/reports/${id}/delete`, {})
|
||||||
},
|
},
|
||||||
// 获取检测会话历史
|
// 获取检测会话历史
|
||||||
sessionById(id) {
|
sessionById(id) {
|
||||||
|
|||||||
@ -56,12 +56,12 @@
|
|||||||
<div class="displayflex">
|
<div class="displayflex">
|
||||||
<div class="displayflextext1">选择原始数据</div>
|
<div class="displayflextext1">选择原始数据</div>
|
||||||
<div class="displayflexselect" @click="getRawData('left')">
|
<div class="displayflexselect" @click="getRawData('left')">
|
||||||
{{ rawData.order }}
|
{{ rawData.id }}
|
||||||
<img src="@/assets/archive/selectbottom.png" class="displayflexselect-icon" alt="">
|
<img src="@/assets/archive/selectbottom.png" class="displayflexselect-icon" alt="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 选中后显示内容 -->
|
<!-- 选中后显示内容 -->
|
||||||
<div v-if="rawData.order && rawData.order!=''">
|
<div v-if="rawData.id && rawData.id!=''">
|
||||||
<div class="generateReport-content-title">整体数据</div>
|
<div class="generateReport-content-title">整体数据</div>
|
||||||
<div style="width: 600px;height: 337px;">
|
<div style="width: 600px;height: 337px;">
|
||||||
<img :src="BACKEND_URL+'/' + rawData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
<img :src="BACKEND_URL+'/' + rawData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
||||||
@ -123,12 +123,12 @@
|
|||||||
<div class="displayflex">
|
<div class="displayflex">
|
||||||
<div class="displayflextext1">选择矫正数据</div>
|
<div class="displayflextext1">选择矫正数据</div>
|
||||||
<div class="displayflexselect" @click="getRawData('right')">
|
<div class="displayflexselect" @click="getRawData('right')">
|
||||||
{{ calibrationData.order }}
|
{{ calibrationData.id }}
|
||||||
<img src="@/assets/archive/selectbottom.png" class="displayflexselect-icon" alt="">
|
<img src="@/assets/archive/selectbottom.png" class="displayflexselect-icon" alt="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 选中后显示内容 -->
|
<!-- 选中后显示内容 -->
|
||||||
<div v-if="calibrationData.order && calibrationData.order!=''">
|
<div v-if="calibrationData.id && calibrationData.id!=''">
|
||||||
<div class="generateReport-content-title">整体数据</div>
|
<div class="generateReport-content-title">整体数据</div>
|
||||||
<div style="width: 600px;height: 337px;">
|
<div style="width: 600px;height: 337px;">
|
||||||
<img :src="BACKEND_URL+'/' + calibrationData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
<img :src="BACKEND_URL+'/' + calibrationData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
||||||
@ -284,9 +284,9 @@ const sessionsById = async (session_id) => {
|
|||||||
// 导出报告逻辑
|
// 导出报告逻辑
|
||||||
const response = await historyAPI.sessionsById(session_id)
|
const response = await historyAPI.sessionsById(session_id)
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
response.data.data.forEach((element,index) => {
|
// response.data.data.forEach((element,index) => {
|
||||||
element.order ='D-'+ (getNo(index + 1))
|
// element.order ='D-'+ (getNo(index + 1))
|
||||||
});
|
// });
|
||||||
detectionInfo.value = response.data
|
detectionInfo.value = response.data
|
||||||
imageList.value = response.data.data
|
imageList.value = response.data.data
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="ImageDetails-box">
|
<div class="ImageDetails-box">
|
||||||
<div class="ImageDetails-header">
|
<div class="ImageDetails-header">
|
||||||
<div>{{ ImageDetailsInfo.order }}</div>
|
<div>{{ ImageDetailsInfo.id }}</div>
|
||||||
<img src="@/assets/archive/close2.png" alt="" style="cursor: pointer;" @click="handleCancel">
|
<img src="@/assets/archive/close2.png" alt="" style="cursor: pointer;" @click="handleCancel">
|
||||||
</div>
|
</div>
|
||||||
<div class="ImageDetails-imgbgbox">
|
<div class="ImageDetails-imgbgbox">
|
||||||
|
|||||||
@ -7,33 +7,33 @@
|
|||||||
<div class="ImageDetailsCompare-imgbgbox">
|
<div class="ImageDetailsCompare-imgbgbox">
|
||||||
<div class="ImageDetailsCompare-display" v-if="indexActive == 0">
|
<div class="ImageDetailsCompare-display" v-if="indexActive == 0">
|
||||||
<div class="ImageDetailsCompare-content-imgbox" style="width: 740px;height: 100%;">
|
<div class="ImageDetailsCompare-content-imgbox" style="width: 740px;height: 100%;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.order }}</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.id }}</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.screen_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.screen_image" alt=""
|
||||||
style="width: 740px;height:416px;">
|
style="width: 740px;height:416px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-content-imgbox"
|
<div class="ImageDetailsCompare-content-imgbox"
|
||||||
style="width: 740px;height: 100%;margin-left: 50px;">
|
style="width: 740px;height: 100%;margin-left: 50px;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoRight.order }}</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoRight.id }}</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.screen_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.screen_image" alt=""
|
||||||
style="width: 740px;height:416px;">
|
style="width: 740px;height:416px;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-display" v-if="indexActive == 1">
|
<div class="ImageDetailsCompare-display" v-if="indexActive == 1">
|
||||||
<div class="ImageDetailsCompare-content-imgbox" style="width: 300px;height: 100%;">
|
<div class="ImageDetailsCompare-content-imgbox" style="width: 300px;height: 100%;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.order }}</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.id }}</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.body_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.body_image" alt=""
|
||||||
style="width: 300px;height:600px;">
|
style="width: 300px;height:600px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-content-imgbox"
|
<div class="ImageDetailsCompare-content-imgbox"
|
||||||
style="width: 300px;height: 100%;margin-left: 50px;">
|
style="width: 300px;height: 100%;margin-left: 50px;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoRight.order }}</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoRight.id }}</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.body_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.body_image" alt=""
|
||||||
style="width: 300px;height:600px;">
|
style="width: 300px;height:600px;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-display" v-if="indexActive == 2">
|
<div class="ImageDetailsCompare-display" v-if="indexActive == 2">
|
||||||
<div class="ImageDetailsCompare-content-imgbox" style="width: 740px;height: 100%;">
|
<div class="ImageDetailsCompare-content-imgbox" style="width: 740px;height: 100%;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.order }}</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.id }}</div>
|
||||||
<div style="width: 700px;height:361px;background: #fff; padding-left: 80px;">
|
<div style="width: 700px;height:361px;background: #fff; padding-left: 80px;">
|
||||||
<div style="width: 555px;padding:20px 0; display: flex;justify-content: space-between;">
|
<div style="width: 555px;padding:20px 0; display: flex;justify-content: space-between;">
|
||||||
<img src="@/assets/archive/roll.png">
|
<img src="@/assets/archive/roll.png">
|
||||||
@ -71,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-content-imgbox"
|
<div class="ImageDetailsCompare-content-imgbox"
|
||||||
style="width: 630px;height: 100%;margin-left: 50px;">
|
style="width: 630px;height: 100%;margin-left: 50px;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoRight.order }}</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoRight.id }}</div>
|
||||||
<div style="width: 700px;height:361px;background: #fff; padding-left: 80px;">
|
<div style="width: 700px;height:361px;background: #fff; padding-left: 80px;">
|
||||||
<div style="width: 555px;padding:20px 0; display: flex;justify-content: space-between;">
|
<div style="width: 555px;padding:20px 0; display: flex;justify-content: space-between;">
|
||||||
<img src="@/assets/archive/roll.png">
|
<img src="@/assets/archive/roll.png">
|
||||||
@ -110,32 +110,32 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-display" v-if="indexActive == 3">
|
<div class="ImageDetailsCompare-display" v-if="indexActive == 3">
|
||||||
<div class="ImageDetailsCompare-content-imgbox" style="width: 456px;height: 100%;">
|
<div class="ImageDetailsCompare-content-imgbox" style="width: 456px;height: 100%;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.order }}</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.id }}</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.foot_data_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.foot_data_image" alt=""
|
||||||
style="width: 456px;height:456px">
|
style="width: 456px;height:456px">
|
||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-content-imgbox"
|
<div class="ImageDetailsCompare-content-imgbox"
|
||||||
style="width: 456px;height: 100%;margin-left: 50px;">
|
style="width: 456px;height: 100%;margin-left: 50px;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoRight.order }}</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoRight.id }}</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.foot_data_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.foot_data_image" alt=""
|
||||||
style="width: 456px;height:456px">
|
style="width: 456px;height:456px">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-display" v-if="indexActive == 4">
|
<div class="ImageDetailsCompare-display" v-if="indexActive == 4">
|
||||||
<div class="ImageDetailsCompare-content-imgbox" style="width: 500px;height: 100%;">
|
<div class="ImageDetailsCompare-content-imgbox" style="width: 500px;height: 100%;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.order }}视频1</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.id }}视频1</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.foot1_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.foot1_image" alt=""
|
||||||
style="width: 500px;height:281px">
|
style="width: 500px;height:281px">
|
||||||
<div class="ImageDetailsCompare-content-title" style="margin-top: 30px;">{{ ImageDetailsInfoRight.order }}视频1</div>
|
<div class="ImageDetailsCompare-content-title" style="margin-top: 30px;">{{ ImageDetailsInfoRight.id }}视频1</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.foot1_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.foot1_image" alt=""
|
||||||
style="width: 500px;height:281px">
|
style="width: 500px;height:281px">
|
||||||
</div>
|
</div>
|
||||||
<div class="ImageDetailsCompare-content-imgbox"
|
<div class="ImageDetailsCompare-content-imgbox"
|
||||||
style="width: 500px;height: 100%;margin-left: 50px;">
|
style="width: 500px;height: 100%;margin-left: 50px;">
|
||||||
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.order }}视频2</div>
|
<div class="ImageDetailsCompare-content-title">{{ ImageDetailsInfoLeft.id }}视频2</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.foot2_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoLeft.foot2_image" alt=""
|
||||||
style="width: 500px;height:281px">
|
style="width: 500px;height:281px">
|
||||||
<div class="ImageDetailsCompare-content-title" style="margin-top: 30px;">{{ ImageDetailsInfoRight.order }}视频2</div>
|
<div class="ImageDetailsCompare-content-title" style="margin-top: 30px;">{{ ImageDetailsInfoRight.id }}视频2</div>
|
||||||
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.foot2_image" alt=""
|
<img :src="BACKEND_URL+'/' + ImageDetailsInfoRight.foot2_image" alt=""
|
||||||
style="width: 500px;height:281px">
|
style="width: 500px;height:281px">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -78,14 +78,14 @@
|
|||||||
<img v-else src="@/assets/archive/bi.png" alt="" style="margin-right: 8px;" class="opacity50">
|
<img v-else src="@/assets/archive/bi.png" alt="" style="margin-right: 8px;" class="opacity50">
|
||||||
报告对比
|
报告对比
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="selectedPatient" type="primary"
|
<!-- <el-button v-if="selectedPatient" type="primary"
|
||||||
:class="selectedData.length>0? 'patientprofile-selectedbutotn':'patientprofile-butotn'"
|
:class="selectedData.length>0? 'patientprofile-selectedbutotn':'patientprofile-butotn'"
|
||||||
@click="viewPatientProfile">
|
@click="viewPatientProfile">
|
||||||
<img v-if="selectedData.length>0" src="@/assets/archive/del2.png" alt=""
|
<img v-if="selectedData.length>0" src="@/assets/archive/del2.png" alt=""
|
||||||
style="margin-right: 8px;" >
|
style="margin-right: 8px;" >
|
||||||
<img v-else src="@/assets/archive/del.png" alt="" style="margin-right: 8px;" class="opacity50">
|
<img v-else src="@/assets/archive/del.png" alt="" style="margin-right: 8px;" class="opacity50">
|
||||||
删除记录
|
删除记录
|
||||||
</el-button>
|
</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="recordData" style="
|
<el-table :data="recordData" style="
|
||||||
@ -111,9 +111,9 @@
|
|||||||
cursor: pointer;"
|
cursor: pointer;"
|
||||||
@click.stop="generateReport(scope.row,scope.$index)">生成报告</div>
|
@click.stop="generateReport(scope.row,scope.$index)">生成报告</div>
|
||||||
<div class="patientprofile-file-box" v-if="scope.row.detection_report != null">
|
<div class="patientprofile-file-box" v-if="scope.row.detection_report != null">
|
||||||
<img src="@/assets/new/file.png" alt="" @click="fileClick(scope.row)">
|
<img src="@/assets/new/file.png" alt="" @click.stop="fileClick(scope.row)">
|
||||||
<img src="@/assets/new/del.png" class="patientprofile-del" alt=""
|
<img src="@/assets/new/del.png" class="patientprofile-del" alt=""
|
||||||
@click="deleteClick(scope.row)">
|
@click.stop="delPDFClick(scope.row)">
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -179,7 +179,7 @@
|
|||||||
<div class="patientprofile-imgtextbox">
|
<div class="patientprofile-imgtextbox">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
:value="item.id" size="large" style="display:flex; align-items: center; justify-content: space-between">
|
:value="item.id" size="large" style="display:flex; align-items: center; justify-content: space-between">
|
||||||
<div>{{ item.order }}</div>
|
<div>{{ item.id }}</div>
|
||||||
<span>{{ item.timestamp }}</span>
|
<span>{{ item.timestamp }}</span>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
@ -226,7 +226,7 @@
|
|||||||
<div class="patientprofile-imgtextbox">
|
<div class="patientprofile-imgtextbox">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
:value="item.id" size="large" style="display:flex; align-items: center; justify-content: space-between">
|
:value="item.id" size="large" style="display:flex; align-items: center; justify-content: space-between">
|
||||||
<div>{{ item.order }}</div>
|
<div>{{ item.id }}</div>
|
||||||
<span>{{ item.timestamp }}</span>
|
<span>{{ item.timestamp }}</span>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
@ -303,6 +303,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <ViewPDF /> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -315,6 +316,7 @@ import { useAuthStore } from '@/stores/index.js'
|
|||||||
import GenerateReport from '@/views/GenerateReport.vue'
|
import GenerateReport from '@/views/GenerateReport.vue'
|
||||||
import ImageDetailsCompare from '@/views/ImageDetailsCompare.vue'
|
import ImageDetailsCompare from '@/views/ImageDetailsCompare.vue'
|
||||||
import ImageDetails from '@/views/ImageDetails.vue'
|
import ImageDetails from '@/views/ImageDetails.vue'
|
||||||
|
import ViewPDF from '@/views/viewPDF.vue'
|
||||||
|
|
||||||
const formatDate = (date) => {
|
const formatDate = (date) => {
|
||||||
const d = new Date(date)
|
const d = new Date(date)
|
||||||
@ -483,12 +485,12 @@ const sessionsById = async (session_id) => {
|
|||||||
treatment_info: profileInfo.value.treatment_info,
|
treatment_info: profileInfo.value.treatment_info,
|
||||||
suggestion_info: profileInfo.value.suggestion_info
|
suggestion_info: profileInfo.value.suggestion_info
|
||||||
}
|
}
|
||||||
response.data.data.forEach((element,index) => {
|
// response.data.data.forEach((element,index) => {
|
||||||
element.order ='D-'+ (getNo(index + 1))
|
// element.order ='D-'+ (getNo(index + 1))
|
||||||
});
|
// });
|
||||||
response.data.videos.forEach((element,index) => {
|
// response.data.videos.forEach((element,index) => {
|
||||||
element.order ='D-'+ (getNo(index + 1))
|
// element.order ='D-'+ (getNo(index + 1))
|
||||||
});
|
// });
|
||||||
imageList.value = response.data.data
|
imageList.value = response.data.data
|
||||||
videoList.value = response.data.videos
|
videoList.value = response.data.videos
|
||||||
|
|
||||||
@ -532,6 +534,19 @@ function sessionsDelById(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deletePDF(id) {
|
||||||
|
historyAPI.deletePDF(id).then((response)=>{
|
||||||
|
if(response.success){
|
||||||
|
ElMessage.success({
|
||||||
|
message: response.message,
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
sessionsInit()
|
||||||
|
}
|
||||||
|
}).catch(()=>{
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function deleteClick(row){
|
function deleteClick(row){
|
||||||
// 检查状态是否为 checking
|
// 检查状态是否为 checking
|
||||||
// if (row.status === 'checking') {
|
// if (row.status === 'checking') {
|
||||||
@ -715,6 +730,15 @@ function delVideoClick(){ // 临时方法
|
|||||||
tipValue.value = '确定删除勾选的检测数据吗?'
|
tipValue.value = '确定删除勾选的检测数据吗?'
|
||||||
isTip.value = true
|
isTip.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delPDFClick(row){ // 临时方法
|
||||||
|
delType.value = 'deletePDF'
|
||||||
|
tipValue.value = '确定删除该PDF文件吗?'
|
||||||
|
deleteId.value = row.id
|
||||||
|
isTip.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function closeImageDetailsCompare(){ // 关闭图片对比页面
|
function closeImageDetailsCompare(){ // 关闭图片对比页面
|
||||||
isImageDetailsCompare.value = false
|
isImageDetailsCompare.value = false
|
||||||
}
|
}
|
||||||
@ -733,6 +757,8 @@ function tipConfirm(){
|
|||||||
}
|
}
|
||||||
else if(delType.value == 'listone'){
|
else if(delType.value == 'listone'){
|
||||||
sessionsDelById([deleteId.value])
|
sessionsDelById([deleteId.value])
|
||||||
|
} else if(delType.value == 'deletePDF'){
|
||||||
|
deletePDF(deleteId.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
isTip.value = false
|
isTip.value = false
|
||||||
|
|||||||
@ -48,11 +48,11 @@
|
|||||||
<div class="displayflex">
|
<div class="displayflex">
|
||||||
<div class="displayflextext1">原始数据:</div>
|
<div class="displayflextext1">原始数据:</div>
|
||||||
<div class="displayflextext1">
|
<div class="displayflextext1">
|
||||||
{{ rawData.order }}
|
{{ rawData.id }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 选中后显示内容 -->
|
<!-- 选中后显示内容 -->
|
||||||
<div v-if="rawData.order && rawData.order!=''">
|
<div v-if="rawData.id && rawData.id!=''">
|
||||||
<div class="PopUpOnlyReport-content-title">整体数据</div>
|
<div class="PopUpOnlyReport-content-title">整体数据</div>
|
||||||
<div style="width: 600px;height: 387px; margin: auto;">
|
<div style="width: 600px;height: 387px; margin: auto;">
|
||||||
<img :src="BACKEND_URL+'/' + rawData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
<img :src="BACKEND_URL+'/' + rawData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
||||||
|
|||||||
@ -48,11 +48,11 @@
|
|||||||
<div class="displayflex">
|
<div class="displayflex">
|
||||||
<div class="displayflextext1">原始数据:</div>
|
<div class="displayflextext1">原始数据:</div>
|
||||||
<div class="displayflextext1">
|
<div class="displayflextext1">
|
||||||
{{ rawData.order }}
|
{{ rawData.id }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 选中后显示内容 -->
|
<!-- 选中后显示内容 -->
|
||||||
<div v-if="rawData.order && rawData.order!=''">
|
<div v-if="rawData.id && rawData.id!=''">
|
||||||
<div class="PopUpReport-content-title">整体数据</div>
|
<div class="PopUpReport-content-title">整体数据</div>
|
||||||
<div style="width: 600px;height: 387px;">
|
<div style="width: 600px;height: 387px;">
|
||||||
<img :src="BACKEND_URL+'/' + rawData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
<img :src="BACKEND_URL+'/' + rawData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
||||||
@ -114,11 +114,11 @@
|
|||||||
<div class="displayflex">
|
<div class="displayflex">
|
||||||
<div class="displayflextext1">矫正数据:</div>
|
<div class="displayflextext1">矫正数据:</div>
|
||||||
<div class="displayflextext1">
|
<div class="displayflextext1">
|
||||||
{{ calibrationData.order }}
|
{{ calibrationData.id }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 选中后显示内容 -->
|
<!-- 选中后显示内容 -->
|
||||||
<div v-if="calibrationData.order && calibrationData.order!=''">
|
<div v-if="calibrationData.id && calibrationData.id!=''">
|
||||||
<div class="PopUpReport-content-title">整体数据</div>
|
<div class="PopUpReport-content-title">整体数据</div>
|
||||||
<div style="width: 600px;height: 387px;">
|
<div style="width: 600px;height: 387px;">
|
||||||
<img :src="BACKEND_URL+'/' + calibrationData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
<img :src="BACKEND_URL+'/' + calibrationData.screen_image" alt="" srcset="" style="width: 100%;height: 100%;">
|
||||||
|
|||||||
@ -15,8 +15,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="selectdata-imgtextbox" @click.stop="selectCheckbox(item)">
|
<div class="selectdata-imgtextbox" @click.stop="selectCheckbox(item)">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
:value="item.order" size="large" style="display:flex; align-items: center; justify-content: space-between">
|
:value="item.id" size="large" style="display:flex; align-items: center; justify-content: space-between">
|
||||||
<div>{{ item.order }}</div>
|
<div>{{ item.id }}</div>
|
||||||
<span>{{ item.timestamp }}</span>
|
<span>{{ item.timestamp }}</span>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
@ -75,7 +75,7 @@ function selectImg(row,index){
|
|||||||
}
|
}
|
||||||
function selectCheckbox(row){
|
function selectCheckbox(row){
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
checkboxGroup.value = [row.order]
|
checkboxGroup.value = [row.id]
|
||||||
selectInfo.value = row
|
selectInfo.value = row
|
||||||
}, 50)
|
}, 50)
|
||||||
}
|
}
|
||||||
|
|||||||
142
frontend/src/renderer/src/views/viewPDF.vue
Normal file
142
frontend/src/renderer/src/views/viewPDF.vue
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
<template>
|
||||||
|
<div class="viewPDF-container">
|
||||||
|
<div class="pdf-viewer">
|
||||||
|
<div class="pdf-container" ref="pdfContainer"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { patientAPI, detectionAPI,historyAPI,getBackendUrl } from '@/services/api.js'
|
||||||
|
|
||||||
|
import { ref, onMounted } from 'vue'
|
||||||
|
import * as pdfjsLib from 'pdfjs-dist'
|
||||||
|
const pdfContainer = ref(null) // 容器用于挂载多个 canvas
|
||||||
|
// 设置 worker 路径(重要)
|
||||||
|
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.js'
|
||||||
|
const BACKEND_URL = getBackendUrl()
|
||||||
|
const pdfCanvas = ref(null)
|
||||||
|
|
||||||
|
// const renderPDF = async (url) => {
|
||||||
|
// try {
|
||||||
|
// // 加载 PDF 文档
|
||||||
|
// const loadingTask = pdfjsLib.getDocument(url)
|
||||||
|
// const pdf = await loadingTask.promise
|
||||||
|
|
||||||
|
// // 获取第一页
|
||||||
|
// const page = await pdf.getPage(1)
|
||||||
|
|
||||||
|
// const scale = 1.5
|
||||||
|
// const viewport = page.getViewport({ scale })
|
||||||
|
|
||||||
|
// const canvas = pdfCanvas.value
|
||||||
|
// const context = canvas.getContext('2d')
|
||||||
|
// canvas.height = viewport.height
|
||||||
|
// canvas.width = viewport.width
|
||||||
|
|
||||||
|
// // 渲染页面
|
||||||
|
// const renderContext = {
|
||||||
|
// canvasContext: context,
|
||||||
|
// viewport,
|
||||||
|
// }
|
||||||
|
// await page.render(renderContext).promise
|
||||||
|
// console.log('PDF rendered successfully')
|
||||||
|
// } catch (error) {
|
||||||
|
// console.error('Error rendering PDF:', error)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
const renderPDF = async (url) => {
|
||||||
|
try {
|
||||||
|
// 1️⃣ 加载 PDF 文档
|
||||||
|
const loadingTask = pdfjsLib.getDocument(url)
|
||||||
|
const pdf = await loadingTask.promise
|
||||||
|
console.log(`PDF loaded: ${pdf.numPages} pages`)
|
||||||
|
|
||||||
|
// 2️⃣ 清空旧内容
|
||||||
|
if (pdfContainer.value) {
|
||||||
|
pdfContainer.value.innerHTML = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
const scale = 1.5 // 可根据设备 DPR 动态调整
|
||||||
|
const pagePromises = []
|
||||||
|
|
||||||
|
// 3️⃣ 预处理:循环加载每一页(不立即渲染)
|
||||||
|
for (let pageNum = 1; pageNum <= pdf.numPages; pageNum++) {
|
||||||
|
pagePromises.push(renderPage(pdf, pageNum, scale))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4️⃣ 并行渲染所有页面(注意:大量页面时需节流)
|
||||||
|
await Promise.all(pagePromises)
|
||||||
|
console.log('✅ All PDF pages rendered successfully')
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ Error rendering PDF:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 单独封装 renderPage 函数便于复用与控制并发
|
||||||
|
const renderPage = async (pdf, pageNum, scale) => {
|
||||||
|
const page = await pdf.getPage(pageNum)
|
||||||
|
|
||||||
|
// 获取视口(viewport)
|
||||||
|
const viewport = page.getViewport({ scale })
|
||||||
|
|
||||||
|
// 创建 canvas
|
||||||
|
const canvas = document.createElement('canvas')
|
||||||
|
const context = canvas.getContext('2d')
|
||||||
|
canvas.height = viewport.height
|
||||||
|
canvas.width = viewport.width
|
||||||
|
|
||||||
|
|
||||||
|
// 添加页码标识(可选)
|
||||||
|
const pageNumberDiv = document.createElement('div')
|
||||||
|
// 插入到容器
|
||||||
|
if (pdfContainer.value) {
|
||||||
|
pdfContainer.value.appendChild(canvas)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 渲染上下文
|
||||||
|
const renderContext = {
|
||||||
|
canvasContext: context,
|
||||||
|
viewport,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行渲染
|
||||||
|
await page.render(renderContext).promise
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
// 替换为你的 PDF 文件路径或 URL
|
||||||
|
renderPDF(`${BACKEND_URL}/202512070001/20251209141628/report_142802459.pdf`) // 可以是本地文件或远程链接
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.viewPDF-container{
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 1);
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
.pdf-viewer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
canvas {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.pdf-container {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #f9f9fb;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user