From c4cccfd3c2e1221a056702f8d5101e37577126ed Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Tue, 2 Dec 2025 15:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A1=A3=E6=A1=88=E9=A1=B5?= =?UTF-8?q?=E5=92=8C=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/renderer/src/assets/new/add.png | Bin 0 -> 172 bytes .../src/renderer/src/assets/new/bigavatar.svg | 11 + .../src/renderer/src/assets/new/homeedit.png | Bin 0 -> 596 bytes frontend/src/renderer/src/services/api.js | 4 +- frontend/src/renderer/src/views/Dashboard.vue | 703 ++++++++---------- .../renderer/src/views/Detection - 副本.vue | 2 +- frontend/src/renderer/src/views/Header.vue | 2 +- .../src/renderer/src/views/PatientCreate.vue | 154 ++-- .../renderer/src/views/PatientProfile2.vue | 2 +- frontend/src/renderer/src/views/Recording.vue | 2 +- 10 files changed, 414 insertions(+), 466 deletions(-) create mode 100644 frontend/src/renderer/src/assets/new/add.png create mode 100644 frontend/src/renderer/src/assets/new/bigavatar.svg create mode 100644 frontend/src/renderer/src/assets/new/homeedit.png diff --git a/frontend/src/renderer/src/assets/new/add.png b/frontend/src/renderer/src/assets/new/add.png new file mode 100644 index 0000000000000000000000000000000000000000..6646b70807df7df00c7b8ab2a32c84dd3788a1c5 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^{2oCO|{#S9F5M?jcysy3fAP%zHZ z#W6%{HCoE5)u{5;uc@IyCtMoRqy=1Uwz)DV(~#|RT)ABO=@2M SU%~^liNVv=&t;ucLK6U)AwHP^ literal 0 HcmV?d00001 diff --git a/frontend/src/renderer/src/assets/new/bigavatar.svg b/frontend/src/renderer/src/assets/new/bigavatar.svg new file mode 100644 index 00000000..38c0f6bd --- /dev/null +++ b/frontend/src/renderer/src/assets/new/bigavatar.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/renderer/src/assets/new/homeedit.png b/frontend/src/renderer/src/assets/new/homeedit.png new file mode 100644 index 0000000000000000000000000000000000000000..e0a0de5d27ce67e80647baaa7820df549292ae94 GIT binary patch literal 596 zcmV-a0;~OrP)LQ{PJzQ5Zen&K;ktKOjUXsJDecQ5H1dxoG?A*CCyHip3 z;c&S3J9o}^zB_c%U%_Ak{WJO)4B&rIc-##FOb!5UZZUuXFBfd`tBv(Kb7PXvxENHDmdK!5(^erd@md9?8>dAYfBacS98?8>4)a#z)V|FM3hCAhK@ z2S}Zi7Z=Bm6$Q$Qr9S>;wXrq0`fbg0X-&%Hc8Dq$br;V|{o>N6rnX=ru|XiSPoeO{TxA&>(_pzZ7SDxbW)7W-8JvKhMx4%!> zUC$9120LCeftl!pzua}Jlm8h75jj=l;D3RFW$Nm$0`o4mo?$MxG0&e$UXDE62?p}d ioRyw)ITHY4F!%rz-B`terEg~d0000 { if (window.electronAPI) { return window.electronAPI.getBackendUrl() } else { - return 'http://localhost:5000' + return 'http://192.168.1.62:5000' } } diff --git a/frontend/src/renderer/src/views/Dashboard.vue b/frontend/src/renderer/src/views/Dashboard.vue index 7ed94a00..30c7e78f 100644 --- a/frontend/src/renderer/src/views/Dashboard.vue +++ b/frontend/src/renderer/src/views/Dashboard.vue @@ -10,17 +10,15 @@
- - - - 新建患者档案 - +
+ 新建患者档案 +
- - - - + + - - @@ -152,19 +142,21 @@ const patientForm = reactive({ shoe_size: '', phone: '', occupation: '', - workplace: '', + idcode: '', email: '' }) // 加载状态 const saveLoading = ref(false) const saveAndDetectLoading = ref(false) -const patienttitle = ref("新建患者信息") +const patienttitle = ref("新建档案") // 生命周期 onMounted(() => { // 从认证状态管理中加载用户信息 if (props.patienttype == 'edit') { - patienttitle.value = '编辑患者信息' - Object.assign(patientForm, props.selectedPatient) + patienttitle.value = '编辑个人信息' + let tempInfo = props.selectedPatient + tempInfo.age = calculateAgeres(tempInfo.birth_date ) + Object.assign(patientForm, tempInfo) } @@ -227,7 +219,7 @@ const calculateAgeres = (date) => { calculatedAge.value = age } const handleCancel = async () => { - emit('closecreatbox',false) + emit('closecreatbox','关闭','') } const validateForm = async () => { @@ -253,7 +245,7 @@ const savePatient = async () => { email: patientForm.email, nationality: patientForm.nationality, residence: patientForm.residence, - workplace: patientForm.workplace, + idcode: patientForm.idcode, medical_history: '', // 添加病史字段 notes: '' // 添加备注字段 } @@ -261,7 +253,7 @@ const savePatient = async () => { try { const response = await patientAPI.create(patientData) if (response.success) { - emit('closecreatbox',true) + emit('closecreatbox','新建',response.data) return response.data } else { @@ -274,24 +266,25 @@ const savePatient = async () => { } const updatePatient = async () => { const patientData = { - id: patientForm.value.id, - name: patientForm.value.name, - gender: patientForm.value.gender, + id: patientForm.id, + name: patientForm.name, + gender: patientForm.gender, age: calculatedAge.value, - birth_date: patientForm.value.birth_date, - height: patientForm.value.height, - weight: patientForm.value.weight, - shoe_size: patientForm.value.shoe_size, - phone: patientForm.value.phone, - occupation: patientForm.value.occupation, - email: patientForm.value.email, - nationality: patientForm.value.nationality, - residence: patientForm.value.residence, - workplace: patientForm.value.workplace + birth_date: patientForm.birth_date, + height: patientForm.height, + weight: patientForm.weight, + shoe_size: patientForm.shoe_size, + phone: patientForm.phone, + occupation: patientForm.occupation, + email: patientForm.email, + nationality: patientForm.nationality, + residence: patientForm.residence, + idcode: patientForm.idcode } try { - const response = await patientAPI.updatePatient(patientForm.value.id, patientData) + const response = await patientAPI.updatePatient(patientForm.id, patientData) if (response.success) { + emit('closecreatbox','编辑',patientData) return response.data } else { throw new Error(response.message || '修改失败') @@ -305,35 +298,22 @@ const handleSave = async () => { saveLoading.value = true try { - if(patientForm.value.id == null){ + if(patientForm.id == null){ await savePatient() - }else[ - await updatePatient () - ] + }else{ + await updatePatient() + } + + ElMessage.success('患者档案保存成功') + } catch (error) { ElMessage.error('保存失败:' + error.message) } finally { saveLoading.value = false } } - -const handleSaveAndDetect = async () => { - if (!(await validateForm())) return - - saveAndDetectLoading.value = true - try { - const patient = await savePatient() - ElMessage.success('患者档案保存成功,即将开始检测') - emit('closecreatbox',patient) - // router.push(`/detection/${patient.id}`) - } catch (error) { - ElMessage.error('保存失败:' + error.message) - } finally { - saveAndDetectLoading.value = false - } -}