From 7c2bffa1a495cc4a3a263f654c08c231009c5c4e Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 02 四月 2026 10:59:45 +0800
Subject: [PATCH] #i18n
---
rsf-design/src/views/system/menu/modules/menu-dialog.vue | 62 +++++++++++++++++--------------
1 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/rsf-design/src/views/system/menu/modules/menu-dialog.vue b/rsf-design/src/views/system/menu/modules/menu-dialog.vue
index c2a5dc9..eb0e103 100644
--- a/rsf-design/src/views/system/menu/modules/menu-dialog.vue
+++ b/rsf-design/src/views/system/menu/modules/menu-dialog.vue
@@ -21,22 +21,23 @@
>
<template #menuType>
<ElRadioGroup v-model="form.menuType" :disabled="disableMenuType">
- <ElRadioButton value="menu">鑿滃崟</ElRadioButton>
- <ElRadioButton value="button">鎸夐挳</ElRadioButton>
+ <ElRadioButton value="menu">{{ t('pages.system.menu.form.typeMenu') }}</ElRadioButton>
+ <ElRadioButton value="button">{{ t('pages.system.menu.form.typeButton') }}</ElRadioButton>
</ElRadioGroup>
</template>
</ArtForm>
<template #footer>
<span class="dialog-footer">
- <ElButton @click="handleCancel">鍙栨秷</ElButton>
- <ElButton type="primary" @click="handleSubmit">纭畾</ElButton>
+ <ElButton @click="handleCancel">{{ t('common.cancel') }}</ElButton>
+ <ElButton type="primary" @click="handleSubmit">{{ t('common.confirm') }}</ElButton>
</span>
</template>
</ElDialog>
</template>
<script setup>
+ import { useI18n } from 'vue-i18n'
import ArtForm from '@/components/core/forms/art-form/index.vue'
const createMenuFormState = () => ({
@@ -62,30 +63,35 @@
})
const emit = defineEmits(['update:visible', 'submit'])
+ const { t } = useI18n()
const formRef = ref()
const form = reactive(createMenuFormState())
const isEdit = computed(() => Boolean(form.id))
- const dialogTitle = computed(() => `${isEdit.value ? '缂栬緫' : '鏂板缓'}${form.menuType === 'button' ? '鎸夐挳' : '鑿滃崟'}`)
+ const dialogTitle = computed(() =>
+ form.menuType === 'button'
+ ? t(isEdit.value ? 'pages.system.menu.form.titleEditButton' : 'pages.system.menu.form.titleAddButton')
+ : t(isEdit.value ? 'pages.system.menu.form.titleEditMenu' : 'pages.system.menu.form.titleAddMenu')
+ )
const disableMenuType = computed(() => props.lockType || isEdit.value)
const rules = computed(() => ({
- name: [{ required: true, message: form.menuType === 'button' ? '璇疯緭鍏ユ潈闄愬悕绉�' : '璇疯緭鍏ヨ彍鍗曞悕绉�', trigger: 'blur' }],
+ name: [{ required: true, message: form.menuType === 'button' ? t('pages.system.menu.form.validationButtonName') : t('pages.system.menu.form.validationMenuName'), trigger: 'blur' }],
route:
form.menuType === 'menu'
- ? [{ required: true, message: '璇疯緭鍏ヨ矾鐢卞湴鍧�', trigger: 'blur' }]
+ ? [{ required: true, message: t('pages.system.menu.form.validationRoute'), trigger: 'blur' }]
: [],
authority:
form.menuType === 'button'
- ? [{ required: true, message: '璇疯緭鍏ユ潈闄愭爣璇�', trigger: 'blur' }]
+ ? [{ required: true, message: t('pages.system.menu.form.validationAuthority'), trigger: 'blur' }]
: []
}))
const formItems = computed(() => {
const items = [
- { label: '鑿滃崟绫诲瀷', key: 'menuType', span: 24 },
+ { label: t('pages.system.menu.form.menuType'), key: 'menuType', span: 24 },
{
- label: '涓婄骇鑿滃崟',
+ label: t('pages.system.menu.form.parentId'),
key: 'parentId',
type: 'treeselect',
span: 24,
@@ -96,19 +102,19 @@
value: 'value',
children: 'children'
},
- placeholder: '璇烽�夋嫨涓婄骇鑿滃崟',
+ placeholder: t('pages.system.menu.form.placeholderParent'),
checkStrictly: true,
clearable: false,
defaultExpandAll: true
}
},
{
- label: form.menuType === 'button' ? '鏉冮檺鍚嶇О' : '鑿滃崟鍚嶇О',
+ label: form.menuType === 'button' ? t('pages.system.menu.form.nameButton') : t('pages.system.menu.form.nameMenu'),
key: 'name',
type: 'input',
span: 24,
props: {
- placeholder: form.menuType === 'button' ? '璇疯緭鍏ユ潈闄愬悕绉�' : '璇疯緭鍏ヨ彍鍗曞悕绉�',
+ placeholder: form.menuType === 'button' ? t('pages.system.menu.form.placeholderButtonName') : t('pages.system.menu.form.placeholderMenuName'),
clearable: true
}
}
@@ -117,22 +123,22 @@
if (form.menuType === 'menu') {
items.push(
{
- label: '璺敱鍦板潃',
+ label: t('pages.system.menu.form.route'),
key: 'route',
type: 'input',
span: 24,
props: {
- placeholder: '璇疯緭鍏ヨ矾鐢卞湴鍧�',
+ placeholder: t('pages.system.menu.form.placeholderRoute'),
clearable: true
}
},
{
- label: '缁勪欢鏍囪瘑',
+ label: t('pages.system.menu.form.component'),
key: 'component',
type: 'input',
span: 24,
props: {
- placeholder: '璇疯緭鍏ョ粍浠舵爣璇�',
+ placeholder: t('pages.system.menu.form.placeholderComponent'),
clearable: true
}
}
@@ -141,27 +147,27 @@
items.push(
{
- label: '鏉冮檺鏍囪瘑',
+ label: t('pages.system.menu.form.authority'),
key: 'authority',
type: 'input',
span: 24,
props: {
- placeholder: '璇疯緭鍏ユ潈闄愭爣璇�',
+ placeholder: t('pages.system.menu.form.placeholderAuthority'),
clearable: true
}
},
{
- label: '鍥炬爣',
+ label: t('pages.system.menu.form.icon'),
key: 'icon',
type: 'input',
span: 24,
props: {
- placeholder: '璇疯緭鍏ュ浘鏍囧悕绉�',
+ placeholder: t('pages.system.menu.form.placeholderIcon'),
clearable: true
}
},
{
- label: '鎺掑簭',
+ label: t('pages.system.menu.form.sort'),
key: 'sort',
type: 'number',
span: 24,
@@ -172,27 +178,27 @@
}
},
{
- label: '鐘舵��',
+ label: t('pages.system.menu.form.status'),
key: 'status',
type: 'select',
span: 24,
props: {
- placeholder: '璇烽�夋嫨鐘舵��',
+ placeholder: t('pages.system.menu.form.placeholderStatus'),
options: [
- { label: '鍚敤', value: 1 },
- { label: '绂佺敤', value: 0 }
+ { label: t('common.status.enabled'), value: 1 },
+ { label: t('common.status.disabled'), value: 0 }
]
}
},
{
- label: '澶囨敞',
+ label: t('pages.system.menu.form.memo'),
key: 'memo',
type: 'input',
span: 24,
props: {
type: 'textarea',
rows: 3,
- placeholder: '璇疯緭鍏ュ娉�',
+ placeholder: t('pages.system.menu.form.placeholderMemo'),
clearable: true
}
}
--
Gitblit v1.9.1