提交检测页面
This commit is contained in:
parent
fe79fe828a
commit
fbe332a8a6
BIN
frontend/src/renderer/src/assets/new/close.png
Normal file
BIN
frontend/src/renderer/src/assets/new/close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 336 B |
@ -216,6 +216,10 @@
|
|||||||
<Detection v-if="isDetection" :selectedPatient="selectedPatient"
|
<Detection v-if="isDetection" :selectedPatient="selectedPatient"
|
||||||
@endChange="endChange"></Detection>
|
@endChange="endChange"></Detection>
|
||||||
</div>
|
</div>
|
||||||
|
<PatientProfile v-if="isPatientProfile"
|
||||||
|
:PatientProfileType="true"
|
||||||
|
:selectedPatient="selectedPatient"
|
||||||
|
@endChange="endChange"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -228,11 +232,12 @@ import { useAuthStore } from '../stores/index.js'
|
|||||||
import Header from '@/views/Header.vue'
|
import Header from '@/views/Header.vue'
|
||||||
import PatientCreate from '@/views/PatientCreate.vue'
|
import PatientCreate from '@/views/PatientCreate.vue'
|
||||||
import Detection from '@/views/Detection.vue'
|
import Detection from '@/views/Detection.vue'
|
||||||
|
|
||||||
import { color } from 'echarts'
|
import { color } from 'echarts'
|
||||||
|
import PatientProfile from '@/views/PatientProfile.vue'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const isDetection = ref(true) // 显示检查页面
|
const isDetection = ref(false) // 显示检查页面
|
||||||
|
const isPatientProfile =ref(false)
|
||||||
const patienttype = ref('add')
|
const patienttype = ref('add')
|
||||||
const patienttotal = ref(0)
|
const patienttotal = ref(0)
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
@ -421,7 +426,8 @@ const savePatient = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const viewPatientProfile = () => {
|
const viewPatientProfile = () => {
|
||||||
router.push(`/patient/${selectedPatient.value.id}`)
|
isPatientProfile.value = true
|
||||||
|
// router.push(`/patient/${selectedPatient.value.id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const startDetection = () => {
|
const startDetection = () => {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
203
frontend/src/renderer/src/views/DiagnosticMessage.vue
Normal file
203
frontend/src/renderer/src/views/DiagnosticMessage.vue
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
<template>
|
||||||
|
<div class="DiagnosticMessage-container">
|
||||||
|
<!-- 表单内容 -->
|
||||||
|
<div class="form-container">
|
||||||
|
<div class="form-container-header">
|
||||||
|
<div>诊断信息</div>
|
||||||
|
<img src="@/assets/new/u264.svg" alt="" style="cursor: pointer;" @click="handleCancel">
|
||||||
|
</div>
|
||||||
|
<div style="padding:20px 40px;">
|
||||||
|
<el-form :model="diagnosticForm" label-width="60px">
|
||||||
|
<el-form-item label="记录">
|
||||||
|
<el-input v-model="diagnosticForm.diagnosis_info" :rows="6" type="textarea" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="处理">
|
||||||
|
<el-input v-model="diagnosticForm.treatment_info" :rows="6" type="textarea" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建议">
|
||||||
|
<el-input v-model="diagnosticForm.suggestion_info" :rows="6" type="textarea" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="form-actions-display">
|
||||||
|
<el-button @click="handleCancel" class="formreturnCancel">退出</el-button>
|
||||||
|
<el-button type="primary" class="formsaveCancel"
|
||||||
|
@click="handleDiagnosticInfo('completed')">
|
||||||
|
保存
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive, computed, onMounted } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { getBackendUrl, patientAPI } from '../services/api.js'
|
||||||
|
|
||||||
|
const emit = defineEmits([ 'closeDiagnosticMessage']);
|
||||||
|
const router = useRouter()
|
||||||
|
// 后端服务器地址配置
|
||||||
|
const BACKEND_URL = getBackendUrl()
|
||||||
|
const props = defineProps({
|
||||||
|
selectedPatient: {
|
||||||
|
required: false,
|
||||||
|
type: Object,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const diagnosticForm =ref({})
|
||||||
|
|
||||||
|
// 生命周期
|
||||||
|
onMounted(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleCancel = async () => {
|
||||||
|
emit('closeDiagnosticMessage',false)
|
||||||
|
}
|
||||||
|
async function handleDiagnosticInfo(status) {
|
||||||
|
try {
|
||||||
|
// 检查是否有活跃的会话ID
|
||||||
|
if (!selectedPatient.value.sessionId) {
|
||||||
|
throw new Error('缺少会话Id')
|
||||||
|
}
|
||||||
|
// 调用后端API采集检测数据
|
||||||
|
const response = await fetch(`${BACKEND_URL}/api/detection/${selectedPatient.value.sessionId}/save-info`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
diagnosis_info: diagnosticForm.diagnosis_info,
|
||||||
|
treatment_info: diagnosticForm.treatment_info,
|
||||||
|
suggestion_info: diagnosticForm.suggestion_info,
|
||||||
|
status: status,
|
||||||
|
session_id: selectedPatient.value.sessionId,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = await response.json()
|
||||||
|
if (result.success) {
|
||||||
|
// 显示成功消息
|
||||||
|
ElMessage.success({
|
||||||
|
message: status + '诊断信息成功',
|
||||||
|
duration: 5000
|
||||||
|
})
|
||||||
|
emit('closeDiagnosticMessage',true)
|
||||||
|
} else {
|
||||||
|
throw new Error(result.message || '诊断信息失败')
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error({
|
||||||
|
message:'诊断信息失败',
|
||||||
|
duration: 5000
|
||||||
|
})
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.DiagnosticMessage-container {
|
||||||
|
width: 800px;
|
||||||
|
height: 620px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
margin: auto;
|
||||||
|
background: #1b1b1b;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 0px 10px rgba(80, 80, 80, 1);
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: rgba(148, 148, 148, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.formreturnCancel {
|
||||||
|
width: 80px;
|
||||||
|
height: 40px;
|
||||||
|
background: #313131;
|
||||||
|
border: 1px solid rgb(148, 148, 148);
|
||||||
|
font-family: 'Noto Sans SC';
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 14px;
|
||||||
|
color: rgb(148, 148, 148);
|
||||||
|
}
|
||||||
|
|
||||||
|
.formreturnCancel:hover {
|
||||||
|
background: #1e2c49;
|
||||||
|
color: #266fff;
|
||||||
|
border: 1px solid #266fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formsaveCancel {
|
||||||
|
width: 80px;
|
||||||
|
height: 40px;
|
||||||
|
background: #266fff;
|
||||||
|
font-family: 'Noto Sans SC';
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.DiagnosticMessage-container .el-form-item__label{
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #787878;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.DiagnosticMessage-container .el-textarea__inner{
|
||||||
|
background: #282828;
|
||||||
|
box-shadow: 0 0 0 1px rgb(54, 54, 54) inset;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.DiagnosticMessage-container .el-textarea__inner:hover{
|
||||||
|
box-shadow: 0 0 0 1px #266fff inset;
|
||||||
|
}
|
||||||
|
.DiagnosticMessage-container .form-container {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.DiagnosticMessage-container .form-container-header{
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: rgba(46, 52, 59, 1);
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 20px;
|
||||||
|
font-family: 'Noto Sans SC';
|
||||||
|
font-weight: 700;
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
text-align: left;
|
||||||
|
border-radius:10px 10px 0 0;
|
||||||
|
}
|
||||||
|
.DiagnosticMessage-container .form-actions-display{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding-top: 20px;
|
||||||
|
padding-right: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -3,7 +3,7 @@
|
|||||||
<!-- 表单内容 -->
|
<!-- 表单内容 -->
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<div class="form-container-header">
|
<div class="form-container-header">
|
||||||
<div>新建患者信息</div>
|
<div>{{ patienttitle }} </div>
|
||||||
<img src="@/assets/new/u264.svg" alt="" style="cursor: pointer;" @click="handleCancel">
|
<img src="@/assets/new/u264.svg" alt="" style="cursor: pointer;" @click="handleCancel">
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="patientFormRef" :model="patientForm" :rules="formRules" label-width="120px" class="patient-form">
|
<el-form ref="patientFormRef" :model="patientForm" :rules="formRules" label-width="120px" class="patient-form">
|
||||||
@ -154,10 +154,12 @@ const patientForm = reactive({
|
|||||||
// 加载状态
|
// 加载状态
|
||||||
const saveLoading = ref(false)
|
const saveLoading = ref(false)
|
||||||
const saveAndDetectLoading = ref(false)
|
const saveAndDetectLoading = ref(false)
|
||||||
|
const patienttitle = ref("新建患者信息")
|
||||||
// 生命周期
|
// 生命周期
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 从认证状态管理中加载用户信息
|
// 从认证状态管理中加载用户信息
|
||||||
if (props.patienttype == 'edit') {
|
if (props.patienttype == 'edit') {
|
||||||
|
patienttitle.value = '编辑患者信息'
|
||||||
Object.assign(patientForm, props.selectedPatient)
|
Object.assign(patientForm, props.selectedPatient)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,11 +316,6 @@ const handleSaveAndDetect = async () => {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background: #1b1b1b;
|
background: #1b1b1b;
|
||||||
|
|
||||||
/* height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
background: #000000; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-container {
|
.nav-container {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
1601
frontend/src/renderer/src/views/PatientProfile2.vue
Normal file
1601
frontend/src/renderer/src/views/PatientProfile2.vue
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user