|
|
@@ -1,73 +1,97 @@
|
|
|
<template>
|
|
|
<div class="layout-navbars-breadcrumb-user pr15" :style="{ flex: layoutUserFlexNum }">
|
|
|
- <el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onComponentSizeChange">
|
|
|
+
|
|
|
+ <!-- 站点切换-->
|
|
|
+ <el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="handleStationChange">
|
|
|
<div class="layout-navbars-breadcrumb-user-icon">
|
|
|
-<!-- <i class="iconfont icon-ziti" :title="$t('message.user.title0')"></i>-->
|
|
|
- <el-icon class="el-icon--right"><ele-Switch /></el-icon>
|
|
|
+ <!-- <i class="iconfont icon-ziti" :title="$t('message.user.title0')"></i>-->
|
|
|
+ <SvgIcon name="ele-Location"></SvgIcon>
|
|
|
+ <span style="color:var(--el-text-color-primary)">{{ state.currentStation.stationName }} </span>
|
|
|
+ <!-- <el-icon class="el-icon--right"><ele-Location /> </el-icon>-->
|
|
|
</div>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item command="large" :disabled="state.disabledSize === 'large'">{{ $t('message.user.dropdownLarge') }}</el-dropdown-item>
|
|
|
- <el-dropdown-item command="default" :disabled="state.disabledSize === 'default'">{{ $t('message.user.dropdownDefault') }}</el-dropdown-item>
|
|
|
- <el-dropdown-item command="small" :disabled="state.disabledSize === 'small'">{{ $t('message.user.dropdownSmall') }}</el-dropdown-item>
|
|
|
+ <el-dropdown-item v-for="station in state.stationList" :key="station.stationId" :command="station.stationId" :disabled="state.currentStation.stationId == station.stationId">{{ station.stationName }}</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
|
|
|
-<!-- <el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
|
|
|
+
|
|
|
+ <!-- 字体大小-->
|
|
|
+ <el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onComponentSizeChange">
|
|
|
<div class="layout-navbars-breadcrumb-user-icon">
|
|
|
- <i
|
|
|
- class="iconfont"
|
|
|
- :class="state.disabledI18n === 'en' ? 'icon-fuhao-yingwen' : 'icon-fuhao-zhongwen'"
|
|
|
- :title="$t('message.user.title1')"
|
|
|
- ></i>
|
|
|
+ <!-- <i class="iconfont icon-ziti" :title="$t('message.user.title0')"></i>-->
|
|
|
+ <el-icon class="el-icon--right">
|
|
|
+ <ele-Switch/>
|
|
|
+ </el-icon>
|
|
|
</div>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item command="zh-cn" :disabled="state.disabledI18n === 'zh-cn'">简体中文</el-dropdown-item>
|
|
|
- <el-dropdown-item command="en" :disabled="state.disabledI18n === 'en'">English</el-dropdown-item>
|
|
|
- <el-dropdown-item command="zh-tw" :disabled="state.disabledI18n === 'zh-tw'">繁體中文</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="large" :disabled="state.disabledSize === 'large'">{{ $t('message.user.dropdownLarge') }}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="default" :disabled="state.disabledSize === 'default'">{{ $t('message.user.dropdownDefault') }}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="small" :disabled="state.disabledSize === 'small'">{{ $t('message.user.dropdownSmall') }}</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
- </el-dropdown>-->
|
|
|
+ </el-dropdown>
|
|
|
|
|
|
-<!-- <div class="layout-navbars-breadcrumb-user-icon" @click="onSearchClick">
|
|
|
- <el-icon :title="$t('message.user.title2')">
|
|
|
- <ele-Search/>
|
|
|
- </el-icon>
|
|
|
- </div>-->
|
|
|
+ <!-- <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'"
|
|
|
+ :title="$t('message.user.title1')"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item command="zh-cn" :disabled="state.disabledI18n === 'zh-cn'">简体中文</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="en" :disabled="state.disabledI18n === 'en'">English</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="zh-tw" :disabled="state.disabledI18n === 'zh-tw'">繁體中文</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>-->
|
|
|
+
|
|
|
+ <!-- <div class="layout-navbars-breadcrumb-user-icon" @click="onSearchClick">
|
|
|
+ <el-icon :title="$t('message.user.title2')">
|
|
|
+ <ele-Search/>
|
|
|
+ </el-icon>
|
|
|
+ </div>-->
|
|
|
|
|
|
<template v-if="admin">
|
|
|
<div class="layout-navbars-breadcrumb-user-icon" @click="onLayoutSetingClick">
|
|
|
- <el-icon class="el-icon--right"><ele-Tools /></el-icon>
|
|
|
+ <el-icon class="el-icon--right">
|
|
|
+ <ele-Tools/>
|
|
|
+ </el-icon>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<!--
|
|
|
+ <!--
|
|
|
|
|
|
- <div class="layout-navbars-breadcrumb-user-icon">
|
|
|
- <el-popover placement="bottom" trigger="click" transition="el-zoom-in-top" :width="300" :persistent="false">
|
|
|
- <template #reference>
|
|
|
- <el-badge :is-dot="true">
|
|
|
- <el-icon :title="$t('message.user.title4')">
|
|
|
- <ele-Bell/>
|
|
|
- </el-icon>
|
|
|
- </el-badge>
|
|
|
- </template>
|
|
|
- <template #default>
|
|
|
- <Notification/>
|
|
|
- </template>
|
|
|
- </el-popover>
|
|
|
- </div>
|
|
|
--->
|
|
|
+ <div class="layout-navbars-breadcrumb-user-icon">
|
|
|
+ <el-popover placement="bottom" trigger="click" transition="el-zoom-in-top" :width="300" :persistent="false">
|
|
|
+ <template #reference>
|
|
|
+ <el-badge :is-dot="true">
|
|
|
+ <el-icon :title="$t('message.user.title4')">
|
|
|
+ <ele-Bell/>
|
|
|
+ </el-icon>
|
|
|
+ </el-badge>
|
|
|
+ </template>
|
|
|
+ <template #default>
|
|
|
+ <Notification/>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ -->
|
|
|
|
|
|
<div class="layout-navbars-breadcrumb-user-icon mr10" @click="onScreenfullClick">
|
|
|
- <el-icon class="el-icon--right"><ele-FullScreen /></el-icon>
|
|
|
-<!-- <i
|
|
|
- class="iconfont"
|
|
|
- :title="state.isScreenfull ? $t('message.user.title6') : $t('message.user.title5')"
|
|
|
- :class="!state.isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"
|
|
|
- ></i>-->
|
|
|
+ <el-icon class="el-icon--right">
|
|
|
+ <ele-FullScreen/>
|
|
|
+ </el-icon>
|
|
|
+ <!-- <i
|
|
|
+ class="iconfont"
|
|
|
+ :title="state.isScreenfull ? $t('message.user.title6') : $t('message.user.title5')"
|
|
|
+ :class="!state.isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"
|
|
|
+ ></i>-->
|
|
|
</div>
|
|
|
|
|
|
<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
|
|
|
@@ -82,16 +106,16 @@
|
|
|
</span>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
-<!-- <el-dropdown-item>
|
|
|
- <RouterLink target="_blank" to="/admin?oid=">
|
|
|
- <el-link type="primary">管理设置</el-link>
|
|
|
- </RouterLink>
|
|
|
- </el-dropdown-item>-->
|
|
|
+ <!-- <el-dropdown-item>
|
|
|
+ <RouterLink target="_blank" to="/admin?oid=">
|
|
|
+ <el-link type="primary">管理设置</el-link>
|
|
|
+ </RouterLink>
|
|
|
+ </el-dropdown-item>-->
|
|
|
<!-- <el-dropdown-item command="/admin/home">{{ $t('message.user.dropdown1') }}</el-dropdown-item>-->
|
|
|
<!-- <el-dropdown-item command="wareHouse">{{ $t('message.user.dropdown6') }}</el-dropdown-item>-->
|
|
|
-<!-- <el-dropdown-item command="/personal">{{ $t('message.user.dropdown2') }}</el-dropdown-item>
|
|
|
- <el-dropdown-item command="/404">{{ $t('message.user.dropdown3') }}</el-dropdown-item>
|
|
|
- <el-dropdown-item command="/401">{{ $t('message.user.dropdown4') }}</el-dropdown-item>-->
|
|
|
+ <!-- <el-dropdown-item command="/personal">{{ $t('message.user.dropdown2') }}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="/404">{{ $t('message.user.dropdown3') }}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="/401">{{ $t('message.user.dropdown4') }}</el-dropdown-item>-->
|
|
|
<el-dropdown-item divided command="logOut">
|
|
|
<el-icon color="#409EFC">
|
|
|
<ele-SwitchButton/>
|
|
|
@@ -118,6 +142,7 @@ import other from '/@/utils/other';
|
|
|
import mittBus from '/@/utils/mitt';
|
|
|
import {Session, Local} from '/@/utils/storage';
|
|
|
import u from "/@/utils/u";
|
|
|
+import {$get} from "/@/utils/request";
|
|
|
|
|
|
// 引入组件
|
|
|
const Notification = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/notification.vue'));
|
|
|
@@ -143,16 +168,18 @@ const state = reactive({
|
|
|
isScreenfull: false,
|
|
|
disabledI18n: 'zh-cn',
|
|
|
disabledSize: 'large',
|
|
|
+ stationList: [],
|
|
|
+ currentStation: {}
|
|
|
});
|
|
|
|
|
|
-const onSwitchTheme = ()=>{
|
|
|
+const onSwitchTheme = () => {
|
|
|
let dark = themeConfig.value.isIsDark;
|
|
|
const body = document.documentElement as HTMLElement;
|
|
|
if (!dark) body.setAttribute('data-theme', 'dark');
|
|
|
else body.setAttribute('data-theme', '');
|
|
|
themeConfig.value.isIsDark = !dark;
|
|
|
- storesThemeConfig.setThemeConfig({ themeConfig: themeConfig.value});
|
|
|
- Local.set('themeConfig',themeConfig.value)
|
|
|
+ storesThemeConfig.setThemeConfig({themeConfig: themeConfig.value});
|
|
|
+ Local.set('themeConfig', themeConfig.value)
|
|
|
}
|
|
|
|
|
|
const userInfos = computed(() => {
|
|
|
@@ -234,6 +261,20 @@ const onHandleCommandClick = (path: string) => {
|
|
|
const onSearchClick = () => {
|
|
|
searchRef.value.openSearch();
|
|
|
};
|
|
|
+
|
|
|
+//站点切换
|
|
|
+const handleStationChange = (stationId: string) => {
|
|
|
+ console.log(stationId)
|
|
|
+
|
|
|
+ let station = state.stationList.find((k: any) => k.stationId === stationId)
|
|
|
+ if (station) {
|
|
|
+ state.currentStation = station;
|
|
|
+ Session.set("currentStationId",stationId)
|
|
|
+ mittBus.emit('stationChangeRefresh', stationId);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
// 组件大小改变
|
|
|
const onComponentSizeChange = (size: string) => {
|
|
|
Local.remove('themeConfig');
|
|
|
@@ -261,7 +302,25 @@ onMounted(() => {
|
|
|
initI18nOrSize('globalComponentSize', 'disabledSize');
|
|
|
initI18nOrSize('globalI18n', 'disabledI18n');
|
|
|
}
|
|
|
+
|
|
|
+ loadStationList();
|
|
|
});
|
|
|
+
|
|
|
+const loadStationList = () => {
|
|
|
+ $get(`/station/listStation`, {pageNum: 1024}).then((res: any) => {
|
|
|
+ state.stationList = res;
|
|
|
+ if (res && res.length > 0) {
|
|
|
+ state.currentStation = res[0];
|
|
|
+ setTimeout(()=>{
|
|
|
+ mittBus.emit('stationChangeRefresh', res[0].stationId);
|
|
|
+ Session.set("currentStationId",res[0].stationId)
|
|
|
+ },200)
|
|
|
+
|
|
|
+ }
|
|
|
+ }).catch(e => {
|
|
|
+ console.error(e)
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|