From 8271f5586d12da73005141d6919b62340f5a8aa5 Mon Sep 17 00:00:00 2001 From: kaeery <3491123437@qq.com> Date: Thu, 6 Mar 2025 20:59:23 +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#=201=E3=80=81=E6=8E=92?= =?UTF-8?q?=E5=90=8D=E6=A6=9C=EF=BC=9A=E6=9F=A5=E7=9C=8B=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=EF=BC=9B2=E3=80=81=E5=B0=81=E8=A3=85=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E4=B8=9A=E5=8A=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workbench/index.ts | 5 + src/components/ProDialog/index.vue | 11 +- src/hooks/useCommon.ts | 60 ++++++- src/views/workbench/components/card.vue | 7 +- .../workbench/components/rank-list-dialog.vue | 162 ++++++++++++++++++ src/views/workbench/components/rank.vue | 55 +++++- .../workbench/components/search-form.vue | 63 ++----- 7 files changed, 301 insertions(+), 62 deletions(-) create mode 100644 src/views/workbench/components/rank-list-dialog.vue diff --git a/src/api/workbench/index.ts b/src/api/workbench/index.ts index 6cf1d12..34bfe7a 100644 --- a/src/api/workbench/index.ts +++ b/src/api/workbench/index.ts @@ -20,6 +20,11 @@ export function rankListApi(params?: any) { export function completedCustomerListApi(params?: any) { return request.get({ url: '/control/transactionCustomerStatistics', params }) } +// 排名榜查看更多 +export function rankMoreListApi(params?: any) { + return request.get({ url: '/control/topAll', params }) +} + // 获取所有组织以及人员信息 export function allUserListApi(params?: any) { return request.get({ url: '/organization/getAllChildOrgInfo', params }) diff --git a/src/components/ProDialog/index.vue b/src/components/ProDialog/index.vue index df98fe6..4e32e53 100644 --- a/src/components/ProDialog/index.vue +++ b/src/components/ProDialog/index.vue @@ -1,9 +1,12 @@ @@ -14,6 +17,12 @@ export interface IParams { width?: string | number data: { [key: string]: any } } +defineProps({ + showConfirmButton: { + type: Boolean, + default: true + } +}) const emit = defineEmits(['handleCancel', 'handleConfirm']) const dialogVisible = ref(false) diff --git a/src/hooks/useCommon.ts b/src/hooks/useCommon.ts index fda7d9b..70a86be 100644 --- a/src/hooks/useCommon.ts +++ b/src/hooks/useCommon.ts @@ -20,6 +20,8 @@ import { applyForEdit } from '@/api/finance/withdraw' import { useCreateModal } from './useCreateModal' import { toast, formatFileSize } from '@/utils/util' import { postLists } from '@/api/account_center/postion' +import { organzationLists } from '@/api/account_center/organization' +import { allUserListApi } from '@/api/workbench' export interface CategoryProp { id: number @@ -312,7 +314,7 @@ export function useUploadMoreAction() { previewPdf } } - +// 岗位数据 export function usePositionData() { const positionOptions = ref([]) const postId = ref() @@ -330,3 +332,59 @@ export function usePositionData() { fetchPostionData } } +// 工作台数据 +export function useWorkbench(callback?: (params: number) => void) { + const organizationList = ref([]) + const userList = ref([]) + const defaultProps = { + label: 'name', + value: 'id' + } + const CascaderProps = { + label: 'name', + value: 'id' + } + + const fetchOrganizationList = async () => { + try { + const result = await organzationLists() + organizationList.value = result ?? [] + if (result.length > 0) callback && callback(result[0].id) + } catch (error) {} + } + const fetchAllUserList = async () => { + try { + const result = await allUserListApi() + const renamedData = renameFields(result) + userList.value = renamedData + } catch (error) {} + } + const renameFields = (data: any[]): any[] => { + return data.map(item => { + const newItem = { ...item } + if (newItem.organizationVoList) { + newItem.children = renameFields(newItem.organizationVoList) + delete newItem.organizationVoList + } + if (newItem.userVos) { + newItem.userVos.forEach(item => { + item.name = item.username + }) + newItem.children = newItem.children ? [...newItem.children, ...newItem.userVos] : newItem.userVos + delete newItem.userVos + } + if (!newItem.children.length) { + newItem.disabled = true + } + return newItem + }) + } + return { + defaultProps, + CascaderProps, + organizationList, + userList, + fetchOrganizationList, + fetchAllUserList + } +} diff --git a/src/views/workbench/components/card.vue b/src/views/workbench/components/card.vue index c40021e..b30a7ec 100644 --- a/src/views/workbench/components/card.vue +++ b/src/views/workbench/components/card.vue @@ -1,7 +1,10 @@