From c57cc282fbcae661ec610f7136784e96732cf884 Mon Sep 17 00:00:00 2001 From: kaeery <3491123437@qq.com> Date: Wed, 5 Mar 2025 19:15:57 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8B=9B=E7=94=9F=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E3=80=91=20=E6=96=B0=E5=A2=9E#=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=EF=BC=9A=E5=AF=B9=E6=8E=A5=E6=95=B0=E6=8D=AE=E7=AE=80?= =?UTF-8?q?=E6=8A=A5=E3=80=81=E7=BA=BF=E7=B4=A2=E8=BD=AC=E5=8C=96=E6=83=85?= =?UTF-8?q?=E5=86=B5=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workbench/index.ts | 26 ++++ src/utils/util.ts | 73 +++++++++- .../workbench/components/clue-status-pie.vue | 55 ++++++-- .../components/conversion-process-chart.vue | 73 ++++++++-- .../workbench/components/data-overview.vue | 40 ++++-- .../workbench/components/search-form.vue | 129 ++++++++++++++++++ src/views/workbench/index.vue | 44 +++++- 7 files changed, 405 insertions(+), 35 deletions(-) create mode 100644 src/api/workbench/index.ts create mode 100644 src/views/workbench/components/search-form.vue diff --git a/src/api/workbench/index.ts b/src/api/workbench/index.ts new file mode 100644 index 0000000..3dab7e8 --- /dev/null +++ b/src/api/workbench/index.ts @@ -0,0 +1,26 @@ +import request from '@/utils/request' + +// 数据简报 +export function dataOverviewApi(params?: any) { + return request.get({ url: '/control/dataPresentation', params }) +} +// 线索转客户统计 +export function convertProcessApi(params?: any) { + return request.get({ url: '/control/leadToCustomerStatistics', params }) +} +// 线索转化情况统计 +export function clueStatusApi(params?: any) { + return request.get({ url: '/control/clueStatistics', params }) +} +// 获取所有组织以及人员信息 +export function allUserListApi(params?: any) { + return request.get({ url: '/organization/getAllChildOrgInfo', params }) +} +// 获取所有团队 +export function allTeamListApi(params?: any) { + return request.get({ url: '/organization/getAllGroup', params }) +} +// 获取所有组织 +export function allOrgListApi(params?: any) { + return request.get({ url: '/organization/getAllOrg', params }) +} diff --git a/src/utils/util.ts b/src/utils/util.ts index 33370c5..3acfc48 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -1,5 +1,5 @@ import { isObject } from '@vue/shared' -import { ElMessage, type messageType } from 'element-plus' +import { ElMessage, dayjs, type messageType } from 'element-plus' import { cloneDeep } from 'lodash' import { isArray } from './is' import type { FieldNamesProps } from '@/components/ProTable/interface' @@ -326,3 +326,74 @@ export function findItemNested(enumData: any, callValue: any, value: string, chi if (current[children]) return findItemNested(current[children], callValue, value, children) }, null) } +export const shortcuts = [ + { + text: '今天', + value: () => { + const start = new Date() + const end = new Date() + start.setHours(0, 0, 0, 0) + end.setHours(23, 59, 59, 999) + return [start, end] + } + }, + { + text: '一周后', + value: () => { + const start = new Date() + const end = new Date() + end.setDate(end.getDate() + 7) + start.setHours(0, 0, 0, 0) + end.setHours(23, 59, 59, 999) + return [start, end] + } + }, + { + text: '一个月后', + value: () => { + const start = new Date() + const end = new Date() + end.setMonth(end.getMonth() + 1) + start.setHours(0, 0, 0, 0) + end.setHours(23, 59, 59, 999) + return [start, end] + } + }, + { + text: '三个月后', + value: () => { + const start = new Date() + const end = new Date() + end.setMonth(end.getMonth() + 3) + start.setHours(0, 0, 0, 0) + end.setHours(23, 59, 59, 999) + return [start, end] + } + }, + { + text: '半年后', + value: () => { + const start = new Date() + const end = new Date() + end.setMonth(end.getMonth() + 6) + start.setHours(0, 0, 0, 0) + end.setHours(23, 59, 59, 999) + return [start, end] + } + }, + { + text: '一年后', + value: () => { + const start = new Date() + const end = new Date() + end.setFullYear(end.getFullYear() + 1) + start.setHours(0, 0, 0, 0) + end.setHours(23, 59, 59, 999) + return [start, end] + } + } +] +// 今天 +export const getCurDate = (type: string, format = 'YYYY-MM-DD HH:mm:ss') => { + return type == 'start' ? dayjs().startOf('day').format(format) : dayjs().endOf('day').format(format) +} diff --git a/src/views/workbench/components/clue-status-pie.vue b/src/views/workbench/components/clue-status-pie.vue index e679b25..5f57146 100644 --- a/src/views/workbench/components/clue-status-pie.vue +++ b/src/views/workbench/components/clue-status-pie.vue @@ -1,24 +1,19 @@ diff --git a/src/views/workbench/components/conversion-process-chart.vue b/src/views/workbench/components/conversion-process-chart.vue index ed1d145..96fc945 100644 --- a/src/views/workbench/components/conversion-process-chart.vue +++ b/src/views/workbench/components/conversion-process-chart.vue @@ -1,18 +1,16 @@ diff --git a/src/views/workbench/components/search-form.vue b/src/views/workbench/components/search-form.vue new file mode 100644 index 0000000..a6b74db --- /dev/null +++ b/src/views/workbench/components/search-form.vue @@ -0,0 +1,129 @@ + + + + diff --git a/src/views/workbench/index.vue b/src/views/workbench/index.vue index 2c84ade..3019684 100644 --- a/src/views/workbench/index.vue +++ b/src/views/workbench/index.vue @@ -1,13 +1,14 @@