From ee4cd359275a46f1cf9b05fd10035ef5ce448199 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Mon, 17 Aug 2026 19:52:04 +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 | 2 + .../components/CustomerAuditLogsPanel.vue | 6 +- src/modules/audit/presentation.test.ts | 14 +++ src/modules/audit/presentation.ts | 22 ++++ .../pages/DownloadCenterView.test.ts | 5 +- .../downloads/pages/DownloadCenterView.vue | 6 +- .../carrier-rates/pages/CarrierRatesView.vue | 10 +- .../fee-items/pages/FeeItemsView.test.ts | 1 + src/modules/fee-items/pages/FeeItemsView.vue | 6 +- src/modules/finance/api/finance.test.ts | 25 ++++- src/modules/finance/api/finance.ts | 78 ++++++++++--- .../pages/FinanceCustomerAccountsView.test.ts | 15 ++- .../pages/FinanceCustomerAccountsView.vue | 6 + .../pages/FinanceCustomerArapView.test.ts | 43 ++++--- .../finance/pages/FinanceCustomerArapView.vue | 69 ++++++++---- .../FinanceCustomerStatementsView.test.ts | 24 ++-- .../pages/FinanceCustomerStatementsView.vue | 86 +++++++------- .../FinanceFormalSettlementFields.test.ts | 64 +++++++++++ .../pages/FinanceFormalSettlementPage.vue | 65 ++++++++--- src/modules/finance/types.ts | 106 +++++++++++++++--- src/modules/iam/api/platformIam.test.ts | 1 + src/modules/iam/api/platformIam.ts | 1 + src/modules/iam/pages/PermissionsView.test.ts | 5 +- src/modules/iam/pages/PermissionsView.vue | 6 +- src/modules/iam/pages/RolesView.test.ts | 13 +-- src/modules/iam/pages/RolesView.vue | 19 +--- .../components/LoadingListDetailDrawer.vue | 18 ++- .../components/LoadingListsView.test.ts | 30 +++++ .../notifications/notifications.test.ts | 4 + .../pages/MessageManagementView.vue | 5 +- .../notifications/presentation.test.ts | 16 +++ src/modules/notifications/presentation.ts | 39 +++++++ .../pages/OceanBookingDetailView.test.ts | 4 +- .../pages/OceanBookingsView.test.ts | 3 +- .../pages/OceanBookingsView.vue | 1 + .../pages/TruckAppointmentsView.test.ts | 10 +- .../trucking/pages/TruckAppointmentsView.vue | 8 ++ .../unified-orders/api/unifiedOrders.test.ts | 4 +- .../unified-orders/api/unifiedOrders.ts | 34 +++--- .../pages/UnifiedOrdersView.test.ts | 21 +++- .../pages/UnifiedOrdersView.vue | 21 +++- .../warehouses/pages/WarehousesView.vue | 12 +- 42 files changed, 702 insertions(+), 226 deletions(-) create mode 100644 src/modules/audit/presentation.test.ts create mode 100644 src/modules/audit/presentation.ts create mode 100644 src/modules/finance/pages/FinanceFormalSettlementFields.test.ts create mode 100644 src/modules/notifications/presentation.test.ts create mode 100644 src/modules/notifications/presentation.ts diff --git a/src/modules/audit/components/CustomerAuditLogsPanel.test.ts b/src/modules/audit/components/CustomerAuditLogsPanel.test.ts index f74f1dd8..64a26464 100644 --- a/src/modules/audit/components/CustomerAuditLogsPanel.test.ts +++ b/src/modules/audit/components/CustomerAuditLogsPanel.test.ts @@ -27,6 +27,8 @@ describe('CustomerAuditLogsPanel', () => { expect(listPlatformAuditLogs).toHaveBeenCalledWith({ accountId: '8', page: 1, size: 20 }) expect(wrapper.text()).toContain('编辑客户') expect(wrapper.text()).toContain('127.0.0.1') + expect(wrapper.text()).toContain('编辑客户档案') + expect(wrapper.text()).not.toContain('PLATFORM_TENANT_UPDATE') }) it('shows the server total instead of the current page row count', async () => { diff --git a/src/modules/audit/components/CustomerAuditLogsPanel.vue b/src/modules/audit/components/CustomerAuditLogsPanel.vue index d522ddcf..d4c8d83b 100644 --- a/src/modules/audit/components/CustomerAuditLogsPanel.vue +++ b/src/modules/audit/components/CustomerAuditLogsPanel.vue @@ -9,6 +9,7 @@ import DataTable, { type DataTableColumn } from '@/shared/components/DataTable.v import LoadErrorState from '@/shared/components/LoadErrorState.vue' import QueryToolbar, { type QueryField, type QueryModel } from '@/shared/components/QueryToolbar.vue' import { getPlatformAuditLog, listPlatformAuditLogs, type PlatformAuditLogDetail, type PlatformAuditLogListItem, type PlatformAuditLogQuery } from '../api/platformAudit' +import { auditEventLabel } from '../presentation' const props = defineProps<{ customerId: string; customerName: string }>() const access = useAccessPreviewStore() @@ -37,7 +38,7 @@ const columns: DataTableColumn[] = [ { key: 'actions', label: '操作', width: 92, fixed: 'left', slotName: 'actions' }, { key: 'description', label: '操作内容', minWidth: 190, slotName: 'description' }, { key: 'clientIp', label: 'IP 地址', width: 140, slotName: 'clientIp' }, - { key: 'eventType', prop: 'eventType', label: '事件类型', minWidth: 220 }, + { key: 'eventType', label: '事件类型', minWidth: 220, slotName: 'eventType' }, { key: 'username', label: '操作人', width: 140, slotName: 'username' }, { key: 'serviceName', label: '来源服务', width: 150, slotName: 'serviceName' }, { key: 'success', label: '结果', width: 90, slotName: 'success' }, @@ -134,6 +135,7 @@ watch([page, pageSize], ([nextPage, nextSize], [previousPage, previousSize]) => + @@ -148,7 +150,7 @@ watch([page, pageSize], ([nextPage, nextSize], [previousPage, previousSize]) => {{ display(detail.description) }}{{ detail.success ? '成功' : '失败' }} {{ display(detail.username) }}{{ formatDate(detail.occurredAt) }} - {{ detail.eventType }}{{ detail.resourceType }} / {{ display(detail.resourceId) }} + {{ auditEventLabel(detail.eventType) }}{{ detail.resourceType }} / {{ display(detail.resourceId) }} {{ display(detail.httpMethod) }} {{ display(detail.requestUri) }}{{ detail.durationMs == null ? '—' : `${detail.durationMs} ms` }} {{ display(detail.serviceName) }}{{ display(detail.requestId) }} {{ display(detail.errorMessage || detail.errorCode) }} diff --git a/src/modules/audit/presentation.test.ts b/src/modules/audit/presentation.test.ts new file mode 100644 index 00000000..5801e0b5 --- /dev/null +++ b/src/modules/audit/presentation.test.ts @@ -0,0 +1,14 @@ +import { describe, expect, it } from 'vitest' +import { auditEventLabel } from './presentation' + +describe('audit event presentation', () => { + it('uses customer-facing labels for known event codes', () => { + expect(auditEventLabel('PLATFORM_TENANT_UPDATE')).toBe('编辑客户档案') + expect(auditEventLabel('TENANT_REVIEW')).toBe('客户入驻审核') + }) + + it('keeps unknown event codes visible for diagnosis', () => { + expect(auditEventLabel('FUTURE_CUSTOMER_EVENT')).toBe('FUTURE_CUSTOMER_EVENT') + expect(auditEventLabel('')).toBe('—') + }) +}) diff --git a/src/modules/audit/presentation.ts b/src/modules/audit/presentation.ts new file mode 100644 index 00000000..323fe16d --- /dev/null +++ b/src/modules/audit/presentation.ts @@ -0,0 +1,22 @@ +const auditEventLabels: Record = { + TENANT_REGISTER: '客户注册', + TENANT_REVIEW: '客户入驻审核', + PLATFORM_TENANT_UPDATE: '编辑客户档案', + PLATFORM_TENANT_STATUS_CHANGE: '启停客户', + PLATFORM_TENANT_SUBMIT_REVIEW: '提交客户审核', + TENANT_PROFILE_UPDATE: '编辑企业资料', + PLATFORM_CUSTOMER_ARCHIVE: '归档客户', + PLATFORM_CUSTOMER_OWNER_PASSWORD_RESET: '重置企业管理员密码', + PLATFORM_CUSTOMER_IMPERSONATION_TICKET_CREATE: '创建客户代登录授权', + TENANT_ADDRESS_CREATE: '新增客户地址', + TENANT_QUALIFICATION_UPLOAD: '上传企业资质', + PLATFORM_TENANT_QUALIFICATION_UPLOAD: '平台上传企业资质', + TENANT_REQUIRED_QUALIFICATION_PACKAGE_UPLOAD: '上传必填资质包', + PLATFORM_REQUIRED_QUALIFICATION_PACKAGE_UPLOAD: '平台上传必填资质包', +} + +export function auditEventLabel(value?: string | null) { + const code = value?.trim() + if (!code) return '—' + return auditEventLabels[code] ?? code +} diff --git a/src/modules/downloads/pages/DownloadCenterView.test.ts b/src/modules/downloads/pages/DownloadCenterView.test.ts index c60865a7..209075d2 100644 --- a/src/modules/downloads/pages/DownloadCenterView.test.ts +++ b/src/modules/downloads/pages/DownloadCenterView.test.ts @@ -68,8 +68,9 @@ describe('DownloadCenterView', () => { expect(document.body.textContent).toContain('客户列表') expect(document.querySelector('.data-table')?.textContent).not.toContain('失败原因') - expect(document.querySelector('.data-table')?.textContent).not.toContain('完成时间') - expect(document.querySelector('.data-table')?.textContent).not.toContain('过期时间') + expect(document.querySelector('.data-table')?.textContent).toContain('格式') + expect(document.querySelector('.data-table')?.textContent).toContain('完成时间') + expect(document.querySelector('.data-table')?.textContent).toContain('过期时间') expect(document.querySelector('.failure-cell')).toBeNull() const button = [...document.querySelectorAll('button')].find((item) => item.textContent?.trim() === '下载') button?.click() diff --git a/src/modules/downloads/pages/DownloadCenterView.vue b/src/modules/downloads/pages/DownloadCenterView.vue index 3b9110d5..d1a43321 100644 --- a/src/modules/downloads/pages/DownloadCenterView.vue +++ b/src/modules/downloads/pages/DownloadCenterView.vue @@ -74,11 +74,11 @@ const columns: DataTableColumn[] = [ { key: 'type', label: '任务类型', width: 120, slotName: 'type' }, { key: 'status', label: '状态', width: 110, slotName: 'status' }, { key: 'progress', label: '数据量', width: 120, slotName: 'progress' }, - { key: 'format', prop: 'format', label: '格式', width: 80, defaultVisible: false }, + { key: 'format', prop: 'format', label: '格式', width: 80 }, { key: 'requester', label: '申请人', minWidth: 130, slotName: 'requester' }, { key: 'requestedAt', label: '申请时间', width: 170, slotName: 'requestedAt' }, - { key: 'completedAt', label: '完成时间', width: 170, slotName: 'completedAt', defaultVisible: false }, - { key: 'expiresAt', label: '过期时间', width: 170, slotName: 'expiresAt', defaultVisible: false }, + { key: 'completedAt', label: '完成时间', width: 170, slotName: 'completedAt' }, + { key: 'expiresAt', label: '过期时间', width: 170, slotName: 'expiresAt' }, ] const hasActiveTasks = computed(() => result.value.records.some((task) => ['PENDING', 'RUNNING'].includes(task.status))) diff --git a/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.vue b/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.vue index 5e9af9ab..60379e53 100644 --- a/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.vue +++ b/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.vue @@ -158,6 +158,7 @@ const selectedChannelRates = computed(() => { const rates = detail.value?.rates || [] return selectedChannelCode.value ? rates.filter((rate) => rate.channelCode === selectedChannelCode.value) : rates }) +const selectedChannel = computed(() => detail.value?.channels.find((channel) => channel.channelCode === selectedChannelCode.value) || null) const mappingBlockingIssueCodes = new Set([ 'ORIGIN_MAPPING_REQUIRED', 'ORIGIN_WAREHOUSE_INVALID', @@ -792,13 +793,20 @@ onMounted(() => { -
{{ priceModelLabel(detail.channels.find((channel) => channel.channelCode === selectedChannelCode)?.priceModel || '') }}表页:{{ detail.channels.find((channel) => channel.channelCode === selectedChannelCode)?.sourceSheetName || '-' }}预计开船:{{ detail.channels.find((channel) => channel.channelCode === selectedChannelCode)?.estimatedDepartureText }}
+
{{ priceModelLabel(selectedChannel?.priceModel || '') }}表页:{{ selectedChannel?.sourceSheetName || '-' }}
+ + + + + + + diff --git a/src/modules/fee-items/pages/FeeItemsView.test.ts b/src/modules/fee-items/pages/FeeItemsView.test.ts index e9bbd273..b0b22c36 100644 --- a/src/modules/fee-items/pages/FeeItemsView.test.ts +++ b/src/modules/fee-items/pages/FeeItemsView.test.ts @@ -118,5 +118,6 @@ describe('FeeItemsView public master data and access', () => { expect(source).not.toContain('pricingMode') expect(source).not.toContain('计价模式') expect(source).not.toContain('固定费用') + for (const label of ['创建人', '创建日期', '更新人', '更新日期']) expect(source).toContain(`label: '${label}'`) }) }) diff --git a/src/modules/fee-items/pages/FeeItemsView.vue b/src/modules/fee-items/pages/FeeItemsView.vue index 5094a8d7..9c4d660e 100644 --- a/src/modules/fee-items/pages/FeeItemsView.vue +++ b/src/modules/fee-items/pages/FeeItemsView.vue @@ -119,7 +119,10 @@ const columns: DataTableColumn[] = [ { key: 'warehouse', label: '仓库', minWidth: 160, slotName: 'warehouse' }, { key: 'allocationFee', label: '分摊费', width: 100, slotName: 'allocationFee' }, { key: 'description', label: '说明', minWidth: 220, slotName: 'description', defaultVisible: false }, - { key: 'updatedAt', label: '更新时间', minWidth: 155, slotName: 'updatedAt', defaultVisible: false }, + { key: 'createdByName', label: '创建人', minWidth: 120, formatter: (row: PlatformFeeItemResource) => row.createdByName || '—' }, + { key: 'createdAt', label: '创建日期', minWidth: 155, formatter: (row: PlatformFeeItemResource) => formatTime(row.createdAt) }, + { key: 'updatedByName', label: '更新人', minWidth: 120, formatter: (row: PlatformFeeItemResource) => row.updatedByName || '—' }, + { key: 'updatedAt', label: '更新日期', minWidth: 155, formatter: (row: PlatformFeeItemResource) => formatTime(row.updatedAt) }, { key: 'status', label: '状态', width: 100, slotName: 'status' }, ] @@ -395,7 +398,6 @@ onMounted(() => { - - + - - +