mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
i18n: 参数管理新增多语言配置
This commit is contained in:
@ -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();
|
||||
}
|
||||
</script>
|
||||
@ -193,7 +193,7 @@ async function handleRefreshCache() {
|
||||
<template>
|
||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||
<ConfigSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getDataByPage" />
|
||||
<NCard title="参数配置列表" :bordered="false" size="small" class="sm:flex-1-hidden card-wrapper">
|
||||
<NCard :title="$t('page.system.config.title')" :bordered="false" size="small" class="sm:flex-1-hidden card-wrapper">
|
||||
<template #header-extra>
|
||||
<TableHeaderOperation
|
||||
v-model:columns="columnChecks"
|
||||
@ -212,7 +212,7 @@ async function handleRefreshCache() {
|
||||
<template #icon>
|
||||
<icon-material-symbols:sync-outline />
|
||||
</template>
|
||||
刷新缓存
|
||||
{{ $t('page.system.config.refreshCache') }}
|
||||
</NButton>
|
||||
</template>
|
||||
</TableHeaderOperation>
|
||||
|
@ -32,8 +32,8 @@ const { createRequiredRule } = useFormRules();
|
||||
|
||||
const title = computed(() => {
|
||||
const titles: Record<NaiveUI.TableOperateType, string> = {
|
||||
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<keyof Model, 'configId' | 'configName' | 'configKey' | 'configValue' | 'configType'>;
|
||||
|
||||
const rules: Record<RuleKey, App.Global.FormRule> = {
|
||||
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, () => {
|
||||
<NDrawer v-model:show="visible" :title="title" display-directive="show" :width="800" class="max-w-90%">
|
||||
<NDrawerContent :title="title" :native-scrollbar="false" closable>
|
||||
<NForm ref="formRef" :model="model" :rules="rules">
|
||||
<NFormItem label="参数名称" path="configName">
|
||||
<NInput v-model:value="model.configName" placeholder="请输入参数名称" />
|
||||
<NFormItem :label="$t('page.system.config.configName')" path="configName">
|
||||
<NInput v-model:value="model.configName" :placeholder="$t('page.system.config.form.configName.required')" />
|
||||
</NFormItem>
|
||||
<NFormItem label="参数键名" path="configKey">
|
||||
<NInput v-model:value="model.configKey" placeholder="请输入参数键名" />
|
||||
<NFormItem :label="$t('page.system.config.configKey')" path="configKey">
|
||||
<NInput v-model:value="model.configKey" :placeholder="$t('page.system.config.form.configKey.required')" />
|
||||
</NFormItem>
|
||||
<NFormItem label="参数键值" path="configValue">
|
||||
<NInput v-model:value="model.configValue" :rows="3" placeholder="请输入参数键值" />
|
||||
<NFormItem :label="$t('page.system.config.configValue')" path="configValue">
|
||||
<NInput
|
||||
v-model:value="model.configValue"
|
||||
:rows="3"
|
||||
:placeholder="$t('page.system.config.form.configValue.required')"
|
||||
/>
|
||||
</NFormItem>
|
||||
<NFormItem label="是否内置" path="configType">
|
||||
<NFormItem :label="$t('page.system.config.configType')" path="configType">
|
||||
<DictRadio v-model:value="model.configType" dict-code="sys_yes_no" />
|
||||
</NFormItem>
|
||||
<NFormItem label="备注" path="remark">
|
||||
<NInput v-model:value="model.remark" :rows="3" type="textarea" placeholder="请输入备注" />
|
||||
<NFormItem :label="$t('page.system.config.remark')" path="remark">
|
||||
<NInput
|
||||
v-model:value="model.remark"
|
||||
:rows="3"
|
||||
type="textarea"
|
||||
:placeholder="$t('page.system.config.form.remark.required')"
|
||||
/>
|
||||
</NFormItem>
|
||||
</NForm>
|
||||
<template #footer>
|
||||
|
@ -34,16 +34,29 @@ async function search() {
|
||||
<NCollapseItem :title="$t('common.search')" name="user-search">
|
||||
<NForm ref="formRef" :model="model" label-placement="left" :label-width="80">
|
||||
<NGrid responsive="screen" item-responsive>
|
||||
<NFormItemGi span="6 s:12 m:6" label="参数名称" path="configName" class="pr-24px">
|
||||
<NInput v-model:value="model.configName" placeholder="请输入参数名称" />
|
||||
<NFormItemGi
|
||||
span="6 s:12 m:6"
|
||||
:label="$t('page.system.config.configName')"
|
||||
path="configName"
|
||||
class="pr-24px"
|
||||
>
|
||||
<NInput
|
||||
v-model:value="model.configName"
|
||||
:placeholder="$t('page.system.config.form.configName.required')"
|
||||
/>
|
||||
</NFormItemGi>
|
||||
<NFormItemGi span="6 s:12 m:6" label="参数键名" path="configKey" class="pr-24px">
|
||||
<NInput v-model:value="model.configKey" placeholder="请输入参数键名" />
|
||||
<NFormItemGi span="6 s:12 m:6" :label="$t('page.system.config.configKey')" path="configKey" class="pr-24px">
|
||||
<NInput v-model:value="model.configKey" :placeholder="$t('page.system.config.form.configKey.required')" />
|
||||
</NFormItemGi>
|
||||
<NFormItemGi span="6 s:12 m:6" label="是否内置" path="configType" class="pr-24px">
|
||||
<NFormItemGi
|
||||
span="6 s:12 m:6"
|
||||
:label="$t('page.system.config.configType')"
|
||||
path="configType"
|
||||
class="pr-24px"
|
||||
>
|
||||
<DictSelect
|
||||
v-model:value="model.configType"
|
||||
placeholder="请选择是否内置"
|
||||
:placeholder="$t('page.system.config.form.configType.required')"
|
||||
dict-code="sys_yes_no"
|
||||
clearable
|
||||
/>
|
||||
|
Reference in New Issue
Block a user