|
@@ -1,22 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="layout-navbars-breadcrumb-user pr15" :style="{ flex: layoutUserFlexNum }">
|
|
<div class="layout-navbars-breadcrumb-user pr15" :style="{ flex: layoutUserFlexNum }">
|
|
|
|
|
|
|
|
- <!-- 站点切换-->
|
|
|
|
|
- <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>-->
|
|
|
|
|
- <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 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="onComponentSizeChange">
|
|
<el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onComponentSizeChange">
|
|
|
<div class="layout-navbars-breadcrumb-user-icon">
|
|
<div class="layout-navbars-breadcrumb-user-icon">
|
|
@@ -127,7 +111,6 @@ import other from '/@/utils/other';
|
|
|
import mittBus from '/@/utils/mitt';
|
|
import mittBus from '/@/utils/mitt';
|
|
|
import {Session, Local} from '/@/utils/storage';
|
|
import {Session, Local} from '/@/utils/storage';
|
|
|
import u from "/@/utils/u";
|
|
import u from "/@/utils/u";
|
|
|
-import {$body} from "/@/utils/request";
|
|
|
|
|
|
|
|
|
|
// 引入组件
|
|
// 引入组件
|
|
|
const Notification = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/notification.vue'));
|
|
const Notification = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/notification.vue'));
|
|
@@ -153,9 +136,7 @@ const props = defineProps({
|
|
|
const state = reactive({
|
|
const state = reactive({
|
|
|
isScreenfull: false,
|
|
isScreenfull: false,
|
|
|
disabledI18n: 'zh-cn',
|
|
disabledI18n: 'zh-cn',
|
|
|
- disabledSize: 'large',
|
|
|
|
|
- stationList: [],
|
|
|
|
|
- currentStation: {}
|
|
|
|
|
|
|
+ disabledSize: 'large'
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const onSwitchTheme = () => {
|
|
const onSwitchTheme = () => {
|
|
@@ -248,18 +229,6 @@ const onSearchClick = () => {
|
|
|
searchRef.value.openSearch();
|
|
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) => {
|
|
const onComponentSizeChange = (size: string) => {
|
|
@@ -288,26 +257,7 @@ onMounted(() => {
|
|
|
initI18nOrSize('globalComponentSize', 'disabledSize');
|
|
initI18nOrSize('globalComponentSize', 'disabledSize');
|
|
|
initI18nOrSize('globalI18n', 'disabledI18n');
|
|
initI18nOrSize('globalI18n', 'disabledI18n');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- loadStationList();
|
|
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
-const loadStationList = () => {
|
|
|
|
|
- $body(`/washStation/list`, {pageNum: 1,pageSize:1024}).then((res: any) => {
|
|
|
|
|
- let {list} = res;
|
|
|
|
|
- state.stationList = list;
|
|
|
|
|
- if (list && list.length > 0) {
|
|
|
|
|
- state.currentStation = list[0];
|
|
|
|
|
- setTimeout(()=>{
|
|
|
|
|
- mittBus.emit('stationChangeRefresh', list[0].stationId);
|
|
|
|
|
- Session.set("currentStationId",list[0].stationId)
|
|
|
|
|
- },200)
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }).catch(e => {
|
|
|
|
|
- //console.error(e)
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|