From 93e45aec19d4f6b64e5235c1952d5688823ae05d Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Fri, 9 Jan 2026 19:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B8=E5=86=8C=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=92=8C=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/renderer/src/services/api.js | 5 + frontend/src/renderer/src/views/Detection.vue | 2 +- .../src/renderer/src/views/PhotoAlbum.vue | 290 ++++++++++++++++-- 3 files changed, 275 insertions(+), 22 deletions(-) diff --git a/frontend/src/renderer/src/services/api.js b/frontend/src/renderer/src/services/api.js index e7c7b0dc..494b282b 100644 --- a/frontend/src/renderer/src/services/api.js +++ b/frontend/src/renderer/src/services/api.js @@ -673,6 +673,11 @@ export const historyAPI = { return api.get(`/api/detection/data/detail/${id}`) }, + //根据主键ID查询检测数据详情 + getDetectionData(session_id) { + return api.get(`/api/detection/${session_id}/get_data`) + }, + } diff --git a/frontend/src/renderer/src/views/Detection.vue b/frontend/src/renderer/src/views/Detection.vue index d383574a..5e0a697b 100644 --- a/frontend/src/renderer/src/views/Detection.vue +++ b/frontend/src/renderer/src/views/Detection.vue @@ -803,7 +803,7 @@
+ :selectedPatient="patientInfo" v-if="isPhotoAlbum"/>
-
+
-
图片相册
+
相册
+ align-content: flex-start; + justify-content: start;">
@@ -25,16 +26,29 @@
-
-
+
+
删除
- {{ isImageDetails }} - +
+
+
+
提示
+ +
+
确定删除勾选的检测数据吗?
+
+
取消
+ 确定 +
+
+
@@ -45,22 +59,20 @@ import { ElMessage, ElMessageBox } from 'element-plus' import { historyAPI,getBackendUrl } from '@/services/api.js' import ImageDetails from '@/views/ImageDetails.vue' const emit = defineEmits([ 'closePhotoAlbum']); +const props = defineProps({ + selectedPatient: { + required: false, + type: Object, + default: null + }, +}) const BACKEND_URL = getBackendUrl() +const isTip =ref(false) const checkboxGroup = ref([]) // 图片列表选中的数据 const useImgList = ref([]) // 图片列表数据 -for(let i=0; i<10; i++){ - useImgList.value.push({ - id:i - }) -} const selectIndex = ref(0) // 图片列表选中的索引 const isImageDetails = ref(false) // 图片详情弹窗 const imageList = ref([]) // 图片详情数据 -for(let i=0; i<10; i++){ - imageList.value.push({ - id:i - }) -} function closeImageDetails(){ // 关闭图片对比页面 isImageDetails.value = false } @@ -78,8 +90,92 @@ function getTime(time){ // 时间格式转换 const handleCancel = () => { emit('closePhotoAlbum'); } +const delType =ref('video') +function delImgClick(e){ // 临时方法 + if(checkboxGroup.value.length < 1){ + return + } + delType.value = e + isTip.value = true +} +function tipCancel(){ + isTip.value = false +} +async function tipConfirm(){ + let imgIds = [] + let videoIds = [] + checkboxGroup.value.forEach(element => { + useImgList.value.forEach(elements => { + if(element == elements.id){ + if(elements.type == 'data'){ + imgIds.push(elements.id) + } + if(elements.type == 'videos'){ + videoIds.push(elements.id) + } + + } + }); + }); + if(imgIds.length>0){ + await detectionDelById(imgIds.join(',')) + } + if(videoIds.length>0){ + await VideoDelById(videoIds.join(',')) + } + + isTip.value = false +} + +const detectionDelById = async (ids)=>{ + try { + const res = await historyAPI.detectionDelById(ids) + if (res && res.success) { + getDetectionData() + } + } catch {} +} + +const VideoDelById = async (ids)=>{ + try { + const res = await historyAPI.VideoDelById(ids) + if (res && res.success) { + getDetectionData() + ElMessage.success('删除成功!') + } + } catch {} +} + +function getDetectionData(){ + useImgList.value = [] + historyAPI.getDetectionData(props.selectedPatient.sessionId).then((response)=>{ + if(response.success){ + if(response.data !=null){ + response.data.forEach(element => { + useImgList.value.push({ + ...element + }) + }); + imageList.value = response.data + } + if(response.videos !=null){ + response.videos.forEach(element => { + useImgList.value.push({ + ...element + }) + }); + } + } + }).catch(()=>{ + + }) +} + +onMounted(() => { + getDetectionData() +}) \ No newline at end of file