From e5481638f59598d73f76d935b835805cc207a2ee Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 10 Nov 2023 15:48:41 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=A4=9A=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 27 ++++++ src/i18n/locales/zh-CN.ts | 29 +++++- src/views/system/config/index.vue | 147 +++++++++++++++++++----------- src/views/system/user/index.vue | 18 ++-- 4 files changed, 160 insertions(+), 61 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index e11bcb20..de639ccb 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -598,6 +598,33 @@ export default { loginPwd:'Login password', updateSure:'Do you want to update existing data', downloadObj:'Download Tpl', + importTitle:'User Import', + importOk: 'Successfully read and download imported templates', + tipRowErr: "Failed to get user information", + viewInfoErr: "Errors in user records", + }, + config: { + configName: "Config Name", + configNamePlease: 'Please input the Config Name correctly', + configKey: "Config Key", + configKeyPlease: 'Please enter the Config Key correctly', + configType: "Config Type", + configValue: "Config Value", + configValuePlease: 'Please enter the Config Value correctly', + remark: "Config description", + createTime: "CreateTime", + refreshCache: "Refresh Cache", + viewInfo: "Config Info", + viewInfoErr: "Failed to get Config Info", + addInfo: "Adding Parameter Configuration", + editInfo: "Modify the Config Info", + tipRowErr: "There is an error in the Config Info record", + delTip: "Confirm deleting the data item with parameter number [{num}] ?", + delOk: "Deleted successfully", + exportTip: "Confirm exporting xlsx table files based on search criteria?", + exportOk: "Completed export", + refreshCacheTip: "Are you sure you want to refresh the parameter configuration cache?", + refreshCacheOk: "Refresh Cache Successful", }, setting: { charMaxLen: 'bit character length', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 517ea9e4..9a18766b 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -11,7 +11,7 @@ export default { ipnutPlease: '请输入', selectPlease: '请选择', tipTitle: '提示', - msgSuccess: '{msg}成功 ', + msgSuccess: '{msg} 成功', errorFields: '请正确填写 {num} 处必填信息!', tablePaginationTotal: '总共 {total} 条', zebraL:'表格斑马纹', @@ -598,6 +598,33 @@ export default { loginPwd:'登入密码', updateSure:'是否更新已经存在的数据', downloadObj:'下载模板', + importTitle:'用户导入', + importOk: '成功读取并下载导入模板', + tipRowErr: "获取用户信息失败", + viewInfoErr: "用户记录存在错误", + }, + config: { + configName: "参数名称", + configNamePlease: '请正确输入参数名称', + configKey: "参数键名", + configKeyPlease: '请正确输入参数键名', + configType: "系统内置", + configValue: "参数键值", + configValuePlease: '请正确输入参数键值', + remark: "参数说明", + createTime: "创建时间", + refreshCache: "刷新缓存", + viewInfo: "参数配置信息", + viewInfoErr: "获取参数配置信息失败", + addInfo: "添加参数配置", + editInfo: "修改参数配置", + tipRowErr: "参数配置记录存在错误", + delTip: "确认删除参数编号为 【{num}】 的数据项?", + delOk: "删除成功", + exportTip: "确认根据搜索条件导出xlsx表格文件吗?", + exportOk: "已完成导出", + refreshCacheTip: "确定要刷新参数配置缓存吗?", + refreshCacheOk: "刷新缓存成功", }, setting: { charMaxLen: '位字符长度', diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 8ed4f6ce..c80eab83 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -97,33 +97,33 @@ let tableState: TabeStateType = reactive({ /**表格字段列 */ let tableColumns: ColumnsType = [ { - title: '参数编号', + title: t('common.rowId'), dataIndex: 'configId', align: 'center', }, { - title: '参数名称', + title: t('views.system.config.configName'), dataIndex: 'configName', align: 'center', }, { - title: '参数键名', + title: t('views.system.config.configKey'), dataIndex: 'configKey', align: 'center', }, { - title: '参数键值', + title: t('views.system.config.configValue'), dataIndex: 'configValue', align: 'center', }, { - title: '系统内置', + title: t('views.system.config.configType'), dataIndex: 'configType', key: 'configType', align: 'center', }, { - title: '创建时间', + title: t('views.system.config.createTime'), dataIndex: 'createTime', align: 'center', customRender(opt) { @@ -132,7 +132,7 @@ let tableColumns: ColumnsType = [ }, }, { - title: '操作', + title: t('common.operate'), key: 'configId', align: 'center', }, @@ -156,7 +156,8 @@ let tablePagination = reactive({ showSizeChanger: true, /**数据总数 */ total: 0, - showTotal: (total: number) => `总共 ${total} 条`, + showTotal: (total: number) => + t('common.tablePaginationTotal', { total: total }), onChange: (page: number, pageSize: number) => { tablePagination.current = page; tablePagination.pageSize = pageSize; @@ -216,13 +217,28 @@ const modalStateFrom = Form.useForm( modalState.from, reactive({ configName: [ - { required: true, min: 1, max: 50, message: '请正确输入参数名称' }, + { + required: true, + min: 1, + max: 50, + message: t('views.system.config.configNamePlease'), + }, ], configKey: [ - { required: true, min: 1, max: 50, message: '请正确输入参数键名' }, + { + required: true, + min: 1, + max: 50, + message: t('views.system.config.configKeyPlease'), + }, ], configValue: [ - { required: true, min: 1, max: 250, message: '请正确输入参数键值' }, + { + required: true, + min: 1, + max: 250, + message: t('views.system.config.configValuePlease'), + }, ], }) ); @@ -233,16 +249,16 @@ const modalStateFrom = Form.useForm( */ function fnModalVisibleByVive(configId: string | number) { if (!configId) { - message.error(`参数配置记录存在错误`, 2); + message.error(t('views.system.config.tipRowErr'), 2); return; } getConfig(configId).then(res => { if (res.code === RESULT_CODE_SUCCESS && res.data) { modalState.from = Object.assign(modalState.from, res.data); - modalState.title = '参数配置信息'; + modalState.title = t('views.system.config.viewInfo'); modalState.visibleByView = true; } else { - message.error(`获取参数配置信息失败`, 2); + message.error(t('views.system.config.viewInfoErr'), 2); } }); } @@ -254,7 +270,7 @@ function fnModalVisibleByVive(configId: string | number) { function fnModalVisibleByEdit(configId?: string | number) { if (!configId) { modalStateFrom.resetFields(); - modalState.title = '添加参数配置'; + modalState.title = t('views.system.config.addInfo'); modalState.visibleByEdit = true; } else { if (modalState.confirmLoading) return; @@ -265,10 +281,10 @@ function fnModalVisibleByEdit(configId?: string | number) { hide(); if (res.code === RESULT_CODE_SUCCESS && res.data) { modalState.from = Object.assign(modalState.from, res.data); - modalState.title = '修改参数配置'; + modalState.title = t('views.system.config.editInfo'); modalState.visibleByEdit = true; } else { - message.error(`获取参数配置信息失败`, 2); + message.error(t('views.system.config.viewInfoErr'), 2); } }); } @@ -291,7 +307,7 @@ function fnModalOk() { .then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: `${modalState.title}成功`, + content: t('common.msgSuccess', { msg: modalState.title }), key, duration: 2, }); @@ -311,7 +327,7 @@ function fnModalOk() { }); }) .catch(e => { - message.error(`请正确填写 ${e.errorFields.length} 处必填信息!`, 2); + message.error(t('common.errorFields', { num: e.errorFields.length }), 3); }); } @@ -335,14 +351,14 @@ function fnRecordDelete(configId: string = '0') { } Modal.confirm({ title: t('common.tipTitle'), - content: `确认删除参数编号为 【${configId}】 的数据项?`, + content: t('views.system.config.delTip', { num: configId }), onOk() { const key = 'delConfig'; message.loading({ content: t('common.loading'), key }); delConfig(configId).then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: `删除成功`, + content: t('views.system.config.delOk'), key, duration: 2, }); @@ -363,14 +379,14 @@ function fnRecordDelete(configId: string = '0') { function fnExportList() { Modal.confirm({ title: t('common.tipTitle'), - content: `确认根据搜索条件导出xlsx表格文件吗?`, + content: t('views.system.config.exportTip'), onOk() { const key = 'exportConfig'; message.loading({ content: t('common.loading'), key }); exportConfig(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: `已完成导出`, + content: t('views.system.config.exportOk'), key, duration: 2, }); @@ -393,14 +409,14 @@ function fnExportList() { function fnRefreshCache() { Modal.confirm({ title: t('common.tipTitle'), - content: `确定要刷新参数配置缓存吗?`, + content: t('views.system.config.refreshCacheTip'), onOk() { const key = 'refreshCache'; message.loading({ content: t('common.loading'), key }); refreshCache().then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: `刷新缓存成功`, + content: t('views.system.config.refreshCacheOk'), key, duration: 2, }); @@ -461,25 +477,34 @@ onMounted(() => { - + - + - + { - + { v-perms:has="['system:config:remove']" > - 刷新缓存 + {{ t('views.system.config.refreshCache') }} {