1.删除不需要的内容,修改部分样式
This commit is contained in:
2025-07-03 09:39:26 +08:00
parent 534e759350
commit 9cb6a0ad7a
1719 changed files with 38 additions and 347285 deletions
@@ -0,0 +1,267 @@
import { Ref, ref } from 'vue';
import { cloneDeep } from 'lodash-es';
export function showFormTip(domId: string) {
const dom: HTMLElement | null = document.getElementById(domId);
function showDom() {
if (dom) {
dom.style.display = 'block';
dom.scrollIntoView();
}
}
function hiddenDom() {
if (dom) {
dom.style.display = 'none';
}
}
return {
showDom,
hiddenDom,
};
}
/**
* 获取用户其他信息
*/
export function useUserOtherInfo() {
//就诊人信息
const userOtherInfo = ref({
sex_dictText: '',
age: '',
idCard: '',
phone: '',
departName: '',
userDepartName: '',
workNo: '',
});
function setUserOtherInfo(values) {
for (const key in userOtherInfo.value) {
userOtherInfo.value[key] = values[key] || '';
}
userOtherInfo.value['departName'] = values?.userOrgName || values?.secondDepart?.departName || '';
userOtherInfo.value['userDepartName'] = values?.userDepartName || values?.threeDepart?.departName || '';
}
return {
userOtherInfo,
setUserOtherInfo,
};
}
function setInfo(record, list, callback?: Function) {
if (callback) {
callback(list);
return;
}
list.forEach((item) => {
const { field } = item;
const isEmpty = (obj, field) => {
if (!obj) return true;
return obj[field] === undefined || obj[field] === null || obj[field] === '';
};
if (!isEmpty(record, field)) {
if (Object.hasOwn(item, 'customRender')) {
// @ts-ignore
item.value = item.customRender(record);
} else if (Object.hasOwn(item, 'slot')) {
item.value = { ...record, dataIndex: field };
} else {
item.value = record[field] || '';
}
} else {
item.value = '';
}
});
return list;
}
interface IUseTreatmentInfo {
label?: string;
value: string;
component: string;
field: string;
slot?: string;
}
/**
* 就诊详情
*/
export function useTreatmentInfo() {
const basicInfo: Ref<IUseTreatmentInfo[]> = ref([
{
label: '就诊人',
value: '',
component: 'Input',
field: 'userName',
slot: 'userName',
},
{
label: '工号',
value: '',
component: 'Input',
field: 'workNo',
},
{
label: '联系电话',
value: '',
component: 'Input',
field: 'phone',
},
{
label: '身份证号',
value: '',
component: 'Input',
field: 'idCard',
},
{
label: '所属单位',
value: '',
component: 'Input',
field: 'userOrgName',
},
{
label: '所属部门',
value: '',
component: 'Input',
field: 'userDepartName',
},
{
label: '员工档案',
value: '',
component: 'Input',
field: 'createTime',
slot: 'employeeFile',
},
]);
const medicalInformation: Ref<IUseTreatmentInfo[]> = ref([
{
label: '就诊医生',
value: '',
component: 'Input',
field: 'doctorName',
},
{
label: '就诊时间',
value: '',
component: 'Input',
field: 'diagnosisDate',
},
{
label: '诊断',
value: '',
component: 'Textarea',
field: 'diagnosisDisease',
},
{
label: '主诉',
value: '',
component: 'Textarea',
field: 'mainDemands',
},
{
label: '查体',
value: '',
component: 'Textarea',
field: 'inspectionTool',
},
{
label: '现病史',
value: '',
component: 'Textarea',
field: 'historyPresentIllness',
},
{
label: '既往史',
value: '',
component: 'Textarea',
field: 'pastHistory',
},
{
label: '过敏史',
value: '',
component: 'Textarea',
field: 'allergicHistory',
},
]);
const medicineList: Ref<IUseTreatmentInfo[]> = ref([
{
label: '药品名称',
value: '',
component: 'Input',
field: 'medicineName',
},
{
label: '规格',
value: '',
component: 'Input',
field: 'medicineSpecification',
},
{
label: '价格',
value: '',
component: 'Input',
field: 'sellingPrice',
},
{
label: '数量',
value: '',
component: 'Input',
field: 'drugsNum',
},
{
label: '用法用量',
value: '',
component: 'Input',
field: 'dosage',
},
]);
const lifeAdvice: Ref<IUseTreatmentInfo[]> = ref([
{
label: '医嘱',
value: '',
component: 'Textarea',
field: 'doctorAdvice',
},
{
label: '运动处方',
value: '',
component: 'Textarea',
field: 'exerciseFormula',
},
{
label: '膳食处方',
value: '',
component: 'Textarea',
field: 'foodFormula',
},
]);
function setFormValues(values = {}) {
basicInfo.value = setInfo(values, basicInfo.value);
medicalInformation.value = setInfo(values, medicalInformation.value);
lifeAdvice.value = setInfo(values, lifeAdvice.value);
}
function getMedicineList(values = []) {
return setInfo(values, medicineList.value);
}
function getMedicineDetail(values = []) {
let res = setInfo(values, medicineList.value);
return cloneDeep(res);
}
return {
basicInfo,
medicalInformation,
lifeAdvice,
setFormValues,
getMedicineList,
getMedicineDetail,
};
}
//val是正常值则返回正常,否则返回--
export function useShowValue(val: string | boolean | number) {
if (typeof val == undefined || val == null || val == '') {
return '--';
}
return val;
}
@@ -0,0 +1,93 @@
<template>
<div class="medical-card">
<div v-if="$slots.title"><slot name="title"></slot></div>
<div v-if="!$slots.title && title" class="title">{{ title }}</div>
<div v-for="(item, index) in cardList" :key="index">
<template v-if="item.hasOwnProperty('slot')">
<slot :name="item.slot" v-bind="item.value"></slot>
</template>
<template v-else>
<div v-if="item.component == 'Input'" class="input-box">
<div class="input-label">{{ item.label }}</div>
<div class="input-value">{{ useShowValue(item.value) }}</div>
</div>
<div v-if="item.component == 'Textarea' || item.component == 'InputTextArea'" class="textarea-box">
<div class="textarea-label">{{ item.label }}</div>
<div class="textarea-value">{{ useShowValue(item.value) }}</div>
</div>
<div v-if="item.component == 'Image'" class="input-box">
<div class="input-label">{{ item.label }}</div>
<div>
<Image
:width="100"
:height="100"
style="margin: 0"
:src="getFileAccessHttpUrl(item.value)"
:fallback="getFamaleDefaultImage()"
/>
</div>
</div>
</template>
</div>
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { Image } from 'ant-design-vue';
import { useShowValue } from '/@/views/emergency/personnelManagement/components/hooks';
import { getFamaleDefaultImage, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
title: {
type: String,
default: () => {
return '';
},
},
});
const cardList = computed(() => props.list);
</script>
<style scoped lang="less">
.medical-card {
border: 1px solid #f0f0f0;
padding: 10px;
margin: 10px 0;
position: relative;
.title {
font-weight: bold;
line-height: 30px;
}
.input-box {
display: flex;
margin-bottom: 15px;
.input-label {
width: 100px;
text-align: right;
}
.input-value {
width: calc(100% - 100px);
}
}
.textarea-box {
width: 100%;
display: flex;
margin-bottom: 15px;
overflow: hidden;
flex-wrap: wrap;
.textarea-label {
width: 100px;
text-align: right;
}
.textarea-value {
width: calc(100% - 100px);
}
}
}
</style>
@@ -25,7 +25,7 @@
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
import { dealPassword } from '/@/views/system/user/user.data';
import { formSchema, getPersonType, useDetailForm } from '/@/views/emergency/personnelManagement/personnelManagement.data';
import MedicalCard from '/@/views/interveneNew/medicalPoints/components/medicalCard.vue';
import MedicalCard from '/@/views/emergency/personnelManagement/components/medicalCard.vue';
import { useRoute } from 'vue-router';
const { adaptiveWidth } = useDrawerAdaptiveWidth();