Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2023-04-13 16:23:01 +08:00
commit 8593174685
11 changed files with 70 additions and 31 deletions

View File

@ -93,6 +93,9 @@ export default {
if (this.project !== this.$store.state.projectConfig.markKey) {
this.initFrontProjectConfig();
}
},
'$store.state.projectConfig.markKey': function(val) {
if (val) { this.loadingComponent = true; }
}
},
mounted() {
@ -121,7 +124,6 @@ export default {
methods: {
initFrontProjectConfig() {
getFrontProjectConfigByLogin(this.project).then(resp => {
this.loadingComponent = true;
const urlData = handlerUrl();
const { baseApiUrl, baseSite, ossUrl, loginProLogo, browserTitle} = resp.data.viewSetting;
this.$store.dispatch('setBaseUrl', baseApiUrl || urlData.BASE_API);

View File

@ -180,7 +180,7 @@ export default class Train extends Group {
}
if (style.Train.directionArrow.hasArrow) { // 列车运行上下方箭头eg:宁波yi
const arrowPoint = { x: 0, y: 0 };
if (model.trainWindowModel) {
if (model.trainWindowModel && model.trainWindowModel.instance) {
arrowPoint.x = model.trainWindowModel.instance.computedPoint.x;
arrowPoint.y = model.right ? model.trainWindowModel.instance.computedPoint.y + style.Train.directionArrow.distanceBottom : model.trainWindowModel.instance.computedPoint.y - style.Train.directionArrow.distanceTop;
}

View File

@ -1,5 +1,5 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<div class="menus" :style="{width: width + 'px', height: '100%'}">
<menu-bar ref="menuBar" :selected="selected" work="dispatchWork" />
<menu-station-stand ref="menuStationStand" :selected="selected" work="dispatchWork" />
<menu-train ref="menuTrain" :selected="selected" work="dispatchWork" />

View File

@ -1,5 +1,5 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<div class="menus" :style="{width: width + 'px', height: '100%'}">
<menu-bar ref="menuBar" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" work="localWork" />
<menu-train ref="menuTrain" :selected="selected" work="localWork" />

View File

@ -1,5 +1,5 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<div class="menus" :style="{width: width + 'px', height: '100%'}">
<menu-train ref="menuTrain" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />

View File

@ -1,5 +1,5 @@
<template>
<div class="menus" :style="{width: width + 'px'}">
<div class="menus" :style="{width: width + 'px', height: '100%'}">
<menu-bar ref="menuBar" :selected="selected" :login-active="loginActive" :is-ignore-login="isIgnoreLogin" @login="login" />
<menu-train ref="menuTrain" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />

View File

@ -4,14 +4,16 @@ import router from './router/index';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import { setToken, getToken, getSessionStorage, setSessionStorage } from '@/utils/auth';
import { getFrontProjectConfigByLogin} from '@/api/projectConfig';
import localStore from 'storejs';
import { handlerUrl } from '@/utils/baseUrl';
const whiteList = ['/login', '/design/login', '/loginNew', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
// 登录路径判断获取
function getRouteInfo(to) {
let loginPath = '';
const markKey = store.state.projectConfig.markKey;
const markKey = store.state.projectConfig.markKey || getSessionStorage('project');
loginPath = markKey == 'login' ? '/login' : '/login?project=' + markKey;
if (to.query.projectDevice && to.query.type && loginPath.includes('?')) {
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`;
@ -21,8 +23,7 @@ function getRouteInfo(to) {
return loginPath;
}
function handleRoute(to, next, loginPath) {
if (store.getters.roles.length == 0) {
function getInfoAndGenerateRoutes(to, next, loginPath) {
store.dispatch('GetInfo', getToken()).then(res => {
// 根据roles权限生成可访问的路由表
// const roles = res.roles;
@ -41,10 +42,33 @@ function handleRoute(to, next, loginPath) {
next({ path: loginPath });
});
});
}
function handleRoute(to, next, loginPath) {
const project = getSessionStorage('project');
if (store.getters.roles.length == 0) {
if (!store.state.projectConfig.markKey) {
getFrontProjectConfigByLogin(project).then(resp => {
const urlData = handlerUrl();
const { baseApiUrl, baseSite, ossUrl, loginProLogo, browserTitle} = resp.data.viewSetting;
store.dispatch('setBaseUrl', baseApiUrl || urlData.BASE_API);
store.dispatch('setBaseSite', baseSite || urlData.BASE_SITE);
store.dispatch('setOssUrl', ossUrl || urlData.OSS_URL);
store.dispatch('projectConfig/setMarkKey', resp.data.markKey);
store.dispatch('projectConfig/setProjectCode', resp.data.project);
store.dispatch('projectConfig/setViewSetting', resp.data.viewSetting);
document.title = browserTitle;
if (loginProLogo) {
document.querySelector("link[rel*='icon']").href = (ossUrl || urlData.OSS_URL) + '/logo/' + loginProLogo;
}
getInfoAndGenerateRoutes(to, next, loginPath);
}).catch(e => this.$message.error('获取配置数据失败!'));
} else {
getInfoAndGenerateRoutes(to, next, loginPath);
}
} else {
// 除没有动态改变权限的需求可直接next() 删下方权限判断
if (to.path === '/404' && to.redirectedFrom === '/') {
const project = getSessionStorage('project');
next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform');
} else {
next();

View File

@ -4,6 +4,7 @@
<span>{{ $t('global.roomId')+group }}</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="copyGroup">复制</el-button>
<el-button @click="doClose">{{ $t('global.close') }}</el-button>
</span>
</el-dialog>
@ -21,6 +22,13 @@ export default {
};
},
methods: {
copyGroup() {
navigator.clipboard.writeText(this.group).then(() => {
this.$message.success('仿真号已经复制到粘贴板');
}).catch(()=> {
this.$message.error('复制失败!');
});
},
clearModel() {
this.title = '';
},

View File

@ -131,7 +131,7 @@ export default {
this.standCode = '';
this.standList = [];
this.stationStandList.forEach(stand => {
if (stand.stationCode === stationCode) {
if (stand.stationCode === stationCode && !stand.small) {
let dir = '';
if (this.$store.state.map.mapConfig.upRight) {
dir = stand.right ? '上行' : '下行';

View File

@ -304,7 +304,9 @@ export default {
this.changePictureShow('maintainerSelect');
} else if (this.roles === 'DRIVER') {
//
this.changePictureShow('driverAtsWork');
const trainingDesign = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingDesign : false;
console.log('1111111111111111', trainingDesign);
this.changePictureShow(trainingDesign ? 'driverAtsWork' : 'drivingPlan');
}
},
changePictureShow(code) {

View File

@ -8,8 +8,8 @@
</div>
<div class="slider-tree">
<el-scrollbar wrap-class="scrollbar-wrapper" style="background: #fff;">
<template v-for="(training, index) in trainingList">
<div :key="training.id" class="training-name-box" :class="{'active': trainingDetail && trainingDetail.id === training.id}" @click="loadScript(training)">
<template>
<div v-for="(training, index) in trainingList" :key="training.id" class="training-name-box" :class="{'active': trainingDetail && trainingDetail.id === training.id}" @click="loadScript(training)">
<span>{{ `${index + 1}${training.name}` }}</span>
</div>
</template>
@ -53,6 +53,9 @@ export default {
this.handleSliderShow(true);
});
},
beforeDestroy() {
EventBus.$off('handleSliderShow');
},
methods: {
initLoadPage() {
const trainingType = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingType : '';