-
身高:
-
-
- {{ selectedPatient.height }}cm
-
-
—
+
+
电话
+
+
+ {{ selectedPatient.phone }}
+
+ —
+
+
+
+
邮箱
+
+
+ {{ selectedPatient.email }}
+
+ —
+
-
体重:
-
-
- {{ selectedPatient.weight }}kg
-
-
—
+
+
证件号
+
+
+ {{ selectedPatient.idcode }}
+
+ —
+
+
+
+
职业
+
+
+ {{ selectedPatient.occupation }}
+
+ —
+
-
-
鞋码:
-
-
- {{ selectedPatient.shoe_size }}码
-
- —
-
+
+
@@ -248,9 +261,6 @@ const userInfo = reactive({
const tableRef = ref(null)
const dialogVisible = ref(false)
// 表单引用
-const patientFormRef = ref()
-// 表单数据
-const saveLoading = ref(false)
const patientForm = ref({
id: '',
name: '',
@@ -263,60 +273,9 @@ const patientForm = ref({
shoe_size: '',
phone: '',
occupation: '',
- workplace: '',
+ idcode: '',
email: ''
})
-const occupationOptions = ref(["学生", "教师", "医生", "护士", "工程师", "程序员", "设计师",
-"会计师", "律师", "警察", "消防员", "军人", "公务员", "销售", "市场营销",
-"人力资源", "行政", "财务", "咨询师", "建筑师", "科研人员", "记者", "编辑",
-"作家", "艺术家", "音乐家", "演员", "导演", "摄影师", "厨师", "服务员",
-"司机", "快递员", "外卖员", "农民", "工人", "电工", "焊工", "机械师",
-"飞行员", "空乘", "船员", "导游", "翻译", "心理咨询师", "社会工作者",
-"运动员", "教练", "经纪人", "投资人", "企业家", "自由职业者"])
-const residenceOptions = ref([
- { label: '北京', value: '北京' }
-])
-const nationalityOptions = ref(["汉族", "满族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族",
-"布依族", "朝鲜族", "侗族", "瑶族", "白族", "土家族", "哈尼族", "哈萨克族", "傣族",
-"黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族",
-"景颇族", "柯尔克孜族", "土族", "达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族",
-"毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族", "乌孜别克族",
-"俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族", "独龙族",
-"鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"])
-// 表单验证规则
-const formRules = {
- name: [
- { required: true, message: '请输入患者姓名', trigger: 'blur' },
- { min: 2, max: 20, message: '姓名长度在 2 到 20 个字符', trigger: 'blur' }
- ],
- gender: [
- { required: true, message: '请选择性别', trigger: 'change' }
- ],
- birthDate: [
- { required: true, message: '请选择出生日期', trigger: 'change' }
- ],
- height: [
- { required: true, message: '请输入身高', trigger: 'blur' },
- { pattern: /^\d+(\.\d+)?$/, message: '请输入有效的身高', trigger: 'blur' }
- ],
- weight: [
- { required: true, message: '请输入体重', trigger: 'blur' },
- { pattern: /^\d+(\.\d+)?$/, message: '请输入有效的体重', trigger: 'blur' }
- ],
- phone: [
- { required: true, message: '请输入联系电话', trigger: 'blur' },
- { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
- ]
-}
-const validateForm = async () => {
- try {
- await patientFormRef.value.validate()
- return true
- } catch (error) {
- ElMessage.error('请完善必填信息')
- return false
- }
-}
const calculatedAge = ref('')
// 实现年龄计算方法 calculateAgeres
const calculateAgeres = (date) => {
@@ -330,16 +289,6 @@ const calculateAgeres = (date) => {
}
calculatedAge.value = age
}
-// 计算属性
-const filteredPatients = computed(() => {
- // if (!searchKeyword.value) {
- // return patients.value
- // }
-
- // return patients.value.filter(patient =>
- // patient.name.toLowerCase().includes(searchKeyword.value.toLowerCase())
- // )
-})
// 方法
const handleSearch = () => {
@@ -347,92 +296,25 @@ const handleSearch = () => {
loadPatients()
}
-
-// const selectPatient = (patient) => {
-// selectedPatient.value = patient
-// }
-
-const selectPatient = (patient) => {
+const rowIndex = ref(-1)
+const selectPatient = (patient,column,cell) => {
+ const selectIndex = patients.value.indexOf(patient);
+ rowIndex.value = selectIndex
selectedPatient.value = patient
}
-
-
-const editPatient = () => {
- // router.push(`/patient/edit/${selectedPatient.value.id}`)
- // 修改选中患者信息
- patientForm.value = JSON.parse(JSON.stringify(selectedPatient.value))
- if (patientForm.value.birth_date) {
- calculatedAge.value = calculateAgeres(patientForm.value.birth_date)
- }
- dialogVisible.value = true
-}
-const handleSave = async () => {
- if (!(await validateForm())) return
- saveLoading.value = true
- try {
- await savePatient()
- ElMessage.success('修改成功')
- dialogVisible.value = false
- saveLoading.value = false
- await loadPatients()
- if (patients.value.length > 0 && selectedPatient.value.id) {
- for (var i = 0; i < patients.value.length; i++) {
- if (patients.value[i].id === selectedPatient.value.id) {
- selectedPatient.value = patients.value[i]
- break
- }
- }
- }
- setTimeout(() => {
- tableRef.value.setCurrentRow(selectedPatient.value)
- }, 300)
- } catch (error) {
- ElMessage.error('修改失败:' + error.message)
- saveLoading.value = false
- } finally {
- saveLoading.value = false
- }
-}
-const savePatient = async () => {
- const patientData = {
- id: patientForm.value.id,
- name: patientForm.value.name,
- gender: patientForm.value.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
- }
- try {
- const response = await patientAPI.updatePatient(patientForm.value.id, patientData)
- if (response.success) {
- return response.data
- } else {
- throw new Error(response.message || '修改失败')
- }
- } catch (error) {
- throw error
- }
-}
const viewPatientProfile = () => {
+ if (selectedPatient.value ==null ||selectedPatient.value.id == null || selectedPatient.value.id =='') {
+ ElMessage.warning('请先选择患者')
+ return
+ }
isPatientProfile.value = true
- // router.push(`/patient/${selectedPatient.value.id}`)
}
-
const startDetection = () => {
- if (!selectedPatient.value) {
+ if (selectedPatient.value ==null ||selectedPatient.value.id == null || selectedPatient.value.id =='') {
ElMessage.warning('请先选择患者')
return
}
isDetection.value = true
- // router.push(`/detection/${selectedPatient.value.id}`)
}
const createNewPatient = async () => {
@@ -551,10 +433,6 @@ const loadPatients = async () => {
patients.value = []
}
}
-const handleClose = () => {
- patientFormRef.value?.resetFields()
- dialogVisible.value = false
-}
// 生命周期
onMounted(() => {
// 从认证状态管理中加载用户信息
@@ -600,14 +478,18 @@ function delClick(id) {
});
}
const isCloseCreat = ref(false)
-function closecreatbox(e){
- if(e == true){
- loadPatients()
- }else if(e != null && e.id != null) {
- selectedPatient.value = e
- loadPatients()
+function closecreatbox(e,e2){
+
+ if(e == '关闭'){
isDetection.value = true
+ }else if(e == '新建') {
+ loadPatients()
+ }else if(e == '编辑') {
+ // patients.value[rowIndex.value] = e2
+ selectedPatient.value = e2
}
+
+
isCloseCreat.value = false
}
function endChange(){
@@ -631,7 +513,7 @@ function editClick(){
height: 100vh;
display: flex;
flex-direction: column;
- background: #000;
+ background: #191028;
}
.header {
@@ -770,11 +652,12 @@ function editClick(){
}
.patient-section {
- width: calc(100% - 350px);
- background: rgb(51, 51, 51);
+ width: calc(100% - 500px);
+ background: #1D2330;
border-radius: 8px;
padding: 20px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
+ border:1px solid #292f3c;
}
.section-header {
@@ -790,11 +673,6 @@ function editClick(){
font-size: 18px;
}
-.search-box {
- /* width: 250px; */
- display: flex;
- align-items: center;
-}
.patient-list {
flex: 1;
@@ -852,21 +730,24 @@ function editClick(){
}
.patient-detail {
- width: 350px;
- background: #282828;
+ width: 500px;
border-radius: 4px;
height: 100%;
- /* background: #fff; */
+ background: #1f2533;
+ border-radius: 8px;
+ padding: 20px 23px;
+ border:1px solid #292f3c;
}
.patient-detail-box {
- background: rgb(51, 51, 51);
+ position: relative;
+ width: 452px;
+ height: 122px;
+ background: rgba(55, 65, 81, 0.5);
border-radius: 8px;
padding: 20px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
display: flex;
- flex-direction: column;
color: #fff;
}
@@ -980,10 +861,6 @@ function editClick(){
padding: 0px 25px;
}
-:deep(.el-input__wrapper) {
- background: transparent;
-}
-
.basic-info-box {
display: flex;
flex-wrap: wrap;
@@ -1032,23 +909,16 @@ function editClick(){
margin-right: 4px;
}
-:deep(.el-input__wrapper) {
- background-color: rgba(51, 51, 51, 1);
- border-width: 1px;
- border-style: solid;
- border-color: rgba(127, 127, 127, 1);
- border-radius: 4px;
- box-shadow: none;
-}
-
-:deep(.el-table th .cell){
- font-size: 14px;
-
+.patient-section :deep(.el-table th .cell){
+ font-weight: 700;
+ font-style: normal;
+ font-size: 16px;
+ color: #9CA3AF;
}
:deep(.el-table--border .el-table__inner-wrapper){
border-right: 1px solid #434343;
@@ -1056,6 +926,33 @@ function editClick(){
:deep(.el-table .cell){
font-size: 18px;
}
+
+
+ /* 搜索框样式 */
+.search-box {
+ width: 372px;
+ height: 40px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ background: #191D28;
+ border-radius: 4px;
+}
+.search-box :deep(.el-input__wrapper) {
+ background-color: transparent;
+ border-width: 0;
+ border-radius: 4px;
+ box-shadow: none;
+ color:#fff
+}
+.search-box :deep(.el-input__inner) {
+ color:#D1D5DB;
+ font-size: 14px;
+}
+
+
+
+
diff --git a/frontend/src/renderer/src/views/Detection - 副本.vue b/frontend/src/renderer/src/views/Detection - 副本.vue
index 8229f853..d7ff737f 100644
--- a/frontend/src/renderer/src/views/Detection - 副本.vue
+++ b/frontend/src/renderer/src/views/Detection - 副本.vue
@@ -2560,7 +2560,7 @@ function refreshClick(type) {
.video-preview {
width: 100%;
height: 100%;
- object-fit: cover;
+ /* object-fit: cover; */
}
.video-time {
diff --git a/frontend/src/renderer/src/views/Header.vue b/frontend/src/renderer/src/views/Header.vue
index bd9803a1..45972061 100644
--- a/frontend/src/renderer/src/views/Header.vue
+++ b/frontend/src/renderer/src/views/Header.vue
@@ -213,7 +213,7 @@
.header {
height: 60px;
- background: #323232;
+ background: #191028;
border-bottom: none;
display: flex;
justify-content: space-between;
diff --git a/frontend/src/renderer/src/views/PatientCreate.vue b/frontend/src/renderer/src/views/PatientCreate.vue
index b9b5bb3f..fff35282 100644
--- a/frontend/src/renderer/src/views/PatientCreate.vue
+++ b/frontend/src/renderer/src/views/PatientCreate.vue
@@ -6,12 +6,12 @@
{{ patienttitle }}