This commit is contained in:
parent
c3b5dec7af
commit
c8804abb43
|
@ -59,6 +59,22 @@
|
|||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
|
||||
<div class="layout-navbars-breadcrumb-user-icon">
|
||||
<i
|
||||
class="iconfont"
|
||||
:class="state.disabledI18n === 'en' ? 'icon-fuhao-yingwen' : 'icon-fuhao-zhongwen'"
|
||||
|
||||
></i>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="zh-cn" :disabled="state.disabledI18n === 'zh-cn'">English</el-dropdown-item>
|
||||
<el-dropdown-item command="en" :disabled="state.disabledI18n === 'en'">简体中文</el-dropdown-item>
|
||||
<!-- <el-dropdown-item command="zh-tw" :disabled="state.disabledI18n === 'zh-tw'">繁體中文</el-dropdown-item> -->
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<Search ref="searchRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
@ -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",
|
||||
});
|
||||
|
||||
// 设置分割样式
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
||||
<template #title>
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<span>{{ val.meta.title }}</span>
|
||||
<span v-text="useTranslateStore.translate_control===1?val.meta.title :val.meta.zh"></span>
|
||||
</template>
|
||||
<SubItem :chil="val.children" />
|
||||
</el-sub-menu>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<el-menu-item :index="val.path" :key="val.path">
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
||||
<span>{{ val.meta.title }}</span>
|
||||
<span v-text="useTranslateStore.translate_control===1?val.meta.title :val.meta.zh"></span>
|
||||
</template>
|
||||
<template #title v-else>
|
||||
<a class="w100" @click.prevent="onALinkClick(val)">{{ val.meta.title }}</a>
|
||||
|
@ -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'));
|
||||
|
||||
|
|
|
@ -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:"登录"
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { Names } from "./store_name";
|
||||
|
||||
export const useVariableStore = defineStore(Names.TEST, {
|
||||
state: () => {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
getters: {
|
||||
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
||||
}
|
||||
|
||||
})
|
|
@ -1,4 +0,0 @@
|
|||
export const enum Names {
|
||||
TEST = "TEST"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import { defineStore } from 'pinia';
|
||||
export const useTranslate = defineStore('themeConfig',{
|
||||
state: () => ({
|
||||
translate_control:0
|
||||
}),
|
||||
getters: {
|
||||
|
||||
},
|
||||
actions:{
|
||||
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue