Files
admin-vben5/apps/web-antd/src/views/property/electricEnergy/elctricityCost/data.ts

306 lines
5.6 KiB
TypeScript
Raw Normal View History

2025-07-27 16:55:48 +08:00
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import dayjs from 'dayjs';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
componentProps: {
options: getDictOptions('pro_qoq_type'),
},
fieldName: 'date',
label: '日期',
defaultValue: '0',
},
{
component: 'DatePicker',
componentProps: (formData) => {
const type: 0 | 1 | 2 | 3 = formData.date ?? 0;
const today = dayjs();
const propsMap = {
0: {
picker: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
showTime: false,
defaultValue: today.format('YYYY-MM-DD'),
},
1: {
picker: 'week',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
showTime: false,
defaultValue: today.startOf('week').format('YYYY-MM-DD'),
},
2: {
picker: 'month',
format: 'YYYY-MM',
valueFormat: 'YYYY-MM',
showTime: false,
defaultValue: today.format('YYYY-MM'),
},
3: {
picker: 'year',
format: 'YYYY',
valueFormat: 'YYYY',
showTime: false,
defaultValue: today.format('YYYY'),
},
};
return propsMap[type];
},
fieldName: 'chioceDate',
dependencies: {
triggerFields: ['date'],
},
},
];
export const columns: VxeGridProps['columns'] = [
{
title: '名称',
fixed: 'left',
width: 'auto',
field: 'roomNumber',
},
{
title: '00',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
]
},
{
title: '01',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '02',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '03',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '04',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '05',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '06',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '07',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '08',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '09',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '10',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '11',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '12',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
{
title: '合计',
width: 'auto',
field: 'roomNumber',
children: [
{
title: '用能(kw.h)',
width: 'auto',
field: 'roomNumber',
},
{
title: '费用(元)',
width: 'auto',
field: 'roomNumber',
}
],
},
];