diff --git a/apps/web-antd/src/views/crm/statistics/customer/data.ts b/apps/web-antd/src/views/crm/statistics/customer/data.ts index ec37c668a..e7ce18634 100644 --- a/apps/web-antd/src/views/crm/statistics/customer/data.ts +++ b/apps/web-antd/src/views/crm/statistics/customer/data.ts @@ -66,7 +66,7 @@ export function useGridFormSchema(): VbenFormSchema[] { defaultValue: [ formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))), formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))), - ] as [Date, Date], + ], }, { fieldName: 'interval', diff --git a/apps/web-antd/src/views/crm/statistics/customer/index.vue b/apps/web-antd/src/views/crm/statistics/customer/index.vue index edf483336..a0c39c4d3 100644 --- a/apps/web-antd/src/views/crm/statistics/customer/index.vue +++ b/apps/web-antd/src/views/crm/statistics/customer/index.vue @@ -25,13 +25,11 @@ const { renderEcharts } = useEcharts(chartRef); const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-antd/src/views/crm/statistics/funnel/data.ts b/apps/web-antd/src/views/crm/statistics/funnel/data.ts index 87668577d..a10d4a42b 100644 --- a/apps/web-antd/src/views/crm/statistics/funnel/data.ts +++ b/apps/web-antd/src/views/crm/statistics/funnel/data.ts @@ -40,7 +40,7 @@ export function useGridFormSchema(): VbenFormSchema[] { defaultValue: [ formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))), formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))), - ] as [Date, Date], + ], }, { fieldName: 'interval', diff --git a/apps/web-antd/src/views/crm/statistics/funnel/index.vue b/apps/web-antd/src/views/crm/statistics/funnel/index.vue index 02cdb4067..72035f28f 100644 --- a/apps/web-antd/src/views/crm/statistics/funnel/index.vue +++ b/apps/web-antd/src/views/crm/statistics/funnel/index.vue @@ -42,13 +42,11 @@ const gridEvents: VxeGridListeners = { }; const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-antd/src/views/crm/statistics/performance/data.ts b/apps/web-antd/src/views/crm/statistics/performance/data.ts index e56c7ebf7..93a15aefd 100644 --- a/apps/web-antd/src/views/crm/statistics/performance/data.ts +++ b/apps/web-antd/src/views/crm/statistics/performance/data.ts @@ -31,17 +31,18 @@ export function useGridFormSchema(): VbenFormSchema[] { fieldName: 'times', label: '时间范围', component: 'RangePicker', + // TODO @AI:这里有问题,只选择年份 componentProps: { ...getRangePickerDefaultProps(), + presets: {}, picker: 'year', showTime: false, format: 'YYYY', - ranges: {}, }, defaultValue: [ formatDateTime(beginOfDay(new Date(new Date().getFullYear(), 0, 1))), formatDateTime(endOfDay(new Date(new Date().getFullYear(), 11, 31))), - ] as [Date, Date], + ], }, { fieldName: 'deptId', diff --git a/apps/web-antd/src/views/crm/statistics/performance/index.vue b/apps/web-antd/src/views/crm/statistics/performance/index.vue index b997f2308..dbbf0bf32 100644 --- a/apps/web-antd/src/views/crm/statistics/performance/index.vue +++ b/apps/web-antd/src/views/crm/statistics/performance/index.vue @@ -29,13 +29,11 @@ const { renderEcharts } = useEcharts(chartRef); const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-antd/src/views/crm/statistics/portrait/data.ts b/apps/web-antd/src/views/crm/statistics/portrait/data.ts index 8eeff969b..23657e933 100644 --- a/apps/web-antd/src/views/crm/statistics/portrait/data.ts +++ b/apps/web-antd/src/views/crm/statistics/portrait/data.ts @@ -39,13 +39,11 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'RangePicker', componentProps: { ...getRangePickerDefaultProps(), - format: 'YYYY-MM-DD', - picker: 'year', }, defaultValue: [ formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))), formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))), - ] as [Date, Date], + ], }, { fieldName: 'deptId', diff --git a/apps/web-antd/src/views/crm/statistics/portrait/index.vue b/apps/web-antd/src/views/crm/statistics/portrait/index.vue index a8e0bcfbb..b75518b6b 100644 --- a/apps/web-antd/src/views/crm/statistics/portrait/index.vue +++ b/apps/web-antd/src/views/crm/statistics/portrait/index.vue @@ -27,13 +27,11 @@ const { renderEcharts: renderRightEcharts } = useEcharts(rightChartRef); const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-antd/src/views/crm/statistics/rank/data.ts b/apps/web-antd/src/views/crm/statistics/rank/data.ts index 84c78a712..fdd7fa04e 100644 --- a/apps/web-antd/src/views/crm/statistics/rank/data.ts +++ b/apps/web-antd/src/views/crm/statistics/rank/data.ts @@ -57,7 +57,7 @@ export function useGridFormSchema(): VbenFormSchema[] { defaultValue: [ formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))), formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))), - ] as [Date, Date], + ], }, { fieldName: 'deptId', diff --git a/apps/web-antd/src/views/crm/statistics/rank/index.vue b/apps/web-antd/src/views/crm/statistics/rank/index.vue index 0d23a3187..9c4bec2a6 100644 --- a/apps/web-antd/src/views/crm/statistics/rank/index.vue +++ b/apps/web-antd/src/views/crm/statistics/rank/index.vue @@ -25,13 +25,11 @@ const { renderEcharts } = useEcharts(chartRef); const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-ele/src/views/crm/statistics/customer/data.ts b/apps/web-ele/src/views/crm/statistics/customer/data.ts index cc091e5ec..e7ce18634 100644 --- a/apps/web-ele/src/views/crm/statistics/customer/data.ts +++ b/apps/web-ele/src/views/crm/statistics/customer/data.ts @@ -8,6 +8,7 @@ import { beginOfDay, endOfDay, erpCalculatePercentage, + formatDateTime, handleTree, } from '@vben/utils'; @@ -63,8 +64,8 @@ export function useGridFormSchema(): VbenFormSchema[] { ...getRangePickerDefaultProps(), }, defaultValue: [ - beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7)), - endOfDay(new Date(Date.now() - 3600 * 1000 * 24)), + formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))), + formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))), ], }, { diff --git a/apps/web-ele/src/views/crm/statistics/customer/index.vue b/apps/web-ele/src/views/crm/statistics/customer/index.vue index 34c5f5ec2..58cf1ef13 100644 --- a/apps/web-ele/src/views/crm/statistics/customer/index.vue +++ b/apps/web-ele/src/views/crm/statistics/customer/index.vue @@ -9,7 +9,7 @@ import { onMounted, ref } from 'vue'; import { ContentWrap, Page } from '@vben/common-ui'; import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; -import { ElTabs, ElTabPane } from 'element-plus'; +import { ElTabPane, ElTabs } from 'element-plus'; import { useVbenForm } from '#/adapter/form'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; @@ -25,13 +25,11 @@ const { renderEcharts } = useEcharts(chartRef); const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-ele/src/views/crm/statistics/funnel/data.ts b/apps/web-ele/src/views/crm/statistics/funnel/data.ts index f1d4aa388..a10d4a42b 100644 --- a/apps/web-ele/src/views/crm/statistics/funnel/data.ts +++ b/apps/web-ele/src/views/crm/statistics/funnel/data.ts @@ -4,7 +4,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; import { useUserStore } from '@vben/stores'; -import { beginOfDay, endOfDay, handleTree } from '@vben/utils'; +import { beginOfDay, endOfDay, formatDateTime, handleTree } from '@vben/utils'; import { getSimpleDeptList } from '#/api/system/dept'; import { getSimpleUserList } from '#/api/system/user'; @@ -38,8 +38,8 @@ export function useGridFormSchema(): VbenFormSchema[] { ...getRangePickerDefaultProps(), }, defaultValue: [ - beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7)), - endOfDay(new Date(Date.now() - 3600 * 1000 * 24)), + formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))), + formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))), ], }, { diff --git a/apps/web-ele/src/views/crm/statistics/funnel/index.vue b/apps/web-ele/src/views/crm/statistics/funnel/index.vue index f4812a2fa..7c11afd29 100644 --- a/apps/web-ele/src/views/crm/statistics/funnel/index.vue +++ b/apps/web-ele/src/views/crm/statistics/funnel/index.vue @@ -12,7 +12,7 @@ import { reactive, ref } from 'vue'; import { ContentWrap, Page } from '@vben/common-ui'; import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; -import { ElButton, ElButtonGroup, ElTabs, ElTabPane } from 'element-plus'; +import { ElButton, ElButtonGroup, ElTabPane, ElTabs } from 'element-plus'; import { useVbenForm } from '#/adapter/form'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; @@ -42,13 +42,11 @@ const gridEvents: VxeGridListeners = { }; const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-ele/src/views/crm/statistics/performance/data.ts b/apps/web-ele/src/views/crm/statistics/performance/data.ts index 10e951665..78eaa7c29 100644 --- a/apps/web-ele/src/views/crm/statistics/performance/data.ts +++ b/apps/web-ele/src/views/crm/statistics/performance/data.ts @@ -1,7 +1,7 @@ import type { VbenFormSchema } from '#/adapter/form'; import { useUserStore } from '@vben/stores'; -import { beginOfDay, endOfDay, handleTree } from '@vben/utils'; +import { beginOfDay, endOfDay, formatDate, handleTree } from '@vben/utils'; import { getSimpleDeptList } from '#/api/system/dept'; import { getSimpleUserList } from '#/api/system/user'; @@ -33,12 +33,20 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'RangePicker', componentProps: { ...getRangePickerDefaultProps(), + shortcuts: [], + // TODO @AI:这里有问题,只选择年份 type: 'year', format: 'YYYY', }, defaultValue: [ - beginOfDay(new Date(new Date().getFullYear(), 0, 1)), - endOfDay(new Date(new Date().getFullYear(), 11, 31)), + formatDate( + beginOfDay(new Date(new Date().getFullYear(), 0, 1)), + 'YYYY-MM-DD HH:mm:ss', + ), + formatDate( + endOfDay(new Date(new Date().getFullYear(), 11, 31)), + 'YYYY-MM-DD HH:mm:ss', + ), ], }, { diff --git a/apps/web-ele/src/views/crm/statistics/performance/index.vue b/apps/web-ele/src/views/crm/statistics/performance/index.vue index 137dcebad..e6434b7ae 100644 --- a/apps/web-ele/src/views/crm/statistics/performance/index.vue +++ b/apps/web-ele/src/views/crm/statistics/performance/index.vue @@ -9,7 +9,7 @@ import { onMounted, ref } from 'vue'; import { ContentWrap, Page } from '@vben/common-ui'; import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; -import { ElTabs, ElTabPane } from 'element-plus'; +import { ElTabPane, ElTabs } from 'element-plus'; import { useVbenForm } from '#/adapter/form'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; @@ -29,13 +29,11 @@ const { renderEcharts } = useEcharts(chartRef); const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-ele/src/views/crm/statistics/portrait/data.ts b/apps/web-ele/src/views/crm/statistics/portrait/data.ts index 519edecd6..23657e933 100644 --- a/apps/web-ele/src/views/crm/statistics/portrait/data.ts +++ b/apps/web-ele/src/views/crm/statistics/portrait/data.ts @@ -3,7 +3,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { DICT_TYPE } from '@vben/constants'; import { useUserStore } from '@vben/stores'; -import { beginOfDay, endOfDay, handleTree } from '@vben/utils'; +import { beginOfDay, endOfDay, formatDateTime, handleTree } from '@vben/utils'; import { getSimpleDeptList } from '#/api/system/dept'; import { getSimpleUserList } from '#/api/system/user'; @@ -39,12 +39,10 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'RangePicker', componentProps: { ...getRangePickerDefaultProps(), - format: 'YYYY-MM-DD', - type: 'year', }, defaultValue: [ - beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7)), - endOfDay(new Date(Date.now() - 3600 * 1000 * 24)), + formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))), + formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))), ], }, { diff --git a/apps/web-ele/src/views/crm/statistics/portrait/index.vue b/apps/web-ele/src/views/crm/statistics/portrait/index.vue index 5e09b1f66..5eed96846 100644 --- a/apps/web-ele/src/views/crm/statistics/portrait/index.vue +++ b/apps/web-ele/src/views/crm/statistics/portrait/index.vue @@ -9,7 +9,7 @@ import { onMounted, ref } from 'vue'; import { ContentWrap, Page } from '@vben/common-ui'; import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; -import { ElTabs, ElTabPane } from 'element-plus'; +import { ElTabPane, ElTabs } from 'element-plus'; import { useVbenForm } from '#/adapter/form'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; @@ -27,13 +27,11 @@ const { renderEcharts: renderRightEcharts } = useEcharts(rightChartRef); const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'), diff --git a/apps/web-ele/src/views/crm/statistics/rank/data.ts b/apps/web-ele/src/views/crm/statistics/rank/data.ts index e07f6042f..fdd7fa04e 100644 --- a/apps/web-ele/src/views/crm/statistics/rank/data.ts +++ b/apps/web-ele/src/views/crm/statistics/rank/data.ts @@ -2,7 +2,7 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { useUserStore } from '@vben/stores'; -import { beginOfDay, endOfDay, handleTree } from '@vben/utils'; +import { beginOfDay, endOfDay, formatDateTime, handleTree } from '@vben/utils'; import { getSimpleDeptList } from '#/api/system/dept'; import { getRangePickerDefaultProps } from '#/utils'; @@ -55,8 +55,8 @@ export function useGridFormSchema(): VbenFormSchema[] { ...getRangePickerDefaultProps(), }, defaultValue: [ - beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7)), - endOfDay(new Date(Date.now() - 3600 * 1000 * 24)), + formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))), + formatDateTime(endOfDay(new Date(Date.now() - 3600 * 1000 * 24))), ], }, { diff --git a/apps/web-ele/src/views/crm/statistics/rank/index.vue b/apps/web-ele/src/views/crm/statistics/rank/index.vue index 964b1db41..8253b2bc7 100644 --- a/apps/web-ele/src/views/crm/statistics/rank/index.vue +++ b/apps/web-ele/src/views/crm/statistics/rank/index.vue @@ -9,7 +9,7 @@ import { onMounted, ref } from 'vue'; import { ContentWrap, Page } from '@vben/common-ui'; import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; -import { ElTabs, ElTabPane } from 'element-plus'; +import { ElTabPane, ElTabs } from 'element-plus'; import { useVbenForm } from '#/adapter/form'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; @@ -25,13 +25,11 @@ const { renderEcharts } = useEcharts(chartRef); const [QueryForm, formApi] = useVbenForm({ commonConfig: { - // 所有表单项 componentProps: { class: 'w-full', }, }, schema: useGridFormSchema(), - // 是否可展开 showCollapseButton: true, submitButtonOptions: { content: $t('common.query'),