This commit is contained in:
parent
c3b5dec7af
commit
c8804abb43
|
@ -11,7 +11,7 @@
|
||||||
<el-dropdown-item command="small" :disabled="state.disabledSize === 'small'">小型</el-dropdown-item>
|
<el-dropdown-item command="small" :disabled="state.disabledSize === 'small'">小型</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<div class="layout-navbars-breadcrumb-user-icon" @click="onSearchClick">
|
<div class="layout-navbars-breadcrumb-user-icon" @click="onSearchClick">
|
||||||
<el-icon title="菜单搜索">
|
<el-icon title="菜单搜索">
|
||||||
<ele-Search />
|
<ele-Search />
|
||||||
|
@ -59,6 +59,22 @@
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</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" />
|
<Search ref="searchRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -74,10 +90,22 @@ import { useThemeConfig } from '/@/stores/themeConfig';
|
||||||
import mittBus from '/@/utils/mitt';
|
import mittBus from '/@/utils/mitt';
|
||||||
import { Session, Local } from '/@/utils/storage';
|
import { Session, Local } from '/@/utils/storage';
|
||||||
import { refreshToken } from '/@/api/system/user.js'
|
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 UserNews = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/userNews.vue'));
|
||||||
const Search = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/search.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 router = useRouter();
|
||||||
const stores = useUserInfo();
|
const stores = useUserInfo();
|
||||||
|
@ -89,7 +117,8 @@ const searchRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
isScreenfull: false,
|
isScreenfull: false,
|
||||||
disabledSize: 'large',
|
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">
|
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
||||||
<template #title>
|
<template #title>
|
||||||
<SvgIcon :name="val.meta.icon" />
|
<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>
|
</template>
|
||||||
<SubItem :chil="val.children" />
|
<SubItem :chil="val.children" />
|
||||||
</el-sub-menu>
|
</el-sub-menu>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
<el-menu-item :index="val.path" :key="val.path">
|
<el-menu-item :index="val.path" :key="val.path">
|
||||||
<SvgIcon :name="val.meta.icon" />
|
<SvgIcon :name="val.meta.icon" />
|
||||||
<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
<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>
|
||||||
<template #title v-else>
|
<template #title v-else>
|
||||||
<a class="w100" @click.prevent="onALinkClick(val)">{{ val.meta.title }}</a>
|
<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 { storeToRefs } from 'pinia';
|
||||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||||
import other from '/@/utils/other';
|
import other from '/@/utils/other';
|
||||||
|
import { useTranslate } from '/@/stores/translate';
|
||||||
|
const useTranslateStore=useTranslate()
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const SubItem = defineAsyncComponent(() => import('/@/layout/navMenu/subItem.vue'));
|
const SubItem = defineAsyncComponent(() => import('/@/layout/navMenu/subItem.vue'));
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin', 'chief'],
|
||||||
icon: 'iconfont icon-shouye',
|
icon: 'iconfont icon-shouye',
|
||||||
|
zh:"控制台"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -57,6 +58,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin'],
|
roles: ['admin'],
|
||||||
icon: 'iconfont icon-xitongshezhi',
|
icon: 'iconfont icon-xitongshezhi',
|
||||||
|
zh:"响应管理"
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -72,6 +74,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin'],
|
roles: ['admin'],
|
||||||
icon: 'iconfont icon-caidan',
|
icon: 'iconfont icon-caidan',
|
||||||
|
zh:"用户响应管理"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -87,6 +90,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin'],
|
roles: ['admin'],
|
||||||
icon: 'ele-ColdDrink',
|
icon: 'ele-ColdDrink',
|
||||||
|
zh:"管理员管理"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -102,6 +106,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin', 'chief'],
|
||||||
icon: 'iconfont icon-icon-',
|
icon: 'iconfont icon-icon-',
|
||||||
|
zh:"数据上传管理"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -120,6 +125,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin', 'chief'],
|
||||||
icon: 'iconfont icon-xitongshezhi',
|
icon: 'iconfont icon-xitongshezhi',
|
||||||
|
zh:"数据服务"
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -135,6 +141,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin', 'chief'],
|
||||||
icon: 'iconfont icon-caidan',
|
icon: 'iconfont icon-caidan',
|
||||||
|
zh:"多媒体数据"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -150,6 +157,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin', 'chief'],
|
||||||
icon: 'ele-ColdDrink',
|
icon: 'ele-ColdDrink',
|
||||||
|
zh:"遥感数据"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -165,6 +173,7 @@ export const dynamicRoutes = [
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['admin', 'chief'],
|
roles: ['admin', 'chief'],
|
||||||
icon: 'ele-ColdDrink',
|
icon: 'ele-ColdDrink',
|
||||||
|
zh:"其他数据服务"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -326,6 +335,7 @@ export const notFoundAndNoPower = [
|
||||||
meta: {
|
meta: {
|
||||||
title: '页面找不到',
|
title: '页面找不到',
|
||||||
isHide: true,
|
isHide: true,
|
||||||
|
zh:"页面找不到"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -335,6 +345,7 @@ export const notFoundAndNoPower = [
|
||||||
meta: {
|
meta: {
|
||||||
title: '页面无权限',
|
title: '页面无权限',
|
||||||
isHide: true,
|
isHide: true,
|
||||||
|
zh:"页面无权限"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -352,6 +363,7 @@ export const staticRoutes = [
|
||||||
component: () => import('/@/views/login/index.vue'),
|
component: () => import('/@/views/login/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '登录',
|
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