feat:【ele】【crm】statistics 的部分(performance)
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
import type { VbenFormSchema } from '#/adapter/form';
|
import type { VbenFormSchema } from '#/adapter/form';
|
||||||
|
|
||||||
import { useUserStore } from '@vben/stores';
|
import { useUserStore } from '@vben/stores';
|
||||||
import { beginOfDay, endOfDay, formatDateTime, handleTree } from '@vben/utils';
|
import { handleTree } from '@vben/utils';
|
||||||
|
|
||||||
import { getSimpleDeptList } from '#/api/system/dept';
|
import { getSimpleDeptList } from '#/api/system/dept';
|
||||||
import { getSimpleUserList } from '#/api/system/user';
|
import { getSimpleUserList } from '#/api/system/user';
|
||||||
import { getRangePickerDefaultProps } from '#/utils';
|
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
@@ -28,21 +27,15 @@ export const customerSummaryTabs = [
|
|||||||
export function useGridFormSchema(): VbenFormSchema[] {
|
export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
fieldName: 'times',
|
fieldName: 'time',
|
||||||
label: '时间范围',
|
label: '选择年份',
|
||||||
component: 'RangePicker',
|
component: 'DatePicker',
|
||||||
// TODO @AI:这里有问题,只选择年份
|
|
||||||
componentProps: {
|
componentProps: {
|
||||||
...getRangePickerDefaultProps(),
|
|
||||||
presets: {},
|
|
||||||
picker: 'year',
|
picker: 'year',
|
||||||
showTime: false,
|
|
||||||
format: 'YYYY',
|
format: 'YYYY',
|
||||||
|
valueFormat: 'YYYY',
|
||||||
},
|
},
|
||||||
defaultValue: [
|
defaultValue: new Date().getFullYear().toString(),
|
||||||
formatDateTime(beginOfDay(new Date(new Date().getFullYear(), 0, 1))),
|
|
||||||
formatDateTime(endOfDay(new Date(new Date().getFullYear(), 11, 31))),
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'deptId',
|
fieldName: 'deptId',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { onMounted, ref } from 'vue';
|
|||||||
|
|
||||||
import { ContentWrap, Page } from '@vben/common-ui';
|
import { ContentWrap, Page } from '@vben/common-ui';
|
||||||
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
||||||
|
import { beginOfDay, endOfDay, formatDateTime } from '@vben/utils';
|
||||||
|
|
||||||
import { Tabs } from 'ant-design-vue';
|
import { Tabs } from 'ant-design-vue';
|
||||||
|
|
||||||
@@ -68,6 +69,11 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
async function handleTabChange(key: any) {
|
async function handleTabChange(key: any) {
|
||||||
activeTabName.value = key;
|
activeTabName.value = key;
|
||||||
const queryParams = (await formApi.getValues()) as any;
|
const queryParams = (await formApi.getValues()) as any;
|
||||||
|
// 将年份转换为年初和年末的日期时间
|
||||||
|
const selectYear = Number.parseInt(queryParams.time);
|
||||||
|
queryParams.times = [];
|
||||||
|
queryParams.times[0] = formatDateTime(beginOfDay(new Date(selectYear, 0, 1)));
|
||||||
|
queryParams.times[1] = formatDateTime(endOfDay(new Date(selectYear, 11, 31)));
|
||||||
let data: any[] = [];
|
let data: any[] = [];
|
||||||
const columnsData: any[] = [];
|
const columnsData: any[] = [];
|
||||||
let tableData: any[] = [];
|
let tableData: any[] = [];
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import type { VbenFormSchema } from '#/adapter/form';
|
import type { VbenFormSchema } from '#/adapter/form';
|
||||||
|
|
||||||
import { useUserStore } from '@vben/stores';
|
import { useUserStore } from '@vben/stores';
|
||||||
import { beginOfDay, endOfDay, formatDate, handleTree } from '@vben/utils';
|
import { handleTree } from '@vben/utils';
|
||||||
|
|
||||||
import { getSimpleDeptList } from '#/api/system/dept';
|
import { getSimpleDeptList } from '#/api/system/dept';
|
||||||
import { getSimpleUserList } from '#/api/system/user';
|
import { getSimpleUserList } from '#/api/system/user';
|
||||||
import { getRangePickerDefaultProps } from '#/utils';
|
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
@@ -28,26 +27,15 @@ export const customerSummaryTabs = [
|
|||||||
export function useGridFormSchema(): VbenFormSchema[] {
|
export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
fieldName: 'times',
|
fieldName: 'time',
|
||||||
label: '时间范围',
|
label: '选择年份',
|
||||||
component: 'RangePicker',
|
component: 'DatePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
...getRangePickerDefaultProps(),
|
|
||||||
shortcuts: [],
|
|
||||||
// TODO @AI:这里有问题,只选择年份
|
|
||||||
type: 'year',
|
type: 'year',
|
||||||
format: 'YYYY',
|
format: 'YYYY',
|
||||||
|
valueFormat: 'YYYY',
|
||||||
},
|
},
|
||||||
defaultValue: [
|
defaultValue: new Date().getFullYear().toString(),
|
||||||
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',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'deptId',
|
fieldName: 'deptId',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { onMounted, ref } from 'vue';
|
|||||||
|
|
||||||
import { ContentWrap, Page } from '@vben/common-ui';
|
import { ContentWrap, Page } from '@vben/common-ui';
|
||||||
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
||||||
|
import { beginOfDay, endOfDay, formatDate } from '@vben/utils';
|
||||||
|
|
||||||
import { ElTabPane, ElTabs } from 'element-plus';
|
import { ElTabPane, ElTabs } from 'element-plus';
|
||||||
|
|
||||||
@@ -68,6 +69,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
async function handleTabChange(key: any) {
|
async function handleTabChange(key: any) {
|
||||||
activeTabName.value = key;
|
activeTabName.value = key;
|
||||||
const queryParams = (await formApi.getValues()) as any;
|
const queryParams = (await formApi.getValues()) as any;
|
||||||
|
// 将年份转换为年初和年末的日期时间
|
||||||
|
const selectYear = Number.parseInt(queryParams.time);
|
||||||
|
queryParams.times = [];
|
||||||
|
queryParams.times[0] = formatDate(
|
||||||
|
beginOfDay(new Date(selectYear, 0, 1)),
|
||||||
|
'YYYY-MM-DD HH:mm:ss',
|
||||||
|
);
|
||||||
|
queryParams.times[1] = formatDate(
|
||||||
|
endOfDay(new Date(selectYear, 11, 31)),
|
||||||
|
'YYYY-MM-DD HH:mm:ss',
|
||||||
|
);
|
||||||
let data: any[] = [];
|
let data: any[] = [];
|
||||||
const columnsData: any[] = [];
|
const columnsData: any[] = [];
|
||||||
let tableData: any[] = [];
|
let tableData: any[] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user