diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 74b29949..e0317e2f 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -337,6 +337,87 @@ const local: App.I18n.Schema = { }, addClient: 'Add Client', editClient: 'Edit Client' + }, + config: { + title: 'Config List', + configName: 'Config Name', + configKey: 'Config Key', + configValue: 'Config Value', + configType: 'Built-in', + remark: 'Remark', + createTime: 'Create Time', + refreshCache: 'Refresh Cache', + refreshCacheSuccess: 'Refresh cache successfully', + form: { + configId: { + required: 'Please enter Config ID', + invalid: 'Config ID cannot be empty' + }, + configName: { + required: 'Please enter Config Name', + invalid: 'Config Name cannot be empty' + }, + configKey: { + required: 'Please enter Config Key', + invalid: 'Config Key cannot be empty' + }, + configValue: { + required: 'Please enter Config Value', + invalid: 'Config Value cannot be empty' + }, + configType: { + required: 'Please select Built-in status', + invalid: 'Built-in status cannot be empty' + }, + remark: { + required: 'Please enter Remark', + invalid: 'Remark cannot be empty' + } + }, + addConfig: 'Add Config', + editConfig: 'Edit Config' + }, + dept: { + title: 'Department List', + deptName: 'Department Name', + leader: 'Leader', + phone: 'Phone', + email: 'Email', + status: 'Status', + sort: 'Sort', + createTime: 'Create Time', + form: { + parentId: { + required: 'Please select Parent Department', + invalid: 'Parent Department cannot be empty' + }, + deptName: { + required: 'Please enter Department Name', + invalid: 'Department Name cannot be empty' + }, + leader: { + required: 'Please enter Leader', + invalid: 'Leader cannot be empty' + }, + phone: { + required: 'Please enter Phone', + invalid: 'Phone cannot be empty' + }, + email: { + required: 'Please enter Email', + invalid: 'Email cannot be empty' + }, + status: { + required: 'Please select Status', + invalid: 'Status cannot be empty' + }, + sort: { + required: 'Please enter Sort', + invalid: 'Sort cannot be empty' + } + }, + addDept: 'Add Department', + editDept: 'Edit Department' } } }, diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 8477a84d..15de1bc3 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -337,6 +337,87 @@ const local: App.I18n.Schema = { }, addClient: '新增客户端', editClient: '编辑客户端' + }, + config: { + title: '参数配置列表', + configName: '参数名称', + configKey: '参数键名', + configValue: '参数键值', + configType: '是否内置', + remark: '备注', + createTime: '创建时间', + refreshCache: '刷新缓存', + refreshCacheSuccess: '刷新缓存成功', + form: { + configId: { + required: '请输入参数主键', + invalid: '参数主键不能为空' + }, + configName: { + required: '请输入参数名称', + invalid: '参数名称不能为空' + }, + configKey: { + required: '请输入参数键名', + invalid: '参数键名不能为空' + }, + configValue: { + required: '请输入参数键值', + invalid: '参数键值不能为空' + }, + configType: { + required: '请选择是否内置', + invalid: '是否内置不能为空' + }, + remark: { + required: '请输入备注', + invalid: '备注不能为空' + } + }, + addConfig: '新增参数配置', + editConfig: '编辑参数配置' + }, + dept: { + title: '部门列表', + deptName: '部门名称', + leader: '负责人', + phone: '联系电话', + email: '邮箱', + status: '状态', + sort: '排序', + createTime: '创建时间', + form: { + parentId: { + required: '请选择上级部门', + invalid: '上级部门不能为空' + }, + deptName: { + required: '请输入部门名称', + invalid: '部门名称不能为空' + }, + leader: { + required: '请输入负责人', + invalid: '负责人不能为空' + }, + phone: { + required: '请输入联系电话', + invalid: '联系电话不能为空' + }, + email: { + required: '请输入邮箱', + invalid: '邮箱不能为空' + }, + status: { + required: '请选择状态', + invalid: '状态不能为空' + }, + sort: { + required: '请输入排序', + invalid: '排序不能为空' + } + }, + addDept: '新增部门', + editDept: '编辑部门' } } }, diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 11fbdb63..a889ac00 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -532,6 +532,48 @@ declare namespace App { addClient: string; editClient: string; }; + config: { + title: string; + configName: string; + configKey: string; + configValue: string; + configType: string; + remark: string; + createTime: string; + refreshCache: string; + refreshCacheSuccess: string; + form: { + configId: FormMsg; + configName: FormMsg; + configKey: FormMsg; + configValue: FormMsg; + configType: FormMsg; + remark: FormMsg; + }; + addConfig: string; + editConfig: string; + }; + dept: { + title: string; + deptName: string; + leader: string; + phone: string; + email: string; + status: string; + sort: string; + createTime: string; + form: { + parentId: FormMsg; + deptName: FormMsg; + leader: FormMsg; + phone: FormMsg; + email: FormMsg; + status: FormMsg; + sort: FormMsg; + }; + addDept: string; + editDept: string; + }; }; }; form: { diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 448e519d..58f331f9 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -58,25 +58,25 @@ const { }, { key: 'configName', - title: '参数名称', + title: $t('page.system.config.configName'), align: 'center', minWidth: 120 }, { key: 'configKey', - title: '参数键名', + title: $t('page.system.config.configKey'), align: 'center', minWidth: 120 }, { key: 'configValue', - title: '参数键值', + title: $t('page.system.config.configValue'), align: 'center', minWidth: 120 }, { key: 'configType', - title: '是否内置', + title: $t('page.system.config.configType'), align: 'center', minWidth: 120, render(row) { @@ -85,7 +85,7 @@ const { }, { key: 'remark', - title: '备注', + title: $t('page.system.config.remark'), align: 'center', minWidth: 120, ellipsis: { @@ -94,7 +94,7 @@ const { }, { key: 'createTime', - title: '创建时间', + title: $t('page.system.config.createTime'), align: 'center', minWidth: 120, ellipsis: { @@ -185,7 +185,7 @@ async function handleExport() { async function handleRefreshCache() { const { error } = await fetchRefreshCache(); if (error) return; - window.$message?.success('刷新缓存成功'); + window.$message?.success($t('page.system.config.refreshCacheSuccess')); await getData(); } @@ -193,7 +193,7 @@ async function handleRefreshCache() { diff --git a/src/views/system/config/modules/config-operate-drawer.vue b/src/views/system/config/modules/config-operate-drawer.vue index cc353c48..c08053fa 100644 --- a/src/views/system/config/modules/config-operate-drawer.vue +++ b/src/views/system/config/modules/config-operate-drawer.vue @@ -32,8 +32,8 @@ const { createRequiredRule } = useFormRules(); const title = computed(() => { const titles: Record = { - add: '新增参数配置', - edit: '编辑参数配置' + add: $t('page.system.config.addConfig'), + edit: $t('page.system.config.editConfig') }; return titles[props.operateType]; }); @@ -55,11 +55,11 @@ function createDefaultModel(): Model { type RuleKey = Extract; const rules: Record = { - configId: createRequiredRule('参数主键不能为空'), - configName: createRequiredRule('参数名称不能为空'), - configKey: createRequiredRule('参数键名不能为空'), - configValue: createRequiredRule('参数键值不能为空'), - configType: createRequiredRule('是否内置不能为空') + configId: createRequiredRule($t('page.system.config.form.configId.required')), + configName: createRequiredRule($t('page.system.config.form.configName.required')), + configKey: createRequiredRule($t('page.system.config.form.configKey.required')), + configValue: createRequiredRule($t('page.system.config.form.configValue.required')), + configType: createRequiredRule($t('page.system.config.form.configType.required')) }; function handleUpdateModelWhenEdit() { @@ -110,20 +110,29 @@ watch(visible, () => { - - + + - - + + - - + + - + - - + +