From a8e2bac65a1031eea172749e96266dd35dac2c4b Mon Sep 17 00:00:00 2001 From: dk <1260500659@qq.com> Date: Wed, 1 Jul 2026 17:15:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(log=E3=80=81post=E3=80=81user=E3=80=81proj?= =?UTF-8?q?ect=E3=80=81work-report):=20=E6=B7=BB=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=A7=93=E5=90=8D=E5=AD=97=E6=AE=B5=E5=B9=B6=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E5=B2=97=E4=BD=8D=E7=94=A8=E6=88=B7=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20-=20=E5=9C=A8API=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E3=80=81API=E9=94=99=E8=AF=AF=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=B8=AD=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7=E5=A7=93?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA=20-=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=97=A5=E5=BF=97=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=A0=B7=E5=BC=8F=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E8=87=AA=E9=80=82=E5=BA=94=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20-=20=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD=E5=8F=8A?= =?UTF-8?q?=E7=9B=B8=E5=BA=94API=E6=8E=A5=E5=8F=A3=20-=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A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?q?=E7=A7=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/api/system-manage.ts | 45 +++++++++++++++++++ src/typings/api/system-log.d.ts | 2 + .../log-management/api-access-log/index.vue | 10 ++++- .../log-management/api-error-log/index.vue | 10 ++++- src/views/infra/log-management/index.vue | 26 +++++++++-- .../infra/log-management/login-log/index.vue | 2 +- .../log-management/operate-log/index.vue | 2 +- .../work-report/monthly/index.vue | 2 +- .../work-report/project/index.vue | 2 +- .../components/prototype-page-dialog.vue | 5 +++ .../work-report/weekly/index.vue | 2 +- src/views/project/list/index.vue | 4 +- src/views/system/post/index.vue | 22 ++++++++- src/views/system/shared/export.ts | 16 +++++++ src/views/system/user/index.vue | 35 +++++++++++++++ 15 files changed, 172 insertions(+), 13 deletions(-) create mode 100644 src/views/system/shared/export.ts diff --git a/src/service/api/system-manage.ts b/src/service/api/system-manage.ts index 974b1f5..301af6b 100644 --- a/src/service/api/system-manage.ts +++ b/src/service/api/system-manage.ts @@ -18,6 +18,29 @@ const POST_PREFIX = `${SYSTEM_SERVICE_PREFIX}/post`; const ORG_LEADER_PREFIX = `${SYSTEM_SERVICE_PREFIX}/org-leader`; const USER_MANAGEMENT_RELATION_PREFIX = `${SYSTEM_SERVICE_PREFIX}/user-management-relation`; +function appendQueryValue(query: URLSearchParams, key: string, value: unknown) { + if (value === null || value === undefined || value === '') { + return; + } + + if (Array.isArray(value)) { + value.forEach(item => appendQueryValue(query, key, item)); + return; + } + + query.append(key, String(value)); +} + +function buildQuery(params: object = {}) { + const query = new URLSearchParams(); + + Object.entries(params).forEach(([key, value]) => { + appendQueryValue(query, key, value); + }); + + return query.toString(); +} + function createRolePageQuery(params?: Api.SystemManage.RoleSearchParams) { const query = new URLSearchParams(); @@ -469,6 +492,17 @@ export function fetchBatchDeletePost(ids: number[]) { }); } +/** 导出岗位 */ +export function fetchExportPost(params: Api.SystemManage.PostSearchParams) { + const query = buildQuery(params); + + return request({ + url: query ? `${POST_PREFIX}/export-excel?${query}` : `${POST_PREFIX}/export-excel`, + method: 'get', + responseType: 'blob' + }); +} + /** 获取用户简单列表(用于用户选择下拉框) */ export async function fetchGetUserSimpleList() { return request({ @@ -579,6 +613,17 @@ export function fetchBatchDeleteUser(ids: number[]) { }); } +/** 导出用户 */ +export function fetchExportUser(params: Api.SystemManage.UserSearchParams) { + const query = buildQuery(params); + + return request({ + url: query ? `${USER_PREFIX}/export-excel?${query}` : `${USER_PREFIX}/export-excel`, + method: 'get', + responseType: 'blob' + }); +} + /** 获取菜单列表 */ export async function fetchGetMenuList(params?: Api.SystemManage.MenuSearchParams) { const result = await request({ diff --git a/src/typings/api/system-log.d.ts b/src/typings/api/system-log.d.ts index 821e6a3..1841844 100644 --- a/src/typings/api/system-log.d.ts +++ b/src/typings/api/system-log.d.ts @@ -77,6 +77,7 @@ declare namespace Api { id: string; traceId?: string | null; userId: string; + userNickname?: string | null; userType: number; applicationName: string; requestMethod: string; @@ -114,6 +115,7 @@ declare namespace Api { id: string; traceId?: string | null; userId: string; + userNickname?: string | null; userType: number; applicationName: string; requestMethod: string; diff --git a/src/views/infra/log-management/api-access-log/index.vue b/src/views/infra/log-management/api-access-log/index.vue index 9f3789c..ef23cf9 100644 --- a/src/views/infra/log-management/api-access-log/index.vue +++ b/src/views/infra/log-management/api-access-log/index.vue @@ -80,6 +80,7 @@ const detailSections: LogDetailSection[] = [ { title: '业务上下文', fields: [ + { label: '用户姓名', key: 'userNickname' }, { label: '用户编号', key: 'userId' }, { label: '操作模块', key: 'operateModule' }, { label: '操作名', key: 'operateName' }, @@ -114,6 +115,13 @@ const { columns, columnChecks, data, loading, getData, getDataByPage, mobilePagi columns: () => [ { prop: 'index', type: 'index', label: '序号', width: 64 }, { prop: 'applicationName', label: '应用名', minWidth: 140, showOverflowTooltip: true }, + { + prop: 'userNickname', + label: '用户姓名', + minWidth: 120, + showOverflowTooltip: true, + formatter: row => row.userNickname || '--' + }, { prop: 'requestMethod', label: '请求方式', width: 100, align: 'center' }, { prop: 'requestUrl', label: '请求地址', minWidth: 220, showOverflowTooltip: true }, { prop: 'operateModule', label: '操作模块', minWidth: 140, showOverflowTooltip: true }, @@ -182,7 +190,7 @@ async function handleExport() {