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 @@
@@ -20,6 +21,43 @@ import convertedChart from './components/converted-chart.vue'
import rank from './components/rank.vue'
import clueStatusPie from './components/clue-status-pie.vue'
// import convertedLineChart from './components/converted-line-chart.vue'
+import searchForm from './components/search-form.vue'
+import { getCurDate } from '@/utils/util'
+
+export interface IForm {
+ organizationId: number | null
+ createTimeStart: string
+ createTimeEnd: string
+ userId: string
+}
+const initialVal = ref()
+const form = ref({
+ organizationId: null,
+ createTimeStart: getCurDate('start'),
+ createTimeEnd: getCurDate('end'),
+ userId: ''
+})
+const clueStatusPieRef = ref>()
+const coversionProcessChartRef = ref>()
+const dataOverviewRef = ref>()
+const resetPage = () => {
+ fetchAllData(initialVal.value)
+}
+const resetParams = () => {
+ form.value = {
+ organizationId: initialVal.value,
+ createTimeStart: getCurDate('start').toString(),
+ createTimeEnd: getCurDate('end').toString(),
+ userId: ''
+ }
+ fetchAllData(initialVal.value)
+}
+const fetchAllData = (defaultValue?: number) => {
+ initialVal.value = defaultValue ?? null
+ dataOverviewRef.value?.fetchData(form.value)
+ coversionProcessChartRef.value?.fetchData(form.value)
+ clueStatusPieRef.value?.fetchData(form.value)
+}