From 834382e04b411d62815dfaad1043dc083802026d Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Tue, 18 Aug 2026 09:46:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CustomerAuditLogsPanel.test.ts | 18 ++- .../components/CustomerAuditLogsPanel.vue | 57 +++++---- src/modules/audit/presentation.test.ts | 21 +++- src/modules/audit/presentation.ts | 109 +++++++++++++++++- 4 files changed, 179 insertions(+), 26 deletions(-) diff --git a/src/modules/audit/components/CustomerAuditLogsPanel.test.ts b/src/modules/audit/components/CustomerAuditLogsPanel.test.ts index 64a26464..45c54c40 100644 --- a/src/modules/audit/components/CustomerAuditLogsPanel.test.ts +++ b/src/modules/audit/components/CustomerAuditLogsPanel.test.ts @@ -29,6 +29,17 @@ describe('CustomerAuditLogsPanel', () => { expect(wrapper.text()).toContain('127.0.0.1') expect(wrapper.text()).toContain('编辑客户档案') expect(wrapper.text()).not.toContain('PLATFORM_TENANT_UPDATE') + expect(wrapper.text()).toContain('平台管理员') + expect(wrapper.text()).toContain('客户与权限服务') + }) + + it('shows inbound audit events in Chinese without wrapping technical codes into the table', async () => { + vi.mocked(listPlatformAuditLogs).mockResolvedValue({ records: [{ ...row, eventType: 'INBOUND_MEASURE_APPROVE', description: '测量审核通过', serviceName: 'firstleg-service' }], page: 1, size: 20, total: 1, pages: 1 }) + const wrapper = mountPanel(['platform:audit:list']); await flushPromises() + + expect(wrapper.text()).toContain('入库测量审核通过') + expect(wrapper.text()).toContain('头程履约服务') + expect(wrapper.text()).not.toContain('INBOUND_MEASURE_APPROVE') }) it('shows the server total instead of the current page row count', async () => { @@ -80,12 +91,17 @@ describe('CustomerAuditLogsPanel', () => { }) it('loads detail and formats json snapshots', async () => { - vi.mocked(getPlatformAuditLog).mockResolvedValue({ ...row, httpMethod: 'PUT', requestUri: '/tenants/8', clientIp: '127.0.0.1', durationMs: 12, beforeData: '{"name":"旧名称"}', afterData: '{"name":"新名称"}' }) + vi.mocked(getPlatformAuditLog).mockResolvedValue({ ...row, eventType: 'INBOUND_MEASURE_APPROVE', resourceType: 'INBOUND_MEASUREMENT', serviceName: 'firstleg-service', httpMethod: 'PUT', requestUri: '/tenants/8', clientIp: '127.0.0.1', durationMs: 12, beforeData: '{"name":"旧名称"}', afterData: '{"name":"新名称"}' }) const wrapper = mountPanel(['platform:audit:list']); await flushPromises() await wrapper.get('button[aria-label="查看操作日志1详情"]').trigger('click'); await flushPromises() expect(getPlatformAuditLog).toHaveBeenCalledWith('1') expect(wrapper.text()).toContain('旧名称') expect(wrapper.text()).toContain('新名称') + expect(wrapper.text()).toContain('入库测量审核通过') + expect(wrapper.text()).toContain('入库测量') + expect(wrapper.text()).toContain('头程履约服务') + expect(wrapper.text()).toContain('更新') + expect(wrapper.find('.audit-detail-grid').exists()).toBe(true) }) it('loads the selected audit page', async () => { diff --git a/src/modules/audit/components/CustomerAuditLogsPanel.vue b/src/modules/audit/components/CustomerAuditLogsPanel.vue index d4c8d83b..d7877fdc 100644 --- a/src/modules/audit/components/CustomerAuditLogsPanel.vue +++ b/src/modules/audit/components/CustomerAuditLogsPanel.vue @@ -1,6 +1,6 @@