diff --git a/src/api/admin.ts b/src/api/admin.ts index e5ce475..da65ad9 100644 --- a/src/api/admin.ts +++ b/src/api/admin.ts @@ -41,3 +41,7 @@ export function convertedSuccessApi(params?: any) { export function rankListApi(params?: any) { return request.get({ url: '/control/top', data: params }) } +// 排名榜查看更多 +export function rankMoreListApi(params?: any) { + return request.get({ url: '/control/topAll', data: params }) +} diff --git a/src/bundle/pages/rank-list/index.vue b/src/bundle/pages/rank-list/index.vue index e9bb8fb..4cb9aed 100644 --- a/src/bundle/pages/rank-list/index.vue +++ b/src/bundle/pages/rank-list/index.vue @@ -17,6 +17,7 @@ lineColor="#0E66FB" @change="handleChangeTab" > + + diff --git a/src/components/widgets/admin/filter-value.vue b/src/components/widgets/admin/filter-value.vue index 8008502..973fdec 100644 --- a/src/components/widgets/admin/filter-value.vue +++ b/src/components/widgets/admin/filter-value.vue @@ -13,7 +13,10 @@ @@ -31,7 +34,7 @@ const formMap: Record = { createTimeRange: '日期' }, [AdminTabEnum.PERSONALLY]: { - postId: '组织', + postId: '岗位', userId: '用户', createTimeRange: '日期' } @@ -44,6 +47,10 @@ const props = defineProps({ activeTab: { type: Number as PropType, default: AdminTabEnum.TEAM + }, + organizationList: { + type: Array as PropType, + default: () => [] } }) const filteredForm = computed(() => { @@ -66,5 +73,30 @@ const parseLabel = computed(() => (key: string) => { const { activeTab } = props return formMap[activeTab][key] }) +// 根据组织id查找对应的节点 +const findNodeById = (nodes: any[], id: number, key = 'id'): any | undefined => { + for (const node of nodes) { + if (node[key] === id) { + return node + } + if (node.children && node.children.length > 0) { + const foundNode = findNodeById(node.children, id) + if (foundNode) { + return foundNode + } + } + } + return undefined +} +const findTargetNode = computed(() => (id: number) => { + const nodeInfo = findNodeById(props.organizationList, id) + if (nodeInfo && nodeInfo.pid) { + const parentNode = findNodeById(props.organizationList, nodeInfo.pid, 'pid') + if (parentNode) { + return `${parentNode.name}-${nodeInfo.name}` + } + } + return nodeInfo?.name || '' +}) diff --git a/src/components/widgets/admin/team/components/clue-status.vue b/src/components/widgets/admin/team/components/clue-status.vue index f457222..b0748c6 100644 --- a/src/components/widgets/admin/team/components/clue-status.vue +++ b/src/components/widgets/admin/team/components/clue-status.vue @@ -23,7 +23,7 @@ :showText="false" > - {{ item.value + '%' }} + {{ item.value + '%' }} @@ -59,7 +59,7 @@ const fetchData = async (payload: IForm) => { data.value = Object.keys(dataMap).map(item => { return { label: dataMap[item], - value: result[item] || 0 + value: result[item] * 100 || 0 } }) console.log(data.value) diff --git a/src/components/widgets/admin/team/components/rank.vue b/src/components/widgets/admin/team/components/rank.vue index 2f84568..ef647f8 100644 --- a/src/components/widgets/admin/team/components/rank.vue +++ b/src/components/widgets/admin/team/components/rank.vue @@ -1,6 +1,6 @@ - diff --git a/src/components/widgets/admin/team/index.vue b/src/components/widgets/admin/team/index.vue index b92ae92..0c8a966 100644 --- a/src/components/widgets/admin/team/index.vue +++ b/src/components/widgets/admin/team/index.vue @@ -1,22 +1,38 @@ diff --git a/src/hooks/useCommon.ts b/src/hooks/useCommon.ts index 9094c15..c65f4a3 100644 --- a/src/hooks/useCommon.ts +++ b/src/hooks/useCommon.ts @@ -51,6 +51,7 @@ export function useRank({ width, callback }: { width: number; callback?: () => v background: styleMap[row] } }) + const queryParams = ref() const handleChangeTab = item => { activeTab.value = item.id @@ -83,7 +84,9 @@ export function useRank({ width, callback }: { width: number; callback?: () => v } // 获取每一个岗位前5名 const fetchData = async (payload: IForm) => { + queryParams.value = payload if (!tabs.value.length) await fetchTabs() + data.value = [] try { loading.value = true const newPayload = { @@ -104,6 +107,7 @@ export function useRank({ width, callback }: { width: number; callback?: () => v tabs, data, loading, + queryParams, handleChangeTab } }