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;">
-
-
- {{ 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