diff --git a/apps/web-antd/src/views/property/electricEnergy/elctricityCost/data.ts b/apps/web-antd/src/views/property/electricEnergy/elctricityCost/data.ts new file mode 100644 index 00000000..bd1ba26d --- /dev/null +++ b/apps/web-antd/src/views/property/electricEnergy/elctricityCost/data.ts @@ -0,0 +1,305 @@ +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', + } + ], + }, +]; diff --git a/apps/web-antd/src/views/property/electricEnergy/elctricityCost/index.vue b/apps/web-antd/src/views/property/electricEnergy/elctricityCost/index.vue index 63cf316b..74a3477d 100644 --- a/apps/web-antd/src/views/property/electricEnergy/elctricityCost/index.vue +++ b/apps/web-antd/src/views/property/electricEnergy/elctricityCost/index.vue @@ -1,11 +1,78 @@ diff --git a/apps/web-antd/src/views/property/electricEnergy/electricTrend/index.vue b/apps/web-antd/src/views/property/electricEnergy/electricTrend/index.vue index 7f6fa54e..e798f2bc 100644 --- a/apps/web-antd/src/views/property/electricEnergy/electricTrend/index.vue +++ b/apps/web-antd/src/views/property/electricEnergy/electricTrend/index.vue @@ -4,6 +4,7 @@ import {onMounted, ref} from "vue"; import type { Dayjs } from 'dayjs'; import dayjs from 'dayjs'; import { DatePicker } from 'ant-design-vue'; +import FloorTree from "#/views/property/electricEnergy/elctricitySituation/floor-tree.vue"; const currentDay = ref(dayjs()); const currentMonth = ref(dayjs()); @@ -287,7 +288,7 @@ onMounted(()=>{