From c8804abb431c26979c5f96cc1becd79a14c34188 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com>
Date: Fri, 31 Mar 2023 14:18:25 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layout/navBars/breadcrumb/user.vue | 35 +++++++++++++++++++++++---
src/layout/navMenu/vertical.vue | 7 +++---
src/router/route.js | 12 +++++++++
src/store/index.ts | 19 --------------
src/store/store_name.ts | 4 ---
src/stores/translate.js | 12 +++++++++
6 files changed, 60 insertions(+), 29 deletions(-)
delete mode 100644 src/store/index.ts
delete mode 100644 src/store/store_name.ts
create mode 100644 src/stores/translate.js
diff --git a/src/layout/navBars/breadcrumb/user.vue b/src/layout/navBars/breadcrumb/user.vue
index f84f661..f7d7982 100644
--- a/src/layout/navBars/breadcrumb/user.vue
+++ b/src/layout/navBars/breadcrumb/user.vue
@@ -11,7 +11,7 @@
小型
-
+
@@ -59,6 +59,22 @@
+
+
+
+
+
+
+ English
+ 简体中文
+
+
+
+
@@ -74,10 +90,22 @@ import { useThemeConfig } from '/@/stores/themeConfig';
import mittBus from '/@/utils/mitt';
import { Session, Local } from '/@/utils/storage';
import { refreshToken } from '/@/api/system/user.js'
+import { useTranslate } from '/@/stores/translate';
+import other from '/@/utils/other';
// 引入组件
const UserNews = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/userNews.vue'));
const Search = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/search.vue'));
-
+const useTranslateStore=useTranslate()
+const onLanguageChange = (lang) => {
+ if(lang=="en"){
+ state.disabledI18n="en"
+ useTranslateStore.translate_control=0
+ }
+ else{
+ state.disabledI18n="zh-cn"
+ useTranslateStore.translate_control=1
+ }
+};
// 定义变量内容
const router = useRouter();
const stores = useUserInfo();
@@ -89,7 +117,8 @@ const searchRef = ref();
const state = reactive({
isScreenfull: false,
disabledSize: 'large',
- setIntervalId: null
+ setIntervalId: null,
+ disabledI18n:"en",
});
// 设置分割样式
diff --git a/src/layout/navMenu/vertical.vue b/src/layout/navMenu/vertical.vue
index 1bf1d39..083b13c 100644
--- a/src/layout/navMenu/vertical.vue
+++ b/src/layout/navMenu/vertical.vue
@@ -11,7 +11,7 @@
- {{ val.meta.title }}
+
@@ -19,7 +19,7 @@
- {{ val.meta.title }}
+
{{ val.meta.title }}
@@ -36,7 +36,8 @@ import { useRoute, onBeforeRouteUpdate } from 'vue-router';
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '/@/stores/themeConfig';
import other from '/@/utils/other';
-
+import { useTranslate } from '/@/stores/translate';
+const useTranslateStore=useTranslate()
// 引入组件
const SubItem = defineAsyncComponent(() => import('/@/layout/navMenu/subItem.vue'));
diff --git a/src/router/route.js b/src/router/route.js
index 39e7615..05685fa 100644
--- a/src/router/route.js
+++ b/src/router/route.js
@@ -41,6 +41,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin', 'chief'],
icon: 'iconfont icon-shouye',
+ zh:"控制台"
},
},
{
@@ -57,6 +58,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin'],
icon: 'iconfont icon-xitongshezhi',
+ zh:"响应管理"
},
children: [
{
@@ -72,6 +74,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin'],
icon: 'iconfont icon-caidan',
+ zh:"用户响应管理"
},
},
{
@@ -87,6 +90,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin'],
icon: 'ele-ColdDrink',
+ zh:"管理员管理"
},
},
{
@@ -102,6 +106,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin', 'chief'],
icon: 'iconfont icon-icon-',
+ zh:"数据上传管理"
},
},
],
@@ -120,6 +125,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin', 'chief'],
icon: 'iconfont icon-xitongshezhi',
+ zh:"数据服务"
},
children: [
{
@@ -135,6 +141,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin', 'chief'],
icon: 'iconfont icon-caidan',
+ zh:"多媒体数据"
},
},
{
@@ -150,6 +157,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin', 'chief'],
icon: 'ele-ColdDrink',
+ zh:"遥感数据"
},
},
{
@@ -165,6 +173,7 @@ export const dynamicRoutes = [
isIframe: false,
roles: ['admin', 'chief'],
icon: 'ele-ColdDrink',
+ zh:"其他数据服务"
},
},
],
@@ -326,6 +335,7 @@ export const notFoundAndNoPower = [
meta: {
title: '页面找不到',
isHide: true,
+ zh:"页面找不到"
},
},
{
@@ -335,6 +345,7 @@ export const notFoundAndNoPower = [
meta: {
title: '页面无权限',
isHide: true,
+ zh:"页面无权限"
},
},
];
@@ -352,6 +363,7 @@ export const staticRoutes = [
component: () => import('/@/views/login/index.vue'),
meta: {
title: '登录',
+ zh:"登录"
},
},
];
diff --git a/src/store/index.ts b/src/store/index.ts
deleted file mode 100644
index 7c5210d..0000000
--- a/src/store/index.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { defineStore } from "pinia";
-import { Names } from "./store_name";
-
-export const useVariableStore = defineStore(Names.TEST, {
- state: () => {
- return {
-
- }
- },
-
- getters: {
-
- },
-
- actions: {
-
- }
-
- })
\ No newline at end of file
diff --git a/src/store/store_name.ts b/src/store/store_name.ts
deleted file mode 100644
index f45d2f1..0000000
--- a/src/store/store_name.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export const enum Names {
- TEST = "TEST"
- }
-
\ No newline at end of file
diff --git a/src/stores/translate.js b/src/stores/translate.js
new file mode 100644
index 0000000..be6e45a
--- /dev/null
+++ b/src/stores/translate.js
@@ -0,0 +1,12 @@
+import { defineStore } from 'pinia';
+export const useTranslate = defineStore('themeConfig',{
+ state: () => ({
+ translate_control:0
+ }),
+ getters: {
+
+ },
+ actions:{
+
+ }
+})
\ No newline at end of file