|
@@ -4,6 +4,7 @@ import { h } from 'vue'
|
|
|
import type { Record } from '@/api'
|
|
|
import type { ColumnsType } from 'ant-design-vue/es/table'
|
|
|
import { ui18n } from '@/lang'
|
|
|
+import logLang from '@/lang/en/log'
|
|
|
|
|
|
export const recordColumns: ColumnsType<Record> = [
|
|
|
// {
|
|
@@ -22,7 +23,20 @@ export const recordColumns: ColumnsType<Record> = [
|
|
|
dataIndex: 'logMsg',
|
|
|
key: 'logMsg',
|
|
|
customRender({ record }) {
|
|
|
- return h(EasyText, { content: record.logMsg, maxLen: 50 })
|
|
|
+ const ndx = record.logMsg.indexOf(':')
|
|
|
+ const keys = Object.keys(logLang)
|
|
|
+ let m: string | null = null
|
|
|
+ let s = record.logMsg
|
|
|
+ for (const key of keys) {
|
|
|
+ const ndx = record.logMsg.indexOf(key)
|
|
|
+ if (ndx === 0) {
|
|
|
+ s = record.logMsg.substring(key.length)
|
|
|
+ m = key
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const log = m ? ui18n.t(`log.${m}`) + s : s
|
|
|
+
|
|
|
+ return h(EasyText, { content: log, maxLen: 50 })
|
|
|
}
|
|
|
},
|
|
|
{
|