From fd16bc4f63dc17cd46fbfe402df090c36d2dc7d1 Mon Sep 17 00:00:00 2001 From: szdot Date: Mon, 23 Jun 2025 03:27:42 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A1=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AF=AD=E8=A8=80=E8=AE=BE=E7=BD=AE=E9=A1=B9=202?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=9D=83=E9=99=90=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=20=E6=9D=83=E9=99=90=E8=AE=BE=E7=BD=AE=E4=BD=86=E9=80=89?= =?UTF-8?q?=E9=A1=B9=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- .../layout/components/main/admin/add.vue | 12 +++++-- src/views/layout/components/main/home/set.vue | 31 ++++++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/views/layout/components/main/admin/add.vue b/src/views/layout/components/main/admin/add.vue index 86b09dd..a604893 100644 --- a/src/views/layout/components/main/admin/add.vue +++ b/src/views/layout/components/main/admin/add.vue @@ -11,7 +11,8 @@ - + @@ -33,6 +34,12 @@ + + + 管理员 + 编辑 + + @@ -69,7 +76,8 @@ export default { uname: '', upFile: '', oldFile: '', - pwd: '' + pwd: '', + role: 'admin' }, adminId: this.$route.params.id, // get参数 获取管理员id 没有为添加页面 pageState: 'add', // 页面状态 diff --git a/src/views/layout/components/main/home/set.vue b/src/views/layout/components/main/home/set.vue index 16680e1..8c07a9e 100644 --- a/src/views/layout/components/main/home/set.vue +++ b/src/views/layout/components/main/home/set.vue @@ -12,14 +12,23 @@ - - - - - {{ item.label }} - - - + + + + 简体中文 + + + + + + + + + + {{ item.label }} + + + @@ -36,6 +45,7 @@ export default { name: 'Set', data () { return { + currentLang: this.$store.state.settings.language || 'zh-CN', moduleOptions: [ { value: 'home', label: '概况' }, { value: 'model', label: '机型管理' }, @@ -73,6 +83,11 @@ export default { this.selectedModules.forEach(key => { this.setModuleVisibility({ key, visible: true }) }) + }, + changeLang (lang) { + this.$store.commit('settings/setLanguage', lang) + this.$message.success(`语言已切换为:${lang === 'zh-CN' ? '简体中文' : lang}`) + // 如果你用的是 vue-i18n,这里可能还需要调用 i18n.global.locale = lang } } }