diff --git a/frontend/src/renderer/src/assets/big.png b/frontend/src/renderer/src/assets/big.png new file mode 100644 index 00000000..d5c7b27a Binary files /dev/null and b/frontend/src/renderer/src/assets/big.png differ diff --git a/frontend/src/renderer/src/services/api.js b/frontend/src/renderer/src/services/api.js index 4a06feb6..1c471ff8 100644 --- a/frontend/src/renderer/src/services/api.js +++ b/frontend/src/renderer/src/services/api.js @@ -13,7 +13,7 @@ api.interceptors.request.use( if (window.electronAPI) { config.baseURL = window.electronAPI.getBackendUrl() } else { - config.baseURL = 'http://localhost:5000' + config.baseURL = 'http://192.168.1.173:5000' } // 只为需要发送数据的请求设置Content-Type @@ -607,14 +607,23 @@ export const historyAPI = { sessionsPage(params) { return api.get('/api/history/sessions', { params }) }, - // 获取检测数据历史 + // 删除检测数据记录 detectionDelById(id) { return api.delete(`/api/detection/data/${id}`, {}) }, // 获取检测会话历史 - sessionById(id) { + sessionById(id) { return api.get(`/api/history/sessions/${id}`) }, + // detectionLatestById(id) { + // return api.get(`/api/detection/data/detail/${id}`) + // }, + + detectionLatestById(id) { + return api.get(`/api/detection/data/detail/${id}`) + }, + + } // 获取后端URL的函数 @@ -622,7 +631,7 @@ export const getBackendUrl = () => { if (window.electronAPI) { return window.electronAPI.getBackendUrl() } else { - return 'http://localhost:5000' + return 'http://192.168.1.173:5000' } } diff --git a/frontend/src/renderer/src/views/Dashboard.vue b/frontend/src/renderer/src/views/Dashboard.vue index a992a941..9e7cdfff 100644 --- a/frontend/src/renderer/src/views/Dashboard.vue +++ b/frontend/src/renderer/src/views/Dashboard.vue @@ -763,8 +763,8 @@ function delClick(id) { .content-area { flex: 1; display: flex; - gap: 20px; - padding: 20px; + gap: 5px; + padding: 5px; overflow: hidden; } diff --git a/frontend/src/renderer/src/views/Detection.vue b/frontend/src/renderer/src/views/Detection.vue index a426526d..8105a67f 100644 --- a/frontend/src/renderer/src/views/Detection.vue +++ b/frontend/src/renderer/src/views/Detection.vue @@ -6,13 +6,13 @@
-
+
实时检测
- - @@ -488,7 +488,7 @@ -
diff --git a/frontend/src/renderer/src/views/PatientProfile.vue b/frontend/src/renderer/src/views/PatientProfile.vue index da2a0457..4afef145 100644 --- a/frontend/src/renderer/src/views/PatientProfile.vue +++ b/frontend/src/renderer/src/views/PatientProfile.vue @@ -25,7 +25,7 @@
{{ index + 1 }}
{{ item.created_at }}
最近会诊
-
{{ calculateExactDaysDifference(item.created_at) }}
+
{{ getDayNum(item.created_at,index) }}
@@ -33,6 +33,7 @@ +
@@ -41,7 +42,8 @@
未处理
已处理
- + +
@@ -66,14 +68,18 @@
保存数据列表:
-
-
截图
+
+
+ + +
-
- +
+
- +
@@ -171,7 +177,7 @@
-
测试医生:李四
+
检查医生:{{ userInfo.username }}
@@ -328,9 +350,10 @@ import { ref, reactive, computed, onMounted } from 'vue' import { useRouter, useRoute } from 'vue-router' import { ElMessage, ElMessageBox } from 'element-plus' -import { patientAPI, detectionAPI,historyAPI } from '../services/api.js' +import { patientAPI, detectionAPI,historyAPI,getBackendUrl } from '@/services/api.js' import Header from '@/views/Header.vue' -import { getBackendUrl } from '../services/api.js' +import { useAuthStore } from '@/stores/index.js' +const authStore = useAuthStore() const BACKEND_URL = getBackendUrl() const router = useRouter() const route = useRoute() @@ -346,7 +369,12 @@ const currentVideo = ref(null) const currentScreenshots = ref([]) const previewScreenshot = ref(null) const videoPlayerRef = ref() - +const dialogVideoVisible = ref(false) +const userInfo = reactive({ + username: '', + avatar: '' + }) + // 计算属性 const filteredRecords = computed(() => { if (!searchKeyword.value) { @@ -358,15 +386,30 @@ const filteredRecords = computed(() => { formatDate(record.createdAt).includes(searchKeyword.value) ) }) -const profileInfo = ref([{ list: [{}, {}] }, {}]) +const profileInfo = ref([]) const diagnosticForm = ref({ diagnosis_info: '', treatment_info: '', suggestion_info: '' }) +const srcList = ref([]) +const imageRef = ref() +function showImage(row){ // 显示大屏图片 + srcList.value = [row] + setTimeout(() => { + if(imageRef.value){ + imageRef.value.showPreview() + } + }, 300) +} +function bigImgClick(row) { + videoUrl.value = BACKEND_URL + '/' + row.normal_video_path + dialogVideoVisible.value = true +} -const calculateExactDaysDifference = (date2) => { +function getDayNum(date2,index){ + console.log(date2,index) // 解析日期字符串 const parseDate = (dateStr) => { if (!dateStr) return new Date(); @@ -414,10 +457,12 @@ const sessionsInit = async () => { } - +const videoUrl = ref("") const dialogVisible = ref(false) const handleClose = () => { dialogVisible.value = false + dialogVideoVisible.value = false + videoUrl.value = "" } const detailsDialogVisible = ref(false) const selectedPatient = ref({}) @@ -666,7 +711,9 @@ function editClick(row,index) { dialogVisible.value = true } //数据详情 -function patientdetails() { +function patientdetails(row) { + // historyAPI.sessionById(row.id).then(res => { + // }) detailsDialogVisible.value = true } async function handleDiagnosticInfo(status) { @@ -742,7 +789,15 @@ const deleteClick = async (row) => { } ).then(() => { historyAPI.detectionDelById(row.id).then((response)=>{ - console.log(response.data) + if(response.success){ + ElMessage.success({ + message: response.message, + duration: 5000 + }); + sessionsInit() + } + + }).catch(()=>{ }) @@ -813,6 +868,12 @@ const deleteClick = async (row) => { onMounted(() => { loadPatientInfo() sessionsInit() + if (authStore.currentUser) { + Object.assign(userInfo, { + username: authStore.currentUser.name, + avatar: authStore.currentUser.avatar || '' + }) + } // loadDetectionRecords() }) @@ -852,6 +913,7 @@ onMounted(() => { .content-left-text3 {} .content-center { + position: relative; width: calc(100% - 327px); margin: 0px 15px; background-color: rgba(85, 85, 85, 0.6); @@ -985,6 +1047,7 @@ onMounted(() => { :deep(.el-dialog) { background-color: #1D1b26; + margin-bottom: 0px; } :deep(.el-dialog__title) { @@ -1388,4 +1451,10 @@ onMounted(() => { .detail-head-text{ margin: 0px 20px; } +.bigImgBox{ + position: absolute; + bottom: 100px; + right: 30px; + cursor: pointer; +} \ No newline at end of file