修改档案页和新增修改页面样式

This commit is contained in:
limengnan 2025-12-02 15:56:36 +08:00
parent 22e6a3f48a
commit c4cccfd3c2
10 changed files with 414 additions and 466 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

View File

@ -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.62:5000'
}
// 为需要发送数据的请求设置Content-Type避免覆盖FormData
@ -660,7 +660,7 @@ export const getBackendUrl = () => {
if (window.electronAPI) {
return window.electronAPI.getBackendUrl()
} else {
return 'http://localhost:5000'
return 'http://192.168.1.62:5000'
}
}

File diff suppressed because it is too large Load Diff

View File

@ -2560,7 +2560,7 @@ function refreshClick(type) {
.video-preview {
width: 100%;
height: 100%;
object-fit: cover;
/* object-fit: cover; */
}
.video-time {

View File

@ -213,7 +213,7 @@
.header {
height: 60px;
background: #323232;
background: #191028;
border-bottom: none;
display: flex;
justify-content: space-between;

View File

@ -6,12 +6,12 @@
<div>{{ patienttitle }} </div>
<img src="@/assets/new/u264.svg" alt="" style="cursor: pointer;" @click="handleCancel">
</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="80px" class="patient-form">
<div class="form-section">
<el-row :gutter="20">
<el-row :gutter="80">
<el-col :span="12">
<el-form-item label="测试者ID" prop="testerId">
<el-input v-model="patientForm.id" disabled placeholder="请输入测试者ID" clearable />
<el-form-item label="者ID" prop="testerId">
<el-input v-model="patientForm.id" disabled placeholder="自动生成患者ID" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
@ -89,8 +89,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="证件号" prop="workplace">
<el-input v-model="patientForm.workplace" placeholder="请输入" clearable />
<el-form-item label="证件号" prop="idcode">
<el-input v-model="patientForm.idcode" placeholder="请输入" clearable />
</el-form-item>
</el-col>
</el-row>
@ -100,21 +100,11 @@
<el-button @click="handleCancel" class="formreturnCancel">退出</el-button>
<el-button type="primary" :loading="saveLoading" @click="handleSave"
class="formsaveCancel">
保存
</el-button>
<el-button type="primary" :loading="saveLoading" @click="handleSaveAndDetect"
class="formsaveCancel">
保存并开始检测
确定
</el-button>
</div>
</div>
<!-- 底部操作按钮 -->
<!-- <div class="footer-actions">
<el-button type="success" :loading="saveAndDetectLoading">
保存并开始检测
</el-button>
</div> -->
</div>
</template>
@ -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
}
}
</script>
<style scoped>
@ -346,7 +326,9 @@ const handleSaveAndDetect = async () => {
left: 0;
bottom: 0;
margin: auto;
background: #1b1b1b;
background: #465367;
border-radius: 10px;
box-shadow: 0px 0px 16px rgba(17, 24, 33, 1);
}
.nav-container {
@ -400,7 +382,6 @@ const handleSaveAndDetect = async () => {
.patient-form {
margin: 0 auto;
padding: 30px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.form-section {
@ -460,9 +441,9 @@ const handleSaveAndDetect = async () => {
:deep(.el-form-item__label) {
font-size: 14px !important;
font-family: 'Noto Sans SC';
font-weight: 700 !important;
font-weight: 400 !important;
font-style: normal !important;
color: #787878 !important;
color: #FFFFFF !important;
}
:deep(.el-form-item__content) {
@ -494,7 +475,7 @@ const handleSaveAndDetect = async () => {
}
.patient-create-container :deep(.el-input__wrapper) {
background-color: #282828;
background-color: #2a3649;
border-width: 1px;
border-style: solid;
border-color: rgb(54, 54, 54);
@ -504,21 +485,17 @@ const handleSaveAndDetect = async () => {
}
:deep(.el-select__wrapper) {
background-color: #282828;
background-color: #2a3649;
border-width: 1px;
border-style: solid;
border-color: rgb(54, 54, 54);
border-color: transparent;
border-radius: 4px;
box-shadow: none;
height: 40px;
}
:deep(.el-form-item__label) {
font-size: 14px;
font-family: 'Noto Sans SC';
font-weight: 700;
font-style: normal;
color: #FFFFFF;
:deep(.el-select__wrapper:hover){
border-color: #3d4c65;
box-shadow: 0 0 0 1px transparent inset;
}
:deep(.el-col-12) {
@ -527,22 +504,24 @@ const handleSaveAndDetect = async () => {
:deep(.el-input__inner) {
color: #ffffff;
font-size: 16px;
font-size: 14px;
height: 40px;
}
:deep(.el-input.is-disabled .el-input__inner) {
color: #787878;
}
:deep(.el-select__placeholder) {
color: #ffffff;
font-size: 16px;
font-size: 14px;
}
:deep(.el-input.is-disabled .el-input__wrapper) {
background-color: rgba(127, 127, 127, 1);
background-color: #2a3649;
box-shadow: none;
border-width: 1px;
border-style: solid;
border-color: rgba(215, 215, 215, 1);
color: #FFFFFF;
border-color: transparent;
}
</style>
<style>
@ -571,13 +550,12 @@ const handleSaveAndDetect = async () => {
display: flex;
align-items: center;
justify-content: space-between;
background-color: rgba(46, 52, 59, 1);
box-sizing: border-box;
padding: 0 20px;
padding: 0 30px;
font-family: 'Noto Sans SC';
font-weight: 700;
font-style: normal;
font-size: 16px;
font-size: 20px;
color: #FFFFFF;
text-align: left;
}
@ -589,29 +567,35 @@ const handleSaveAndDetect = async () => {
.formreturnCancel{
width: 80px;
height: 40px;
background: #313131;
border: 1px solid rgb(148, 148, 148);
background: rgba(89, 113, 148, 1);
border: 1px solid rgba(89, 113, 148, 1);
font-family: 'Noto Sans SC';
font-weight: 400;
font-style: normal;
font-size: 14px;
color: rgb(148, 148, 148);
color: rgba(255, 255, 255, 0.6);
}
.formreturnCancel:hover{
background: #1e2c49;
background: #425b89;
color: #266fff;
border: 1px solid #266fff;
}
.formsaveCancel{
width: 80px;
height: 40px;
background: #266fff;
background: #0b94d5;
font-family: 'Noto Sans SC';
font-weight: 400;
font-style: normal;
font-size: 14px;
color: #FFFFFF;
}
.formsaveCancel:hover{
background: #5189ff;
border: 1px solid #5189ff;
}
.el-date-editor.el-input{
height: 40px;
}

View File

@ -1372,7 +1372,7 @@ onMounted(() => {
.screenshot-item img {
width: 100%;
height: 150px;
object-fit: cover;
/* object-fit: cover; */
}
.screenshot-overlay {

View File

@ -1200,7 +1200,7 @@ onUnmounted(() => {
.preview-video {
width: 100%;
height: 100%;
object-fit: contain;
/* object-fit: contain; */
}
.recording-overlay {