From 50e95b985a72fcec4a93a2470e9efdfb2620148a Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 02 四月 2026 15:46:09 +0800
Subject: [PATCH] #i18n
---
rsf-design/src/views/system/operation-record/operationRecordPage.helpers.js | 35 ++++++++++++++++++++++-------------
1 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/rsf-design/src/views/system/operation-record/operationRecordPage.helpers.js b/rsf-design/src/views/system/operation-record/operationRecordPage.helpers.js
index fb55e27..b891ab2 100644
--- a/rsf-design/src/views/system/operation-record/operationRecordPage.helpers.js
+++ b/rsf-design/src/views/system/operation-record/operationRecordPage.helpers.js
@@ -1,9 +1,11 @@
const OPERATION_RESULT_META = {
- 1: { text: '鎴愬姛', type: 'success' },
- 0: { text: '澶辫触', type: 'danger' }
+ 1: { textKey: 'pages.system.operationRecord.result.success', fallback: 'Success', type: 'success' },
+ 0: { textKey: 'pages.system.operationRecord.result.failed', fallback: 'Failed', type: 'danger' }
}
-export const OPERATION_RECORD_REPORT_TITLE = '鎿嶄綔鏃ュ織鎶ヨ〃'
+export function getOperationRecordReportTitle(t) {
+ return typeof t === 'function' ? t('pages.system.operationRecord.reportTitle') : 'Operation Record Report'
+}
export function createOperationRecordSearchState() {
return {
@@ -47,7 +49,13 @@
}
export function getOperationResultMeta(value) {
- return OPERATION_RESULT_META[Number(value)] || { text: '-', type: 'info' }
+ return (
+ OPERATION_RESULT_META[Number(value)] || {
+ textKey: 'common.placeholder.empty',
+ fallback: '--',
+ type: 'info'
+ }
+ )
}
export function formatOperationTimestamp(value) {
@@ -83,7 +91,8 @@
userLabel: record['userId$'] || record.userLabel || (record.userId ? String(record.userId) : ''),
timestampText: formatOperationTimestamp(record.timestamp),
createTimeText: record['createTime$'] || record.createTime || '',
- resultText: resultMeta.text,
+ resultTextKey: resultMeta.textKey,
+ resultText: resultMeta.fallback,
resultType: resultMeta.type
}
}
@@ -95,15 +104,15 @@
})
}
-export function getOperationRecordReportColumns() {
+export function getOperationRecordReportColumns(t) {
return [
- { prop: 'namespace', label: '鍚嶇О绌洪棿' },
- { prop: 'url', label: '鎺ュ彛鍦板潃' },
- { prop: 'userLabel', label: '鎿嶄綔鐢ㄦ埛' },
- { prop: 'clientIp', label: '瀹㈡埛绔疘P' },
- { prop: 'spendTimeText', label: '鑰楁椂(ms)' },
- { prop: 'resultText', label: '缁撴灉' },
- { prop: 'timestampText', label: '鎿嶄綔鏃堕棿' }
+ { prop: 'namespace', label: typeof t === 'function' ? t('pages.system.operationRecord.table.namespace') : 'Namespace' },
+ { prop: 'url', label: typeof t === 'function' ? t('pages.system.operationRecord.table.url') : 'API URL' },
+ { prop: 'userLabel', label: typeof t === 'function' ? t('pages.system.operationRecord.table.user') : 'User' },
+ { prop: 'clientIp', label: typeof t === 'function' ? t('pages.system.operationRecord.table.clientIp') : 'Client IP' },
+ { prop: 'spendTimeText', label: typeof t === 'function' ? t('pages.system.operationRecord.table.spendTime') : 'Latency (ms)' },
+ { prop: 'resultText', label: typeof t === 'function' ? t('pages.system.operationRecord.table.result') : 'Result' },
+ { prop: 'timestampText', label: typeof t === 'function' ? t('pages.system.operationRecord.table.timestamp') : 'Operation Time' }
]
}
--
Gitblit v1.9.1