diff --git a/src/components/advanced/table-header-operation.vue b/src/components/advanced/table-header-operation.vue index b5823cfe..b0d49571 100644 --- a/src/components/advanced/table-header-operation.vue +++ b/src/components/advanced/table-header-operation.vue @@ -77,7 +77,7 @@ function handleExport() { - 导出 + {{ $t('common.export') }} diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 29af1761..74b29949 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -12,6 +12,8 @@ const local: App.I18n.Schema = { addSuccess: 'Add Success', backToHome: 'Back to home', batchDelete: 'Batch Delete', + import: 'Import', + export: 'Export', cancel: 'Cancel', close: 'Close', check: 'Check', @@ -45,12 +47,14 @@ const local: App.I18n.Schema = { tip: 'Tip', trigger: 'Trigger', update: 'Update', + saveSuccess: 'Save Success', updateSuccess: 'Update Success', userCenter: 'User Center', yesOrNo: { yes: 'Yes', no: 'No' - } + }, + second: 'Second' }, request: { logout: 'Logout user after request failed', @@ -269,6 +273,71 @@ const local: App.I18n.Schema = { desc5: 'Soybean just wrote some of the workbench pages casually, and it was enough to see!' }, creativity: 'Creativity' + }, + common: { + id: 'ID', + createBy: 'Creator', + createTime: 'Create Time', + updateBy: 'Updater', + updateTime: 'Update Time', + remark: 'Remark', + form: { + remark: { + required: 'Please enter remark', + invalid: 'Remark cannot be empty' + } + } + }, + system: { + client: { + title: 'Client List', + clientId: 'Client ID', + clientKey: 'Client Key', + clientSecret: 'Client Secret', + grantTypeList: 'Grant Type', + deviceType: 'Device Type', + activeTimeout: 'Token Active Timeout', + timeout: 'Token Timeout', + status: 'Status', + form: { + clientId: { + required: 'Please enter Client ID', + invalid: 'Client ID cannot be empty' + }, + clientKey: { + required: 'Please enter Client Key', + invalid: 'Client Key cannot be empty' + }, + clientSecret: { + required: 'Please enter Client Secret', + invalid: 'Client Secret cannot be empty' + }, + grantTypeList: { + required: 'Please select Grant Type', + invalid: 'Grant Type cannot be empty' + }, + deviceType: { + required: 'Please select Device Type', + invalid: 'Device Type cannot be empty' + }, + activeTimeout: { + required: 'Please enter Active Timeout', + invalid: 'Active Timeout cannot be empty', + tooltip: 'Specify time without operation will expire (unit: second), default 30 minutes (1800 seconds)' + }, + timeout: { + required: 'Please enter Timeout', + invalid: 'Timeout cannot be empty', + tooltip: 'Specify time will expire (unit: second), default 7 days (604800 seconds)' + }, + status: { + required: 'Please select Status', + invalid: 'Status cannot be empty' + } + }, + addClient: 'Add Client', + editClient: 'Edit Client' + } } }, form: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 660792d1..8477a84d 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -12,6 +12,8 @@ const local: App.I18n.Schema = { addSuccess: '添加成功', backToHome: '返回首页', batchDelete: '批量删除', + import: '导入', + export: '导出', cancel: '取消', close: '关闭', check: '勾选', @@ -45,12 +47,14 @@ const local: App.I18n.Schema = { tip: '提示', trigger: '触发', update: '更新', + saveSuccess: '保存成功', updateSuccess: '更新成功', userCenter: '个人中心', yesOrNo: { yes: '是', no: '否' - } + }, + second: '秒' }, request: { logout: '请求失败后登出用户', @@ -269,6 +273,71 @@ const local: App.I18n.Schema = { desc5: 'Soybean 刚才把工作台页面随便写了一些,凑合能看了!' }, creativity: '创意' + }, + common: { + id: 'ID', + createBy: '创建者', + createTime: '创建时间', + updateBy: '更新者', + updateTime: '更新时间', + remark: '备注', + form: { + remark: { + required: '请输入备注', + invalid: '备注不能为空' + } + } + }, + system: { + client: { + title: '客户端列表', + clientId: '客户端 ID', + clientKey: '客户端 Key', + clientSecret: '客户端秘钥', + grantTypeList: '授权类型', + deviceType: '设备类型', + activeTimeout: 'Token 活跃超时时间', + timeout: 'Token 固定超时', + status: '状态', + form: { + clientId: { + required: '请输入客户端 ID', + invalid: '客户端 ID 不能为空' + }, + clientKey: { + required: '请输入客户端 Key', + invalid: '客户端 Key 不能为空' + }, + clientSecret: { + required: '请输入客户端秘钥', + invalid: '客户端秘钥不能为空' + }, + grantTypeList: { + required: '请选择授权类型', + invalid: '授权类型不能为空' + }, + deviceType: { + required: '请选择设备类型', + invalid: '设备类型不能为空' + }, + activeTimeout: { + required: '请输入 Token 活跃超时时间', + invalid: 'Token 活跃超时时间不能为空', + tooltip: '指定时间无操作则过期(单位:秒), 默认30分钟(1800秒)' + }, + timeout: { + required: '请输入 Token 固定超时', + invalid: 'Token 固定超时不能为空', + tooltip: '指定时间必定过期(单位:秒),默认七天(604800秒)' + }, + status: { + required: '请选择状态', + invalid: '状态不能为空' + } + }, + addClient: '新增客户端', + editClient: '编辑客户端' + } } }, form: { diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 5bef9891..11fbdb63 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -290,6 +290,7 @@ declare namespace App { type FormMsg = { required: string; invalid: string; + tooltip?: string; }; type Schema = { @@ -306,6 +307,8 @@ declare namespace App { addSuccess: string; backToHome: string; batchDelete: string; + import: string; + export: string; cancel: string; close: string; check: string; @@ -340,11 +343,13 @@ declare namespace App { trigger: string; update: string; updateSuccess: string; + saveSuccess: string; userCenter: string; yesOrNo: { yes: string; no: string; }; + second: string; }; request: { logout: string; @@ -417,6 +422,17 @@ declare namespace App { }; route: Record; page: { + common: { + id: string; + createBy: string; + createTime: string; + updateBy: string; + updateTime: string; + remark: string; + form: { + remark: FormMsg; + }; + }; login: { common: { loginOrRegister: string; @@ -492,6 +508,31 @@ declare namespace App { }; creativity: string; }; + system: { + client: { + title: string; + clientId: string; + clientKey: string; + clientSecret: string; + grantTypeList: string; + deviceType: string; + activeTimeout: string; + timeout: string; + status: string; + form: { + clientId: FormMsg; + clientKey: FormMsg; + clientSecret: FormMsg; + grantTypeList: FormMsg; + deviceType: FormMsg; + activeTimeout: FormMsg; + timeout: FormMsg; + status: FormMsg; + }; + addClient: string; + editClient: string; + }; + }; }; form: { required: string; diff --git a/src/views/system/client/index.vue b/src/views/system/client/index.vue index 2ab0fd8c..223dabee 100644 --- a/src/views/system/client/index.vue +++ b/src/views/system/client/index.vue @@ -15,9 +15,11 @@ import ClientSearch from './modules/client-search.vue'; defineOptions({ name: 'ClientList' }); + useDict('sys_grant_type'); useDict('sys_device_type'); useDict('sys_normal_disable'); + const appStore = useAppStore(); const { download } = useDownload(); const { hasAuth } = useAuth(); @@ -58,25 +60,25 @@ const { }, { key: 'clientId', - title: '客户端id', + title: $t('page.system.client.clientId'), align: 'center', minWidth: 120 }, { key: 'clientKey', - title: '客户端key', + title: $t('page.system.client.clientKey'), align: 'center', minWidth: 120 }, { key: 'clientSecret', - title: '客户端秘钥', + title: $t('page.system.client.clientSecret'), align: 'center', minWidth: 120 }, { key: 'grantTypeList', - title: '授权类型', + title: $t('page.system.client.grantTypeList'), align: 'center', minWidth: 120, render: row => { @@ -85,7 +87,7 @@ const { }, { key: 'deviceType', - title: '设备类型', + title: $t('page.system.client.deviceType'), align: 'center', minWidth: 120, render: row => { @@ -94,25 +96,25 @@ const { }, { key: 'activeTimeout', - title: 'token活跃超时时间', + title: $t('page.system.client.activeTimeout'), align: 'center', minWidth: 120, render: row => { - return `${row.activeTimeout}秒`; + return `${row.activeTimeout}${$t('common.second')}`; } }, { key: 'timeout', - title: 'token固定超时', + title: $t('page.system.client.timeout'), align: 'center', minWidth: 120, render: row => { - return `${row.timeout}秒`; + return `${row.timeout}${$t('common.second')}`; } }, { key: 'status', - title: '状态', + title: $t('page.system.client.status'), align: 'center', minWidth: 120, render: row => { @@ -205,7 +207,7 @@ async function handleExport() {