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 }) => {
const total = record.totalAssignedDeviceNums ?? 0;
const assigned = record.assignedDeviceNums ?? 0;
return total - assigned;
return Math.max(0, total - assigned);
},
},
{
{
title: '已绑定设备数',
dataIndex: ['assignedDeviceNums'],
customRender: ({ text }) => {
@@ -181,7 +181,15 @@ export const columnsNew: BasicColumn[] = [
customRender: ({ record }) => {
const total = record.totalAssignedDeviceNums ?? 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;
},
},
];
const startTime = dayjs().subtract(6, 'day').format('YYYY-MM-DD');
@@ -376,6 +385,16 @@ export const detailColumns = (arr: BasicColumn[] = []) => {
title: '手表所属单位',
dataIndex: 'watchOrgName',
},
{
title: '非关爱人员',
dataIndex: 'nonCareFlag',
width: 100,
customRender: ({ text }) => {
if (text === 1) return '是';
if (text === 0) return '否';
return '';
},
},
...arr,
{
title: '应佩戴天数',
@@ -85,6 +85,13 @@ export const columns: BasicColumn[] = [
dataIndex: ['departTree', '3'],
width: 180,
},
{
title: '非关爱人员',
align: 'center',
dataIndex: ['extension', 'nonCareFlag'],
width: 100,
slots: { customRender: 'nonCareTag' },
},
{
title: '出生日期',
align: 'center',
@@ -160,6 +167,17 @@ export const searchFormSchema: FormSchema[] = [
field: 'phone',
component: 'Input',
},
{
label: '非关爱人员',
field: 'nonCareFlag',
component: 'Select',
componentProps: {
options: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
},
},
{
label: '单位名称',
field: 'orgCode',
@@ -676,28 +694,44 @@ export const formSchema: (isUpdate: boolean) => FormSchema[] = (isUpdate) => {
label: '关爱联络员姓名',
field: 'careLiaisonName',
component: 'Input',
show: false,
},
{
label: '关爱联络员职务',
field: 'careLiaisonJob',
component: 'Input',
show: false,
},
{
label: '关爱联络员电话',
field: 'careLiaisonPhone',
component: 'Input',
rules: [{ required: false, pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
show: false,
},
{
label: '急救人员姓名',
field: 'lifeguardName',
component: 'Input',
show: false,
},
{
label: '急救人员电话',
field: 'lifeguardPhone',
component: 'Input',
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: '',
@@ -109,6 +109,10 @@
{{ record.status_dictText }}
</Tag>
</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>
<!-- 表单区域 -->
<HealthUserEmployeeExDrawer :showFooter="showFooter" @register="registerDrawer" @success="handleSuccess" />