From ec5a1317d96eeb4136095c063ed634d58c15141a Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 8 Jan 2026 13:58:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E8=AE=A1=E5=B8=88=E7=BB=A9?= =?UTF-8?q?=E6=95=88=E6=8E=92=E8=A1=8C=E6=A6=9C=E5=A2=9E=E5=8A=A0=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/Analytics.vue | 79 +++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Analytics.vue b/frontend/src/views/Analytics.vue index 9aeea1f..bfe82c1 100644 --- a/frontend/src/views/Analytics.vue +++ b/frontend/src/views/Analytics.vue @@ -199,7 +199,23 @@
-

设计师绩效排行榜

+
+

设计师绩效排行榜

+
+ + + {{ dept.deptName }} + + +
+
({ const warningTasks = ref([]) const warningFilter = ref('all') +// 部门筛选 +const selectedDeptId = ref(undefined) +const departmentList = ref([]) + // 图表引用 const trendChartRef = ref() const typeChartRef = ref() @@ -649,7 +670,7 @@ const loadAllData = async () => { // 并行加载所有数据 const [demandData, designerData, efficiencyData, warningsData] = await Promise.all([ getDemandStatistics(dateRange.value, undefined, undefined, month), - getDesignerPerformance(month), + getDesignerPerformance(month, selectedDeptId.value), getProcessEfficiency(month), getWarningTasks() ]) @@ -912,7 +933,44 @@ const exportData = () => { message.success('报表导出成功') } +// 加载接单部门列表 +const loadDepartments = async () => { + try { + const res = await fetchDepartmentOverview() + // 只显示接单部门 + departmentList.value = (res.data || []).filter((d: any) => d.deptType === 'receiving') + } catch (error) { + console.error('加载部门列表失败:', error) + } +} + +// 部门筛选变化 +const handleDeptChange = (deptId: number | undefined) => { + selectedDeptId.value = deptId + loadDesignerData() +} + +// 单独加载设计师绩效数据(用于部门筛选) +const loadDesignerData = async () => { + loading.value = true + try { + const month = selectedMonth.value || undefined + const designerData = await getDesignerPerformance(month, selectedDeptId.value) + Object.assign(designerPerformance, designerData) + await nextTick() + if (activeTab.value === 'designer') { + renderWorkloadChart() + } + } catch (error) { + message.error('加载设计师绩效数据失败') + console.error('加载设计师绩效数据失败:', error) + } finally { + loading.value = false + } +} + onMounted(() => { + loadDepartments() loadAllData() }) @@ -1055,6 +1113,23 @@ onMounted(() => { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); margin-bottom: 24px; + .table-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: $space-lg; + + .chart-title { + margin-bottom: 0; + } + + .filter-bar { + display: flex; + align-items: center; + gap: 12px; + } + } + .chart-title { font-size: $font-size-lg; font-weight: 600;