style(healthMonitor,user): 统一代码格式,清理多余空白字符

- 规范 sectoralData.data.ts 文件的代码缩进与空行
- 规范 HealthUserEmployeeEx.data.ts 文件的代码格式
- 规范 HealthUserEmployeeExList.vue 文件的模板格式
This commit is contained in:
2026-05-14 10:03:38 +08:00
parent 592ffe1f50
commit 8044ce0461
3 changed files with 60 additions and 3 deletions
@@ -164,10 +164,10 @@ export const columnsNew: BasicColumn[] = [
customRender: ({ record }) => { customRender: ({ record }) => {
const total = record.totalAssignedDeviceNums ?? 0; const total = record.totalAssignedDeviceNums ?? 0;
const assigned = record.assignedDeviceNums ?? 0; const assigned = record.assignedDeviceNums ?? 0;
return total - assigned; return Math.max(0, total - assigned);
}, },
}, },
{ {
title: '已绑定设备数', title: '已绑定设备数',
dataIndex: ['assignedDeviceNums'], dataIndex: ['assignedDeviceNums'],
customRender: ({ text }) => { customRender: ({ text }) => {
@@ -181,7 +181,15 @@ export const columnsNew: BasicColumn[] = [
customRender: ({ record }) => { customRender: ({ record }) => {
const total = record.totalAssignedDeviceNums ?? 0; const total = record.totalAssignedDeviceNums ?? 0;
const assigned = record.assignedDeviceNums ?? 0; const assigned = record.assignedDeviceNums ?? 0;
return total - assigned; return Math.max(0, total - assigned);
},
},
{
title: '非关爱人员数量',
dataIndex: ['nonCareNums'],
customRender: ({ text }) => {
if (!text) return 0;
return text;
}, },
}, },
{ {
@@ -232,6 +240,7 @@ export const columnsNew: BasicColumn[] = [
return text; return text;
}, },
}, },
]; ];
const startTime = dayjs().subtract(6, 'day').format('YYYY-MM-DD'); const startTime = dayjs().subtract(6, 'day').format('YYYY-MM-DD');
@@ -376,6 +385,16 @@ export const detailColumns = (arr: BasicColumn[] = []) => {
title: '手表所属单位', title: '手表所属单位',
dataIndex: 'watchOrgName', dataIndex: 'watchOrgName',
}, },
{
title: '非关爱人员',
dataIndex: 'nonCareFlag',
width: 100,
customRender: ({ text }) => {
if (text === 1) return '是';
if (text === 0) return '否';
return '';
},
},
...arr, ...arr,
{ {
title: '应佩戴天数', title: '应佩戴天数',
@@ -85,6 +85,13 @@ export const columns: BasicColumn[] = [
dataIndex: ['departTree', '3'], dataIndex: ['departTree', '3'],
width: 180, width: 180,
}, },
{
title: '非关爱人员',
align: 'center',
dataIndex: ['extension', 'nonCareFlag'],
width: 100,
slots: { customRender: 'nonCareTag' },
},
{ {
title: '出生日期', title: '出生日期',
align: 'center', align: 'center',
@@ -160,6 +167,17 @@ export const searchFormSchema: FormSchema[] = [
field: 'phone', field: 'phone',
component: 'Input', component: 'Input',
}, },
{
label: '非关爱人员',
field: 'nonCareFlag',
component: 'Select',
componentProps: {
options: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
},
},
{ {
label: '单位名称', label: '单位名称',
field: 'orgCode', field: 'orgCode',
@@ -676,28 +694,44 @@ export const formSchema: (isUpdate: boolean) => FormSchema[] = (isUpdate) => {
label: '关爱联络员姓名', label: '关爱联络员姓名',
field: 'careLiaisonName', field: 'careLiaisonName',
component: 'Input', component: 'Input',
show: false,
}, },
{ {
label: '关爱联络员职务', label: '关爱联络员职务',
field: 'careLiaisonJob', field: 'careLiaisonJob',
component: 'Input', component: 'Input',
show: false,
}, },
{ {
label: '关爱联络员电话', label: '关爱联络员电话',
field: 'careLiaisonPhone', field: 'careLiaisonPhone',
component: 'Input', component: 'Input',
rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }], rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
show: false,
}, },
{ {
label: '急救人员姓名', label: '急救人员姓名',
field: 'lifeguardName', field: 'lifeguardName',
component: 'Input', component: 'Input',
show: false,
}, },
{ {
label: '急救人员电话', label: '急救人员电话',
field: 'lifeguardPhone', field: 'lifeguardPhone',
component: 'Input', component: 'Input',
rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }], rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
show: false,
},
{
label: '非关爱人员',
field: 'nonCareFlag',
component: 'RadioButtonGroup',
componentProps: {
options: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
},
}, },
{ {
label: '', label: '',
@@ -109,6 +109,10 @@
{{ record.status_dictText }} {{ record.status_dictText }}
</Tag> </Tag>
</template> </template>
<template #nonCareTag="{ record }">
<Tag v-if="record.extension?.nonCareFlag === 1" color="orange"></Tag>
<Tag v-else-if="record.extension?.nonCareFlag === 0" color="blue"></Tag>
</template>
</BasicTable> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->
<HealthUserEmployeeExDrawer :showFooter="showFooter" @register="registerDrawer" @success="handleSuccess" /> <HealthUserEmployeeExDrawer :showFooter="showFooter" @register="registerDrawer" @success="handleSuccess" />