From b72e957da24b0c9e413b7c3322435c35e24e870a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Thu, 10 Sep 2026 11:44:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(management):=20=E5=91=98=E5=B7=A5=E6=80=BB?= =?UTF-8?q?=E8=A7=88=E9=A1=B5=E2=80=94=E2=80=94=E5=9B=9B=E8=A7=86=E5=9B=BE?= =?UTF-8?q?/=E6=9C=8D=E5=8A=A1=E7=AB=AF=E6=8E=92=E5=BA=8F=E5=88=86?= =?UTF-8?q?=E9=A1=B5/=E5=AF=B9=E6=AF=94=E6=8A=BD=E5=B1=89/CSV=E5=8F=A3?= =?UTF-8?q?=E5=BE=84=E6=B3=A8=E9=87=8A=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- .../management/EmployeeCompareDrawer.vue | 169 +++++ yunkes/src/layouts/MainLayout.vue | 3 + yunkes/src/router/index.ts | 8 + yunkes/src/utils/csvExport.ts | 13 +- .../management/EmployeeAnalyticsView.vue | 718 ++++++++++++++++++ 5 files changed, 909 insertions(+), 2 deletions(-) create mode 100644 yunkes/src/components/management/EmployeeCompareDrawer.vue create mode 100644 yunkes/src/views/management/EmployeeAnalyticsView.vue diff --git a/yunkes/src/components/management/EmployeeCompareDrawer.vue b/yunkes/src/components/management/EmployeeCompareDrawer.vue new file mode 100644 index 0000000..6dbe89e --- /dev/null +++ b/yunkes/src/components/management/EmployeeCompareDrawer.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/yunkes/src/layouts/MainLayout.vue b/yunkes/src/layouts/MainLayout.vue index f6dd5f4..6f1c496 100644 --- a/yunkes/src/layouts/MainLayout.vue +++ b/yunkes/src/layouts/MainLayout.vue @@ -107,6 +107,9 @@ function logout(): void { 管理驾驶舱 + + 员工分析 + diff --git a/yunkes/src/router/index.ts b/yunkes/src/router/index.ts index 0befb89..27888d6 100644 --- a/yunkes/src/router/index.ts +++ b/yunkes/src/router/index.ts @@ -99,6 +99,14 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/views/management/ManagementDashboardView.vue'), meta: { title: '管理驾驶舱' }, }, + { + // 员工分析(批次D):四视图总览;详情路由 /management/employees/{user_id} + // 由批次D后续任务补挂(D2) + path: '/management/employees', + name: 'management-employees', + component: () => import('@/views/management/EmployeeAnalyticsView.vue'), + meta: { title: '员工分析' }, + }, { path: '/chat/:channel/:ownerId/:talkerId?', name: 'chat', diff --git a/yunkes/src/utils/csvExport.ts b/yunkes/src/utils/csvExport.ts index 8bc92f0..434ce4f 100644 --- a/yunkes/src/utils/csvExport.ts +++ b/yunkes/src/utils/csvExport.ts @@ -10,6 +10,9 @@ * ], * filename: '微信客户列表', * }) + * + * Optional `preamble: string[]` writes comment lines (口径/窗口注释等) before + * the header — each line occupies the first column of its own row. */ export interface CsvColumn { @@ -30,6 +33,12 @@ export interface ExportOptions { pageSize?: number /** Max rows to export (safety cap, default 10000) */ maxRows?: number + /** + * Optional comment lines written before the header row (batch D: management + * employee CSV carries caliber/window notes so the export is self-describing + * outside the app). Each line becomes a single-cell row in the first column. + */ + preamble?: string[] } function escapeCsv(value: string | number | null | undefined): string { @@ -43,7 +52,7 @@ function escapeCsv(value: string | number | null | undefined): string { } export async function exportListToCsv(options: ExportOptions): Promise<{ rows: number; filename: string }> { - const { fetchPage, columns, filename, pageSize = 100, maxRows = 10000 } = options + const { fetchPage, columns, filename, pageSize = 100, maxRows = 10000, preamble } = options // Fetch all pages const allRows: T[] = [] @@ -68,7 +77,7 @@ export async function exportListToCsv(options: ExportOptions): Promise<{ r return escapeCsv(val as string | number | null | undefined) }).join(',') ) - const csv = '' + header + '\n' + lines.join('\n') // BOM for Excel Chinese support + const csv = '' + [...(preamble ?? []).map((p) => escapeCsv(p)), header, ...lines].join('\n') // BOM for Excel Chinese support // Trigger download const blob = new Blob([csv], { type: 'text/csv;charset=utf-8' }) diff --git a/yunkes/src/views/management/EmployeeAnalyticsView.vue b/yunkes/src/views/management/EmployeeAnalyticsView.vue new file mode 100644 index 0000000..3bdad1f --- /dev/null +++ b/yunkes/src/views/management/EmployeeAnalyticsView.vue @@ -0,0 +1,718 @@ + + + + +