This commit is contained in:
fan 2020-11-26 09:09:45 +08:00
commit 78c04585a6
15 changed files with 123 additions and 244 deletions

View File

@ -28,11 +28,6 @@ export default {
loading: false loading: false
}; };
}, },
computed: {
path() {
return window.location.pathname;
}
},
watch: { watch: {
'$store.state.socket.simulationInvite': function (val) { '$store.state.socket.simulationInvite': function (val) {
if (val.creator) { if (val.creator) {
@ -101,7 +96,8 @@ export default {
}, },
subscribe() { subscribe() {
const token = getToken(); const token = getToken();
if (token && this.$route.path != '/404' && !this.path.endsWith('login')) { const path = window.location.pathname;
if (token && this.$route.path != '/404' && !path.endsWith('login')) {
const header = { group: '', 'X-Token': token }; const header = { group: '', 'X-Token': token };
this.$store.dispatch('subscribe', {header, type: getSessionStorage('project')}); this.$store.dispatch('subscribe', {header, type: getSessionStorage('project')});
} }

View File

@ -61,6 +61,15 @@ export function getTrainingStepsDetailNew(trainingId, params) {
params: params params: params
}); });
} }
/** 仿真里加载实训 (新版地图) */
export function loadTrainingInSimulation(group, id) {
return request({
url: `/api/v1/training/${group}/${id}/loadTraining`,
method: 'put'
});
}
/** 查询实训列表(新版地图)*/ /** 查询实训列表(新版地图)*/
export function pageQueryTrainingNew(params) { export function pageQueryTrainingNew(params) {
return request({ return request({

View File

@ -1,14 +1,5 @@
import request from '@/utils/request'; import request from '@/utils/request';
// 检查房间存在
export function checkRoomExistNew(params) {
return request({
url: `/api/simulationRoom`,
method: 'get',
params
});
}
// 设置人员角色 // 设置人员角色
export function putUserRolesNew(data, group) { export function putUserRolesNew(data, group) {
return request({ return request({

View File

@ -140,7 +140,7 @@ export default {
operateType: 'Stand_Whole_Line_Cancel_Hold_Train', operateType: 'Stand_Whole_Line_Cancel_Hold_Train',
skinCode: '02', skinCode: '02',
trainingName: '全线取消扣车({10}-{12}站台)', trainingName: '全线取消扣车({10}-{12}站台)',
trainingRemark: '全线取消扣车功能(默认上行全线/下行全线,不做选择)', trainingRemark: '全线取消扣车功能(默认{12}全线,不做选择)',
trainingType: 'Stand', trainingType: 'Stand',
productTypes: ['02'], productTypes: ['02'],
stepVOList: [ stepVOList: [
@ -153,8 +153,8 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Stand_Whole_Line_Cancel_Hold_Train', operateType: 'Stand_Whole_Line_Cancel_Hold_Train',
skinCode: '02', skinCode: '02',
trainingName: '全线取消扣车({10}-{12}站台)', trainingName: '全线取消扣车({10}-{12}站台 / 取消{14}全线)',
trainingRemark: '全线取消扣车功能(选择上/下行全线)', trainingRemark: '全线取消扣车功能(选择{14}全线)',
trainingType: 'Stand', trainingType: 'Stand',
productTypes: ['02'], productTypes: ['02'],
stepVOList: [ stepVOList: [

View File

@ -101,7 +101,7 @@ export default {
trainingType: 'Stand', trainingType: 'Stand',
productTypes: ['01', '02'], productTypes: ['01', '02'],
stepVOList: [ stepVOList: [
{ deviceType: '06', orderNum: 1, operateCode: '504', tip: '鼠标右键菜单选择【扣车】' }, { deviceType: '06', orderNum: 1, operateCode: '504', tip: '鼠标右键菜单选择【设置扣车】' },
{ deviceType: '06', orderNum: 2, operateCode: '504', tip: '鼠标左键点击【确定】按钮' } { deviceType: '06', orderNum: 2, operateCode: '504', tip: '鼠标左键点击【确定】按钮' }
] ]
}, },
@ -139,7 +139,7 @@ export default {
operateType: 'Stand_Whole_Line_Cancel_Hold_Train', operateType: 'Stand_Whole_Line_Cancel_Hold_Train',
skinCode: '02', skinCode: '02',
trainingName: '全线取消扣车({10}-{12}站台)', trainingName: '全线取消扣车({10}-{12}站台)',
trainingRemark: '全线取消扣车功能(默认上行全线/下行全线,不做选择)', trainingRemark: '全线取消扣车功能(默认{12}全线,不做选择)',
trainingType: 'Stand', trainingType: 'Stand',
productTypes: ['02'], productTypes: ['02'],
stepVOList: [ stepVOList: [
@ -152,8 +152,8 @@ export default {
minDuration: 8, minDuration: 8,
operateType: 'Stand_Whole_Line_Cancel_Hold_Train', operateType: 'Stand_Whole_Line_Cancel_Hold_Train',
skinCode: '02', skinCode: '02',
trainingName: '全线取消扣车({10}-{12}站台)', trainingName: '全线取消扣车({10}-{12}站台 / 取消{14}全线)',
trainingRemark: '全线取消扣车功能(选择上/下行全线)', trainingRemark: '全线取消扣车功能(选择{14}全线)',
trainingType: 'Stand', trainingType: 'Stand',
productTypes: ['02'], productTypes: ['02'],
stepVOList: [ stepVOList: [

View File

@ -952,6 +952,7 @@ const map = {
}, },
updateMapDevices: ({ commit, state }, models) => { updateMapDevices: ({ commit, state }, models) => {
return new Promise((resolve) => { return new Promise((resolve) => {
// debugger;
if (!(models instanceof Array)) { if (!(models instanceof Array)) {
models = [models]; models = [models];
} }
@ -969,7 +970,7 @@ const map = {
}); });
const list = Object.values(dict); const list = Object.values(dict);
handleOperation(state, list); if (window.location.href.includes('/design/usermap/map/draw')) { handleOperation(state, list); }
commit('mapRender', list); commit('mapRender', list);
resolve(list); resolve(list);
}); });

View File

@ -2,8 +2,8 @@
<el-dialog <el-dialog
v-dialogDrag v-dialogDrag
v-dialogLoading="pageLoading" v-dialogLoading="pageLoading"
:title="title" :title="$t('global.synthesisTrainingTitle')"
:visible.sync="show" :visible.sync="dialogShow"
width="600px" width="600px"
:before-close="doClose" :before-close="doClose"
:z-index="2000" :z-index="2000"
@ -17,7 +17,7 @@
class="filter-tree" class="filter-tree"
default-expand-all default-expand-all
:data="trainingList" :data="trainingList"
:props="defaultProps" :props="{label: 'roomName'}"
:filter-node-method="filterNode" :filter-node-method="filterNode"
:style="{height: height+'px'}" :style="{height: height+'px'}"
> >
@ -44,8 +44,6 @@
<script> <script>
import { getSimulationListCantainUser } from '@/api/jointSimulation'; import { getSimulationListCantainUser } from '@/api/jointSimulation';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
export default { export default {
name: 'DeomonList', name: 'DeomonList',
@ -54,45 +52,16 @@ export default {
dialogShow: false, dialogShow: false,
height: 120, height: 120,
trainingList: [], trainingList: [],
defaultProps: {
label: 'roomName'
},
group: '', group: '',
loading: false, loading: false,
pageLoading: false pageLoading: false
}; };
}, },
computed: {
show() {
return this.dialogShow;
},
title() {
return this.$t('global.synthesisTrainingTitle');
},
isWatch() {
return true;
},
isjoin() {
return true;
}
},
methods: { methods: {
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
async subscribe(group) {
if (!this.$store.state.socket.roomIsSubscribe) {
this.clearSubscribe(group);
const header = { group: group || '', 'X-Token': getToken() };
creatSubscribe(`${roomTopic}\/${group}`, header);
await this.$store.dispatch('socket/setRoomSubscribe', true);
}
},
async clearSubscribe(group) {
clearSubscribe(`${roomTopic}\/${group}`);
await this.$store.dispatch('socket/setRoomSubscribe', false);
},
async doShow() { async doShow() {
try { try {
this.pageLoading = true; this.pageLoading = true;

View File

@ -1,8 +1,8 @@
<template> <template>
<el-dialog <el-dialog
v-dialogDrag v-dialogDrag
:title="title" :title="$t('global.synthesisTrainingTitle')"
:visible.sync="show" :visible.sync="dialogShow"
width="600px" width="600px"
:before-close="doClose" :before-close="doClose"
:z-index="2000" :z-index="2000"
@ -20,8 +20,6 @@
<script> <script>
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo } from '@/api/jmap/map';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
// 仿 // 仿
export default { export default {
name: 'DeomonList', name: 'DeomonList',
@ -30,47 +28,23 @@ export default {
dialogShow: false, dialogShow: false,
group: '', group: '',
roomName: '', roomName: '',
state: '',
mapId: '', mapId: '',
lineCode: '', lineCode: '',
loading: false loading: false
}; };
}, },
computed: {
show() {
return this.dialogShow;
},
title() {
return this.$t('global.synthesisTrainingTitle');
}
},
mounted() {
},
methods: { methods: {
doShow(data) { doShow(data) {
this.roomName = data.creator.nickname; this.roomName = data.creator.nickname;
this.group = data.group; this.group = data.group;
this.mapId = data.mapId || data.map.id; this.mapId = data.mapId || data.map.id;
this.lineCode = (data.map || {}).lineCode; this.lineCode = (data.map || {}).lineCode;
this.state = data.state;
this.dialogShow = true; this.dialogShow = true;
this.loading = false; this.loading = false;
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
async subscribe() {
if (!this.$store.state.socket.roomIsSubscribe) {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${roomTopic}\/${this.group}`, header);
await this.$store.dispatch('socket/setRoomSubscribe', true);
}
},
async clearSubscribe() {
clearSubscribe(`${roomTopic}\/${this.group}`);
await this.$store.dispatch('socket/setRoomSubscribe', false);
},
async handleJoin() { async handleJoin() {
try { try {
this.loading = true; this.loading = true;

View File

@ -11,7 +11,7 @@
<p class="list-item"> <p class="list-item">
<span class="list-label">{{ $t('global.permissionList') }}</span> <span class="list-label">{{ $t('global.permissionList') }}</span>
</p> </p>
<limit-list :ref="`limit`" :course-model="courseModel" @initLoadPage="refresh" /> <limit-list ref="limit" :course-model="courseModel" @initLoadPage="refresh" />
</div> </div>
<div class="btn-buy"> <div class="btn-buy">
<el-button v-if="!isLocal" type="success" :disabled="disabled" @click="buy">{{ $t('global.buy') }}</el-button> <el-button v-if="!isLocal" type="success" :disabled="disabled" @click="buy">{{ $t('global.buy') }}</el-button>
@ -31,7 +31,6 @@ import LimitList from '@/views/components/limits/index';
import { getSubSystemDetail } from '@/api/trainingPlatform'; import { getSubSystemDetail } from '@/api/trainingPlatform';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
import localStore from 'storejs'; import localStore from 'storejs';
import { checkRoomExistNew } from '@/api/jointTraining';
export default { export default {
name: 'ExamDetailList', name: 'ExamDetailList',
@ -45,9 +44,7 @@ export default {
tryUser: 0, tryUser: 0,
loading: true, loading: true,
disabled: false, disabled: false,
currentLessonId: '',
currentPrdType: '', currentPrdType: '',
productList: [],
courseModel: { courseModel: {
id: '', id: '',
name: '', name: '',
@ -57,8 +54,6 @@ export default {
prdType: '', prdType: '',
pmsList: [] pmsList: []
}, },
jointShow: false,
jointGroup: '',
lineCode:'', lineCode:'',
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts'] loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts']
}; };
@ -109,7 +104,7 @@ export default {
try { try {
res = await getPublishMapInfo(this.mapId); res = await getPublishMapInfo(this.mapId);
} catch (error) { } catch (error) {
if (error.code == 30001) { if (error.code == 30001 || error.code == 10007) {
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id + this.project); const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id + this.project);
localStore.remove(); localStore.remove();
if (url) { if (url) {
@ -168,20 +163,6 @@ export default {
refresh() { refresh() {
this.loadInitData(); this.loadInitData();
}, },
async getJointTrainingList() {
try {
if (this.mapId) {
const res = await checkRoomExistNew({mapId: this.mapId});
this.jointGroup = res.data;
this.jointShow = false;
if (res.data) {
this.jointShow = true;
}
}
} catch (error) {
console.error(error, '获取是否拥有综合演练房间');
}
},
async enterIntegratedSimulation() { async enterIntegratedSimulation() {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType }; const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
createSimulationNew(data).then(resp => { createSimulationNew(data).then(resp => {
@ -224,54 +205,30 @@ export default {
}); });
}, },
async start() { async start() {
if (this.courseModel.prdType == '05') { const jumpFunc = ['jump', 'jump', 'enterIntegratedSimulation', 'jump', 'jumpScheduling', 'enterISCS', 'enterScreen'];
this.jumpScheduling(); this[jumpFunc[parseInt(this.courseModel.prdType) - 1]]();
} else if (this.courseModel.prdType == '03') { },
this.enterIntegratedSimulation(); jumpSimulation() {
} else if (this.courseModel.prdType == '06') { this.disabled = true;
this.enterISCS(); const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
} else if (this.courseModel.prdType == '07') { createSimulationNew(data).then(resp => {
this.enterScreen(); const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
} else { this.$store.dispatch('training/setPrdType', this.currentPrdType); // prdType
this.jump(); if (this.loadingProjectList.includes(this.project)) {
} this.$store.dispatch('app/transitionAnimations');
}
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
launchFullscreen();
}).catch(error=>{
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
this.disabled = false;
});
}, },
jumpScheduling() { jumpScheduling() {
this.disabled = true; this.jumpSimulation();
setTimeout(() => {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
try {
createSimulationNew(data).then(resp => {
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser };
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations');
}
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
launchFullscreen();
});
} catch (e) {
this.$messageBox(this.$t('error.createSimulationFailed') + e.message);
this.disabled = false;
}
}, 100);
}, },
jump() { jump() {
this.disabled = true; this.jumpSimulation();
setTimeout(() => {
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
createSimulationNew(data).then(resp => {
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
this.$store.dispatch('training/setPrdType', this.currentPrdType); // prdType
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations');
}
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
this.disabled = false;
});
}, 100);
}, },
buy() { buy() {
// this.disabled = true; // this.disabled = true;

View File

@ -163,6 +163,7 @@ export default {
beforeDestroy() { beforeDestroy() {
this.destroy(); this.destroy();
this.clearSubscribe(); this.clearSubscribe();
this.$store.dispatch('runPlan/setPlanData', []);
}, },
methods: { methods: {
async subscribe() { async subscribe() {

View File

@ -53,6 +53,10 @@ export default {
}); });
} }
}, },
beforeDestroy() {
this.$store.dispatch('runPlan/setPlanData', []);
this.$store.dispatch('runPlan/setInitialPlanData', []);
},
mounted() { mounted() {
// this.menus = this.$theme.loadPlanComponent(this.$route.query.lineCode); // this.menus = this.$theme.loadPlanComponent(this.$route.query.lineCode);
}, },

View File

@ -24,7 +24,7 @@
</template> </template>
<script> <script>
import { getTrainingDetailNew } from '@/api/jmap/training'; // import { getTrainingDetailNew } from '@/api/jmap/training';
import TipTrainingDetail from './tipTrainingDetail'; import TipTrainingDetail from './tipTrainingDetail';
import LeftSlider from './LeftSlider'; import LeftSlider from './LeftSlider';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
@ -33,7 +33,7 @@ import { startTrainingNew, endTrainingNew } from '@/api/jmap/training';
import { trainingNotifyNew } from '@/api/simulation'; import { trainingNotifyNew } from '@/api/simulation';
import { TrainingMode, UrlConfig } from '@/scripts/ConstDic'; import { TrainingMode, UrlConfig } from '@/scripts/ConstDic';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { getTrainingStepsDetailNew } from '@/api/jmap/training'; import { getTrainingStepsDetailNew, loadTrainingInSimulation } from '@/api/jmap/training';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
export default { export default {
@ -117,14 +117,16 @@ export default {
this.tipInfo({ color: val.color, message: val.errMsg }); this.tipInfo({ color: val.color, message: val.errMsg });
}, },
async $route() { async $route() {
await this.initData(); loadTrainingInSimulation(this.group, this.$route.query.trainingId).then(resp => {
await this.getTrainingData(); this.setTrainingData(resp);
this.endViewLoading(true); this.endViewLoading(true);
}).catch(error => {
this.endViewLoading(true);
this.$messageBox(`初始化实训内容失败: ${error.message}`);
});
this.resetTraining();
} }
}, },
mounted() {
this.initData();
},
methods: { methods: {
tipInfo(opt) { tipInfo(opt) {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) { if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
@ -136,18 +138,14 @@ export default {
}); });
} }
}, },
getTrainingData() { setTrainingData(resp) {
if (this.$route.query.trainingId) { this.trainingObj = resp.data;
// this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
getTrainingStepsDetailNew(this.$route.query.trainingId, { group: this.group }).then(resp => { this.$store.dispatch('training/setTrainingData', this.trainingObj); //
this.trainingObj = resp.data; const detail = resp.data;
this.$store.dispatch('training/setTrainingData', this.trainingObj); // this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
const detail = resp.data; },
this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]); resetTraining() {
}).catch(error => {
this.$messageBox(`初始化失败实训内容失败: ${error.message}`);
});
}
this.$store.dispatch('training/end', null); this.$store.dispatch('training/end', null);
this.$store.dispatch('training/reset'); this.$store.dispatch('training/reset');
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
@ -155,9 +153,19 @@ export default {
this.$store.dispatch('training/setStopCountTime'); this.$store.dispatch('training/setStopCountTime');
this.$store.dispatch('training/setScore', 0); this.$store.dispatch('training/setScore', 0);
this.$store.dispatch('training/setTrainingStart', false); this.$store.dispatch('training/setTrainingStart', false);
this.isDisable = false; this.isDisable = false;
}, },
getTrainingData() {
if (this.$route.query.trainingId) {
//
getTrainingStepsDetailNew(this.$route.query.trainingId, { group: this.group }).then(resp => {
this.setTrainingData(resp);
}).catch(error => {
this.$messageBox(`初始化实训内容失败: ${error.message}`);
});
}
this.resetTraining();
},
overallTranslation(flag) { overallTranslation(flag) {
const panel = document.getElementById('leftSlider'); const panel = document.getElementById('leftSlider');
if (flag) { if (flag) {
@ -268,25 +276,6 @@ export default {
} }
} }
}, },
//
async initData() {
// this.$store.dispatch('training/end', null);
if (parseInt(this.$route.query.trainingId)) {
//
//
const resp = await getTrainingDetailNew(this.$route.query.trainingId);
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
if (resp && resp.code == 200) {
// const detail = resp.data;
// await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
} else {
this.$messageBox(`获取实训步骤数据失败`);
this.endViewLoading();
}
} else {
this.endViewLoading();
}
},
// //
endViewLoading(isSuccess) { endViewLoading(isSuccess) {
if (!isSuccess) { if (!isSuccess) {

View File

@ -385,43 +385,42 @@ export default {
}, },
// //
onSelected(em) { onSelected(em) {
console.log(em); console.log(em);
const path = window.location.href; const path = window.location.href;
if (path.includes("/practiceDisplay")){ if (path.includes('/practiceDisplay')) {
if(em.deviceType == "StationStand"){ if (em.deviceType == 'StationStand') {
// console.log(em.deviceType ); // console.log(em.deviceType );
const routeData = this.$router.resolve({ const routeData = this.$router.resolve({
path:'/jlmap3d/trafficplan', path:'/jlmap3d/trafficplan',
query:{ query:{
mapid:this.$route.query.mapId, mapid:this.$route.query.mapId,
group:this.$route.query.group, group:this.$route.query.group,
project: this.$route.query.project, project: this.$route.query.project,
noPreLogout: true, noPreLogout: true,
lineCode:this.$route.query.lineCode, lineCode:this.$route.query.lineCode,
deviceCode:em.deviceCode, deviceCode:em.deviceCode
} }
}); });
window.open(routeData.href, '_blank', 'noopener noreferrer'); window.open(routeData.href, '_blank', 'noopener noreferrer');
} }
if(em.deviceType == "Train"){ if (em.deviceType == 'Train') {
// console.log(em.deviceType ); // console.log(em.deviceType );
const routeData = this.$router.resolve({ const routeData = this.$router.resolve({
path:'/jlmap3d/traffictrain', path:'/jlmap3d/traffictrain',
query:{ query:{
mapid:this.$route.query.mapId, mapid:this.$route.query.mapId,
group:this.$route.query.group, group:this.$route.query.group,
project: this.$route.query.project, project: this.$route.query.project,
noPreLogout: true, noPreLogout: true,
lineCode:this.$route.query.lineCode, lineCode:this.$route.query.lineCode,
deviceCode:em.deviceCode, deviceCode:em.deviceCode
} }
}); });
window.open(routeData.href, '_blank', 'noopener noreferrer'); window.open(routeData.href, '_blank', 'noopener noreferrer');
} }
}else{ } else {
this.$emit('onSelect', em); this.$emit('onSelect', em);
} }
}, },

View File

@ -4,14 +4,14 @@
<span>{{ $t('global.mapList') }}</span> <span>{{ $t('global.mapList') }}</span>
</div> </div>
<div class="left-map-list"> <div class="left-map-list">
<filter-city v-if="!getMapByCode" ref="filerCity" filter-empty :local-param-name="localParamName" @filterSelectChange="refresh" /> <filter-city v-if="!getMapByCode" ref="filerCity" filter-empty local-param-name="training_cityCode" @filterSelectChange="refresh" />
<el-input v-if="!getMapByCode" v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable /> <el-input v-if="!getMapByCode" v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<div style="height: calc(100% - 76px); overflow: auto;"> <div style="height: calc(100% - 76px); overflow: auto;">
<el-tree <el-tree
ref="tree" ref="tree"
:data="treeList" :data="treeList"
node-key="key" node-key="key"
:props="defaultProps" :props="{children: 'children',label: 'name'}"
highlight-current highlight-current
:span="22" :span="22"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@ -52,20 +52,14 @@ export default {
data() { data() {
return { return {
loading: true, loading: true,
defaultShowKeys: [],
filterText: '', filterText: '',
treeList: [], treeList: [],
selected: {}, selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: { node: {
}, },
mapId: '', mapId: '',
expandList: [], expandList: [],
filterSelect: '', filterSelect: ''
localParamName: 'training_cityCode'
}; };
}, },
computed: { computed: {

View File

@ -5,7 +5,7 @@
</div> </div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" /> <drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition> <transition>
<router-view :product-list="productList" /> <router-view />
</transition> </transition>
</div> </div>
</template> </template>
@ -25,19 +25,12 @@ export default {
}, },
data() { data() {
return { return {
widthLeft: 450, widthLeft: 450
productList: []
}; };
}, },
computed: { computed: {
width() { width() {
return this.$store.state.app.width; return this.$store.state.app.width;
},
userId() {
return this.$store.state.user.id;
},
project() {
return getSessionStorage('project');
} }
}, },
mounted() { mounted() {
@ -51,9 +44,11 @@ export default {
const againEnter = getSessionStorage('againEnter') || null; const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter) { if (!againEnter) {
launchFullscreen(); launchFullscreen();
const path = localStore.get('trainingPlatformRoute' + this.userId + this.project); const project = getSessionStorage('project');
const userId = this.$store.state.user.id;
const path = localStore.get('trainingPlatformRoute' + userId + project);
if (path && path.startsWith('/trainingPlatform')) { if (path && path.startsWith('/trainingPlatform')) {
localStore.set('orignalTrainingPlatformRoute' + this.userId + this.project, `/trainingPlatform/permission/${data[0].id}`); localStore.set('orignalTrainingPlatformRoute' + userId + project, `/trainingPlatform/permission/${data[0].id}`);
this.$router.push(path); this.$router.push(path);
} else if (data && data[0]) { } else if (data && data[0]) {
this.$router.push(`/trainingPlatform/permission/${data[0].id}`); this.$router.push(`/trainingPlatform/permission/${data[0].id}`);