Merge remote-tracking branch 'origin/dev' into test

This commit is contained in:
fan 2019-12-26 14:07:28 +08:00
commit 1540119022
23 changed files with 1544 additions and 143 deletions

View File

@ -26,7 +26,8 @@ export default {
if (dataList && dataList.length) { if (dataList && dataList.length) {
if (dataList && dataList.length && dataList[1] && dataList[0]) { if (dataList && dataList.length && dataList[1] && dataList[0]) {
const tIndex = dataList.findIndex(it => { return it[0]; }); // 设置不用过滤行数 // const tIndex = dataList.findIndex(it => { return it[0]; }); // 设置不用过滤行数
const tIndex = 9; // 设置不用过滤行数
/** 解析二维数组为json对象*/ /** 解析二维数组为json对象*/
const reg3 = /^(\d+:\d+:\d+|)/; // 06:12:00 const reg3 = /^(\d+:\d+:\d+|)/; // 06:12:00

View File

@ -22,13 +22,6 @@
</el-menu-item> </el-menu-item>
<deomon-list ref="deomonList" /> <deomon-list ref="deomonList" />
<qcode ref="qcode" /> <qcode ref="qcode" />
<el-switch
v-if="showMapSwitch"
v-model="switchNewMap"
active-text="新版地图"
inactive-text="老版地图"
@change="changeSwitch"
/>
</div> </div>
</div> </div>
</template> </template>
@ -88,8 +81,7 @@ export default {
], ],
stomp: null, stomp: null,
header: null, header: null,
lang: 'zh', lang: 'zh'
switchNewMap: false
}; };
}, },
computed: { computed: {
@ -101,9 +93,6 @@ export default {
}, },
isShown() { isShown() {
return getSessionStorage('project') == 'login' || getSessionStorage('project') == 'design'; return getSessionStorage('project') == 'login' || getSessionStorage('project') == 'design';
},
showMapSwitch() {
return process.env.NODE_ENV === 'development' && !getSessionStorage('project').startsWith('design');
} }
}, },
watch: { watch: {
@ -113,7 +102,6 @@ export default {
if (nowLang === 'zh') { if (nowLang === 'zh') {
this.lang = 'en'; this.lang = 'en';
} }
this.switchNewMap = this.$store.state.config.switchMap === 'new';
}, },
methods: { methods: {
quickEntry() { quickEntry() {
@ -163,9 +151,6 @@ export default {
break; break;
} }
return path; return path;
},
changeSwitch(value) {
this.$store.dispatch('config/changeSwitchMap', value ? 'new' : 'old' );
} }
} }
}; };

View File

@ -14,6 +14,7 @@ const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation')
const Jlmap3dModel = () => import('@/views/jlmap3d/device/jl3ddevice'); const Jlmap3dModel = () => import('@/views/jlmap3d/device/jl3ddevice');
const Jlmap3dTrain = () => import('@/views/jlmap3d/devicetrain/jl3ddevicetrain'); const Jlmap3dTrain = () => import('@/views/jlmap3d/devicetrain/jl3ddevicetrain');
const Display = () => import('@/views/display/index'); const Display = () => import('@/views/display/index');
const DisplayNew = () => import('@/views/display/indexNew');
const DesignDisplay = () => import('@/views/display/designIndex'); const DesignDisplay = () => import('@/views/display/designIndex');
const TrainRoom = () => import('@/views/trainRoom/index'); const TrainRoom = () => import('@/views/trainRoom/index');
@ -149,6 +150,7 @@ export const userTrainingPlatform = '016'; // 实训平台
export const UrlConfig = { export const UrlConfig = {
display: '/display', display: '/display',
displayNew: '/displayNew',
scriptDisplay: '/scriptDisplay', scriptDisplay: '/scriptDisplay',
examRuleDraft: '/examRule/draft', examRuleDraft: '/examRule/draft',
examRuleManage: '/examRule/manage', examRuleManage: '/examRule/manage',
@ -453,6 +455,13 @@ export const asyncRouter = [
}, },
hidden: true hidden: true
}, },
{
path: '/displayNew/:mode',
component: DisplayNew,
meta: {
},
hidden: true
},
{ {
path: '/design/display/:mode', path: '/design/display/:mode',
component: DesignDisplay, component: DesignDisplay,

View File

@ -61,7 +61,8 @@ export default {
}, },
jointShow: false, jointShow: false,
jointGroup: '', jointGroup: '',
lineCode:'' lineCode:'',
drawWay: false //
}; };
}, },
computed: { computed: {
@ -104,6 +105,7 @@ export default {
const resp = await getSubSystemDetail(this.$route.params.subSystem); const resp = await getSubSystemDetail(this.$route.params.subSystem);
this.tryUser = 0; this.tryUser = 0;
this.loading = false; this.loading = false;
this.drawWay = res.data.drawWay;
if (resp.data.mapPrd) { if (resp.data.mapPrd) {
this.courseModel = { this.courseModel = {
id: resp.data.mapPrd.id, id: resp.data.mapPrd.id,
@ -235,7 +237,11 @@ export default {
const data = { mapId: this.courseModel.mapId, mapPrdId: this.currentPrdId }; const data = { mapId: this.courseModel.mapId, mapPrdId: this.currentPrdId };
simulationNotify(data).then(resp => { simulationNotify(data).then(resp => {
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdId, goodsId: this.goodsId, try: this.tryUser }; const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdId, goodsId: this.goodsId, try: this.tryUser };
if (this.drawWay) { //
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
} else {
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query }); this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
}
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message); this.$messageBox(this.$t('error.createSimulationFailed') + error.message);

View File

@ -532,12 +532,12 @@ export default {
this.drivingShow = true; this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group); this.$refs.Jl3dDrive.show(this.mapId, this.group);
} else { } else {
let routeData = this.$router.resolve({ const routeData = this.$router.resolve({
  path:'/jlmap3d/sandbox', path:'/jlmap3d/sandbox',
query:{ query:{
mapid:this.mapId, mapid:this.mapId,
group:this.group, group:this.group,
token:getToken(), token:getToken()
} }
}); });
window.open(routeData.href, '_blank', 'noopener noreferrer'); window.open(routeData.href, '_blank', 'noopener noreferrer');

View File

@ -0,0 +1,593 @@
<template>
<div class="main" :style="{width: canvasWidth+'px'}" @mousemove="mousemove">
<div v-show="panelShow" :panelShow="panelShow">
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<menu-exam v-if="isExam" ref="menuExam" :offset="offset" :group="group" />
<menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :group="group" :training-obj="trainingObj" />
<menu-demon
v-if="isDemon"
ref="menuDemon"
:offset="offset"
:group="group"
:quest-id="questId"
@tryTime="tryTime"
@hidepanel="hidepanel"
@devicemodel="devicemodel"
@quitQuest="quitQuest"
@showScheduling="showScheduling"
/>
<menu-screen v-if="isScreen" ref="menuScreen" :offset="offset" :group="group" @tryTime="tryTime" />
<menu-plan v-if="isPlan" ref="menuPlan" :offset="offset" :group="group" />
<menu-replay v-if="isReplay" ref="menuReplay" :offset="offset" :group="group" />
<menu-script v-if="isScript" ref="menuScript" :offset="offset" :group="group" />
<menu-schema
v-if="isDemon || isPlan || isScript "
ref="menuSchema"
:offset="offset"
:group="group"
@switchMode="switchMode"
@selectQuest="selectQuest"
/>
<menu-system-time ref="menuSystemTime" :offset="offset" :right="right" :group="group" />
</div>
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
<Jl3d-Device v-if="deviceShow" ref="Jl3dDevice" :panel-show="deviceShow" @showdevice="showdevice" />
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />
</div>
</template>
<script>
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import MenuExam from '@/views/display/menuExam';
import MenuLesson from '@/views/display/menuLesson';
import MenuReplay from '@/views/display/menuReplay';
import MenuDemon from '@/views/display/menuDemon';
import MenuScreen from '@/views/display/menuScreen';
import MenuSchema from '@/views/display/menuSchema';
import MenuSystemTime from '@/views/display/menuSystemTime';
import MenuPlan from '@/views/display/menuPlan';
import MenuScript from '@/views/display/menuScript';
import Scheduling from './demon/scheduling';
import { mapGetters } from 'vuex';
import { getTrainingDetail, getTrainingStepsDetail } from '@/api/jmap/training';
import { setGoodsTryUse } from '@/api/management/goods';
import { getProductDetail } from '@/api/management/mapprd';
import { runDiagramQuit, loadScript, getSimulationInfo } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import Vue from 'vue';
//
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
import { getToken } from '@/utils/auth';
export default {
name: 'DisplayDraft',
components: {
MenuExam,
MenuLesson,
MenuReplay,
MapSystemDraft,
MenuPlan,
MenuDemon,
MenuScreen,
MenuScript,
MenuSchema,
MenuSystemTime,
// Jl3dSimulation,
Jl3dDrive,
Jl3dDevice,
Scheduling
},
props: {
size: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
mode: '',
trainingObj: {},
timeDemonNum: 0,
checkLine: null,
offset: 15,
mouseNum: 1,
ierval: null,
mouseNumTime: 0,
mapBox: null,
mapBoxP: null,
panelShow: true,
simulationShow: false,
drivingShow: false,
deviceShow: false,
questId: 0, // Id
group: '',
prdTypeMap: {
'01': '01', // =>
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
}
};
},
computed: {
...mapGetters([
'canvasWidth'
]),
...mapGetters('map', [
'map'
]),
...mapGetters('training', [
'offsetStationCode'
]),
...mapGetters('config', [
'canvasId'
]),
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
},
right() {
return this.$store.state.config.width / 2 - 55;
},
trainingId() {
return this.$route.query.trainingId;
},
mapId() {
return this.$route.query.mapId;
},
prdType() {
return this.$route.query.prdType;
},
skinCode() {
return this.$route.query.skinCode;
},
isLesson() {
return this.mode === 'teach' || this.mode === 'record' || this.mode === 'manage';
},
isExam() {
return this.mode === 'exam';
},
isDemon() {
return this.mode === 'demon';
},
isScreen() { //
return this.mode === 'dp';
},
isReplay() { //
return this.mode === 'replay';
},
isScript() {
return this.mode === 'script';
},
isPlan() {
return this.mode === 'plan';
},
isDrive() {
return this.prdType == '04';
},
isShowScheduling() {
return this.$route.query.prdType == '05';
}
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
'$store.state.map.mapViewLoadedCount': function (val) {
this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBox = document.getElementsByTagName('canvas');
if (this.trainingId) {
getTrainingStepsDetail(this.trainingId, { group: this.group }).then(resp => {
this.trainingObj = resp.data;
this.$store.dispatch('training/setTrainingData', this.trainingObj);
});
}
},
'$store.state.socket.permissionOver': function () {
this.$alert('用户权限已被收回', '提示', {
confirmButtonText: '确定',
callback: action => {
this.back();
}
});
},
'size.width': function(val) {
this.setWindowSize();
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
$route() {
this.$nextTick(() => {
this.initLoadData();
});
}
},
async created() {
this.mode = this.$route.params.mode;
this.group = this.$route.query.group || '';
},
async mounted() {
EventBus.$on('clearCheckLogin', () => {
this.clearCheckLogin();
});
await this.setWindowSize();
await this.initLoadData();
},
async beforeDestroy() {
await this.clearAllTimer();
if (!this.isReplay) {
await this.quit();
}
await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear');
EventBus.$off('clearCheckLogin');
},
methods: {
// 线
clearAllTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
this.ierval = null;
}
if (this.checkLine) {
clearTimeout(this.checkLine);
this.checkLine = null;
}
},
// 线
checkLoginLineTimer() {
if (this.checkLine) {
clearTimeout(this.checkLine);
}
this.checkLine = setInterval(() => {
checkLoginLine();
}, 5000 * 60);
},
//
checkMouseStatusTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
}
this.ierval = setInterval(() => {
if (this.mouseNum) {
this.mouseNum = 0;
this.mouseNumTime = 0;
} else {
this.mouseNumTime += 1;
}
if (this.mapBox) {
if (this.mouseNumTime >= 15) {
for (let i = 0; i < this.mapBox.length; i++) {
this.mapBox[i].style.cursor = 'none';
}
} else {
for (let i = 0; i < this.mapBox.length; i++) {
this.mapBox[i].style.cursor = '';
}
}
}
}, 1000);
},
mousemove(e) {
this.mouseNum = 1;
},
setPosition() {
this.$nextTick(() => {
let offset = 15;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
if (menuBar) {
offset += (menuBar.offsetHeight || 0);
}
if (menuTool) {
offset += (menuTool.offsetHeight || 0);
}
if (this.offset != offset) {
this.offset = offset;
}
});
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
// 仿
async loadSimulationInfo() {
const resp = await getSimulationInfo(this.group);
if (resp && resp.code == 200) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
this.questId = Number(resp.data.questId) || 0;
}
},
//
async initLoadData() {
this.$store.dispatch('training/reset');
try {
if (!this.isReplay) {
await this.loadSimulationInfo();
}
if (this.isReplay) {
await this.initLoadReplayData();
} else if (this.isDemon) {
await this.initLoadDemonData();
} else if (this.isScreen) {
await this.initLoadScreenData();
} else if (this.isPlan) {
await this.initLoadTestRunData();
} else if (this.isScript) {
await this.initLoadTaskData();
} else {
await this.initLoadLessonOrExamData();
}
this.checkLoginLineTimer();
this.checkMouseStatusTimer();
} catch (error) {
this.$messageBox(`初始化失败: ${error.message}`);
this.endViewLoading();
}
},
//
async initLoadLessonOrExamData() {
this.$store.dispatch('training/end', null);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (parseInt(this.trainingId)) {
//
//
const resp = await getTrainingDetail(this.trainingId);
if (resp && resp.code == 200) {
const detail = resp.data;
const rest = await getProductDetail(detail.prdId);
if (rest && rest.code == 200) {
const data = rest.data;
await this.$store.dispatch('training/setPrdType', data.prdType);
await this.loadMapDataById(this.mapId);
}
} else {
this.$messageBox(`获取实训步骤数据失败`);
this.endViewLoading();
}
} else {
this.endViewLoading();
}
},
//
async initLoadReplayData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '');
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
},
// 仿
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]);
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
},
//
async initLoadScreenData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '01');
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
},
//
async initLoadTaskData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.switchMode('01');
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
},
//
async initLoadTestRunData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '01');
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
},
//
async selectQuest(row, id, mapLocation, roleName) {
try {
const res = await loadScript(row.id, id, this.group);
if (res && res.code == 200) {
this.questId = parseInt(row.id);
if (mapLocation) {
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
}
if (this.$refs.menuDemon) {
await this.$refs.menuDemon.initLoadPage();
}
if (this.$refs.menuScript) {
await this.$refs.menuScript.initLoadPage();
}
} catch (error) {
this.$messageBox(error.message);
}
},
// 退
async quitQuest() {
this.questId = 0;
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
},
// id
async loadMapDataById(mapId) {
try {
await loadMapDataById(mapId);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
// 仿
async quit() {
await runDiagramQuit(this.group);
await this.$store.dispatch('training/over');
},
// 仿退
async back() {
if (this.isExam) {
await this.$refs.menuExam.back();
} else if (this.isLesson) {
await this.$refs.lessonMenu.back();
} else if (this.isDemon) {
await this.$refs.menuDemon.back();
} else if (this.isScreen) {
await this.$refs.menuScreen.back();
} else if (this.isPlan) {
await this.$refs.menuPlan.back();
} else if (this.isScript) {
await this.$refs.menuScript.back();
}
},
// 使
async tryTime(param) {
const data = {
goodsId: param.goodsId,
time: param.time
};
if (data.goodsId) {
await setGoodsTryUse(data);
}
},
switchMode(prdType) {
this.$store.dispatch('training/setPrdType', prdType);
},
hidepanel() {
if (this.isDrive) {
this.panelShow = false;
this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group);
} else {
const routeData = this.$router.resolve({
path:'/jlmap3d/sandbox',
query:{
mapid:this.mapId,
group:this.group,
token:getToken()
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
}
},
devicemodel() {
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
},
showScheduling() {
this.$refs.scheduling.doShow();
},
showpanel() {
this.panelShow = true;
this.simulationShow = false;
},
showdriving() {
this.panelShow = true;
this.drivingShow = false;
},
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.width;
const height = this.size ? this.size.height : this.height;
this.$store.dispatch('config/resize', { width, height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
}
}
};
</script>
<style>
.main {
z-index: 10;
display: block;
width: 100%;
height: 100%;
overflow: hidden;
-moz-user-select: none;
-o-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>

View File

@ -0,0 +1,164 @@
<template>
<div id="_Tips_Start_Position" class="mapContext">
<training-tips ref="trainingTips" />
<component :is="menus" :selected="selected" />
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" @onMenu="contextmenu" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getDeviceMenuByDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { letfMouseSelectDevice } from '@/api/simulation';
import deviceType from '@/jmap/constant/deviceType';
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import TrainingTips from '@/views/mapsystem/plugin/trainingtip';
export default {
name: 'LessonCanvas',
components: {
JlmapVisual,
TrainingTips
},
data() {
return {
selected: null,
menus: null,
point: {
x: 0,
y: 0
}
};
},
computed: {
...mapGetters('menuOperation', [
'buttonOperation'
]),
Signal() {
return OperationEvent.Signal;
},
isScreen() {
return this.$route.params.mode === 'dp';
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.map.mapDataLoadedCount': function () {
const lineCode = this.$jlmap.lineCode;
if (lineCode) {
this.menus = this.$theme.loadMenuComponent(lineCode);
}
}
},
beforeDestroy() {
if (this.autoSaveTask) {
clearInterval(this.autoSaveTask);
}
},
methods: {
//
getDeviceByEm(em) {
var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null;
if (device) {
device._viewVal = em.val;
}
return device;
},
//
getSelectedByLineCode(device) {
const switchSectionIsWitchLineCodeList = ['03'];
const lineCode = this.$store.getters['map/lineCode'];
if (switchSectionIsWitchLineCodeList.includes(lineCode) && device._type == deviceType.Section) {
const section = this.$store.getters['map/getDeviceByCode'](device._code);
if (section) {
device = this.$store.getters['map/getDeviceByCode'](section.relSwitchCode);
}
}
return device;
},
clickEvent(em) {
var device = { _type: em.deviceType, _code: em.deviceCode };
var CanClickDeviceList = [
deviceType.Switch,
deviceType.Signal,
deviceType.StationStand
];
if (em.deviceCode) {
device = this.getDeviceByEm(em);
if (CanClickDeviceList.includes(em.deviceType)) {
try {
letfMouseSelectDevice(em.deviceCode, this.group);
} catch (error) {
console.log('send left mouse click error.');
}
}
}
this.selected = device;
this.$store.dispatch('menuOperation/setSelected', device);
this.$store.dispatch('training/emitTipFresh');
},
contextmenu(em) {
var menu = null;
var device = null;
this.point = { x: em.clientX, y: em.clientY };
if (em.subType === 'TrainWindow') {
device = { _type: deviceType.Train, code: em.deviceCode };
this.$store.dispatch('map/setTrainWindowShow', true);
} else if (em.deviceCode && !this.isScreen) {
device = this.getDeviceByEm(em);
}
if (device) {
this.selected = device = this.getSelectedByLineCode(device);
if (!this.buttonOperation) {
this.$store.dispatch('menuOperation/setSelected', device);
if (!this.checkShouldPop(device)) {
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: null });
} else {
menu = getDeviceMenuByDeviceType(device._type);
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
}
} else {
menu = getDeviceMenuByDeviceType('Cancel');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
this.$store.dispatch('training/emitTipFresh');
},
checkShouldPop(device) {
const lineCode = this.$store.getters['map/lineCode'];
if (device._type === 'Signal') {
return device._viewVal === '3';
} else if (device._type === 'StationControl' && lineCode == '01') { //
return device._viewVal === '1';
} else {
return true;
}
},
mapViewLoaded(loading) {
this.$refs.jlmapVisual && this.$refs.jlmapVisual.mapViewLoaded(loading);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.mapContext {
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "PingFang SC", Arial, consolas;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 100%;
min-height: 100%;
}
</style>

View File

@ -0,0 +1,134 @@
<template>
<div class="mainContext">
<map-common ref="mapCommon" />
</div>
</template>
<script>
import MapCommon from './common/index';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
import { sendCommand } from '@/api/jmap/training';
import { getSessionStorage } from '@/utils/auth';
export default {
name: 'MapSystemDraft',
components: {
MapCommon
},
data() {
return {
topic: '/user/queue/training',
stomp: null,
currentMap: null,
mode: '',
isDesignPlatform: false,
group: ''
};
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) {
this.subscribe();
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length) {
this.statusMessage(val);
}
},
'$store.state.socket.trainStationList': function (val) {
if (val.length) {
this.runFactMessage(val);
}
},
'$store.state.socket.simulationError': function (val) {
if (val) {
this.simulationError(val);
}
},
'$store.state.socket.simulationReset': function (val) {
if (val) {
this.simulationReset(val);
}
}
},
mounted() {
window.onbeforeunload = this.clearSubscribe;
this.mode = this.$route.params.mode || '';
this.group = this.$route.query.group || '';
this.currentMap = this.$refs.mapCommon;
this.$nextTick(() => {
setTimeout(() => {
this.$store.dispatch('config/resetCanvasOffset');
}, 100);
});
this.isDesignPlatform = getSessionStorage('project').startsWith('design');
},
beforeDestroy() {
this.clearSubscribe();
},
methods: {
async mapViewLoaded(loading) {
this.currentMap.mapViewLoaded(loading);
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
await this.$store.dispatch('socket/setEquipmentStatus');
},
async runFactMessage(list) {
await this.$store.dispatch('runPlan/updateRunPlanData', list);
await this.$store.dispatch('socket/setTrainStationList');
},
async simulationError() {
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('socket/setSimulationError');
await this.$store.dispatch('training/setMapDefaultState');
this.clearSubscribe();
this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'),
showCancelButton: false,
type: 'warning'
}).then(() => {
this.$emit('back');
}).catch(() => {
});
},
async simulationReset() {
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('training/over');
await this.$store.dispatch('socket/setSimulationReset');
await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('training/setMapDefaultState');
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`);
},
sendDeviceChangeEvent(data, header) {
//
sendCommand('', data).then(response => {
}).catch(error => {
console.error(error);
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.mainContext {
font-family: "Helvetica Neue ", Helvetica, "PingFang SC ", "Hiragino Sans GB ", "Microsoft YaHei ", "PingFang SC ", Arial, consolas;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>

View File

@ -0,0 +1,35 @@
<template>
<div v-if="delayShow">
<div v-for="item in stationList">
<delay-info v-if="item.delayInfo" :delay-info-list="item.delayInfo" position="item.points" />
</div>
</div>
</template>
<script>
import DelayInfo from './delayInfo';
export default {
name: 'DelayBox',
components: {
DelayInfo
},
data() {
return {
delayShow: false,
stationList: []
};
},
watch: {
'$store.state.map.stationList': function(val) {
this.stationList = val;
}
},
methods: {
}
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,72 @@
<template>
<div v-show="showDelayBox" class="info_box" :style="{left: tPosition.x+'px', top: tPosition.y+'px' }">
<el-scrollbal>
<div v-for="item in delayInfoList"><span>人解</span><span>信号机名</span><span>时间</span></div>
</el-scrollbal>
</div>
</template>
<script>
export default {
name: 'DelayInfo',
props: {
delayInfoList: {
type: Object,
required: true,
default: function () {
return [];
}
},
position: {
type: Object,
required: true,
default: function () {
return {
x: 0,
y: 0
};
}
}
},
data() {
return {
tPosition: {
x: 0,
y: 0
},
showDelayBox: true
};
},
watch: {
'position.x': function (val) {
this.handlePosition();
},
'position.y': function (val) {
this.handlePosition();
}
},
methods: {
handlePosition() {
const offset = this.$store.state.config.canvasOffset;
this.tPosition = {
x: this.position.x + offset.x,
y: this.position.y + offset.y
};
if (this.tPosition.x < 0 || this.tPosition < 0) {
this.showDelayBox = false;
} else {
this.showDelayBox = true;
}
}
}
};
</script>
<style scoped>
.info_box{
border-top:1px solid #fff;
height: auto;
max-height: 200px;
background-color: #000;
}
</style>

View File

@ -0,0 +1,172 @@
<template>
<div id="pop_tip_dialog" class="pop-dialog" :style="{ height: 'auto', left: tPosition.x+'px', top: tPosition.y+'px' }">
<div ref="tipRef" class="pop-content" style="text-align: center;" :style="{ width: width + 'px' }">
<p style="color: black;">{{ tip }}</p>
<div v-show="tPosition.align === 'top'" x-arrow class="popper__arraw_top" :style="{left: arrawLeft+'px'}" />
<div v-show="tPosition.align === 'bottom'" x-arrow class=" popper__arraw_bottom" :style="{left: arrawLeft+'px'}" />
</div>
</div>
</template>
<script>
export default {
name: 'PopTip',
props: {
position: {
type: Object,
required: true,
default: function () {
return {
x: 0,
y: 0
};
}
},
tip: {
type: String,
required: true
}
},
data() {
return {
defaultFontSize: 14,
maxWidth: 300,
tPosition: {
x: -300,
y: -300,
align: 'bottom'
},
offset: 7
};
},
computed: {
width() {
let width = this.tip.length * this.defaultFontSize + 40;
if (width > this.maxWidth) {
width = this.maxWidth;
}
return width;
},
arrawLeft() {
return this.width / 5;
}
},
watch: {
'position.x': function (val) {
this.resetShowPosition();
},
'position.y': function (val) {
this.resetShowPosition();
},
'tip': function (val) {
this.resetShowPosition();
}
},
mounted() {
this.resetShowPosition();
},
methods: {
resetShowPosition() {
const self = this;
this.$nextTick(() => {
//
const height = self.$el.clientHeight;
self.tPosition.align = self.position.align || 'bottom';
self.tPosition.x = self.position.x - (this.arrawLeft + this.offset);
if (self.tPosition.align == 'top') {
const distance = 47;
self.tPosition.y = self.position.y + (distance);
} else if (self.tPosition.align == 'bottom') {
const distance = 5;
self.tPosition.y = self.position.y - (height + distance);
}
if (self.tPosition.x < 0) self.tPosition.x = 0;
if (self.tPosition.y < 0) self.tPosition.y = 0;
});
},
reset() {
this.tPosition = {
x: -300,
y: -300
};
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
$bg: #FFDD00;
$hoverBg: #f5f7fa;
.pop-dialog {
background-color: $bg;
border-radius: 6px;
position: fixed;
padding: 7px 0px;
z-index: 9998;
.pop-content {
.popper__arraw_bottom {
position: absolute;
height: 14px;
width: 14px;
background: $bg;
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.popper__arraw_top {
position: absolute;
height: 14px;
width: 14px;
top: -7px;
background: $bg;
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.popper__arraw_left {
position: absolute;
height: 14px;
width: 14px;
left: -7px;
background: $bg;
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.popper__arraw_right {
position: absolute;
height: 14px;
width: 14px;
right: -7px;
background: $bg;
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
}
.dsp-block {
display: block;
text-align: left;
padding: 6px 15px;
width: 100%;
border-radius: unset;
}
.dsp-block:hover {
background-color: $hoverBg;
}
}
</style>

View File

@ -0,0 +1,24 @@
<template>
<div>
<p style="text-align: center;">{{ tip }}</p>
</div>
</template>
<script>
export default {
name: 'Tip',
props: {
tip: {
type: String,
required: true
}
},
data() {
return {
defaultFontSize: 14
};
},
methods: {
}
};
</script>

View File

@ -0,0 +1,181 @@
<template>
<div v-if="tipShow">
<pop-tip v-show="popShow" :position="position" :tip="tip" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import PopTip from '@/views/mapsystem/plugin/src/poptip';
import { getDeviceTypeByDic, getDomIdByOperation } from '@/scripts/ConstDic';
import { getDomOffset } from '@/utils/index';
export default {
name: 'TrainingTips',
components: { PopTip },
data() {
return {
tipShow: false,
popShow: false,
position: {
x: 0,
y: 0
},
tip: ''
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
])
},
watch: {
'$store.state.training.tipEvent': function (val) {
this.tipInit();
}
},
methods: {
tipInit() {
this.$nextTick(() => {
this.$store.dispatch('training/isTeachMode').then(() => {
this.tipShow = true;
const offset = this.$store.state.config.canvasOffset;
if (this.$store.state.training.started) {
const order = this.$store.state.training.order;
const steps = this.$store.state.training.steps;
if (order > -1 && order < steps.length) {
const step = steps[order];
const distance = 5;
this.tip = step.tip;
/** 如果mbm或者bar的处理*/
if (step.type === 'mbm' || step.type === 'bar') {
const position = this.getOtherTipPoint(step);
if (position) {
this.position = position;
this.position.y -= distance;
this.popTipShow();
}
} else if (step.code) {
/** 默认是shape类型如果找不到坐标则可以认为是存在code的dailog*/
const position = this.getShapeTipPoint(step);
if (position) {
this.position = {
x: position.x + offset.x,
y: position.y + offset.y - distance
};
this.popTipShow();
} else {
const position = this.getOtherTipPoint(step);
if (position) {
this.position = position;
this.position.y -= distance;
this.popTipShow();
}
}
} else {
/** 不存在code字段的dialog处理*/
const position = this.getOtherTipPoint(step);
if (position) {
this.position = position;
this.position.y -= distance;
this.popTipShow();
} else {
this.popTipHide();
}
}
} else {
this.tipShow = false;
}
} else {
this.tipShow = false;
}
}).catch(() => {
this.tipShow = false;
});
});
},
popTipShow() {
this.popShow = true;
},
popTipHide() {
this.popShow = false;
},
//
getShapeTipPoint(step) {
var position = null;
const type = getDeviceTypeByDic(step.type);
if (type) {
position = this.$jlmap.getShapeTipPoint({
code: step.code,
val: step.val
});
if (position) {
if (position.x < 0) {
position.x = 0;
}
if (position.x > this.canvasWidth) {
position.x = this.canvasWidth;
}
if (position.y < 0) {
position.y = 0;
}
if (position.y > this.canvasHeight) {
position.y = this.canvasHeight;
}
}
}
return position;
},
//
getOtherTipPoint(step) {
const domId = getDomIdByOperation(step.operation);
const btnDom = document.getElementById(domId);
if (btnDom) {
const offset = getDomOffset(btnDom, true);
if (offset.x == 0 && offset.y == 0) {
return null;
}
let align = 'bottom';
if (this.tipAlignIsTop(step, domId)) {
align = 'top';
}
return {
align: align,
x: offset.x + btnDom.clientWidth / 2,
y: offset.y
};
}
return null;
},
tipAlignIsTop(step, domId) {
// tip
if (step.type.toUpperCase() === 'bar'.toUpperCase()) {
return true;
}
if (/{TOP}/.test(domId)) {
return false;
}
if (/{BOTTOM}/.test(domId)) {
return true;
}
// domId
const keyList = ['choose', 'select'];
for (var key in keyList) {
if (domId.toUpperCase().indexOf(keyList[key].toUpperCase()) !== -1) {
return false;
}
}
//
return true;
}
}
};
</script>

View File

@ -1,4 +1,5 @@
<template> <template>
<div v-show="show">
<el-dialog v-dialogDrag :title="$t('map.routePreview')" :visible.sync="show" width="95%" :before-do-close="doClose"> <el-dialog v-dialogDrag :title="$t('map.routePreview')" :visible.sync="show" width="95%" :before-do-close="doClose">
<div> <div>
<QueryListPage <QueryListPage
@ -11,19 +12,23 @@
<pre-view-field ref="previewField" :map-info="mapInfo" /> <pre-view-field ref="previewField" :map-info="mapInfo" />
<protect-detail ref="protectDetail" :map-info="mapInfo" /> <protect-detail ref="protectDetail" :map-info="mapInfo" />
</el-dialog> </el-dialog>
<related ref="related" :map-info="mapInfo" />
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { listMap, getRouteNewList, delRouteNew, getRouteNewById, putRouteNew, getContinueProtectList, delContinueProtect } from '@/api/jmap/mapdraft'; /** listRouteMapRoute*/ import { listMap, getRouteNewList, delRouteNew, getRouteNewById, putRouteNew, getContinueProtectList, delContinueProtect } from '@/api/jmap/mapdraft';
import ProtectDetail from './protectDetail'; import ProtectDetail from './protectDetail';
import PreViewField from './preview'; import PreViewField from './preview';
import Related from './related';
export default { export default {
name: 'RouteDetail', name: 'RouteDetail',
components: { components: {
PreViewField, PreViewField,
ProtectDetail ProtectDetail,
Related
}, },
props: { props: {
mapInfo: { mapInfo: {
@ -89,7 +94,8 @@ export default {
columns: [ columns: [
{ {
title: this.$t('map.pathName'), title: this.$t('map.pathName'),
prop: 'name' prop: 'name',
width: 180
}, },
{ {
title: this.$t('map.routeStationName'), title: this.$t('map.routeStationName'),
@ -111,10 +117,6 @@ export default {
title: this.$t('map.endingSignalName'), title: this.$t('map.endingSignalName'),
prop: 'endSignalCode' prop: 'endSignalCode'
}, },
// {
// title: '',
// prop: 'overlapCode'
// },
{ {
type: 'button', type: 'button',
title: '延续保护', title: '延续保护',
@ -137,17 +139,6 @@ export default {
} }
] ]
}, },
// {
// type: 'button',
// title: this.$t('map.routeProtectsData'),
// buttons: [
// {
// name: this.$t('map.preview'),
// handleClick: this.routeOverlap
// }
// ]
// },
{ {
type: 'button', type: 'button',
title: this.$t('map.physicalSection'), // list title: this.$t('map.physicalSection'), // list
@ -221,7 +212,7 @@ export default {
const list = []; const list = [];
if (val && val.length) { if (val && val.length) {
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].uniqueName, value: val[i].code }); list.push({ label: `${val[i].name}(${val[i].code})`, value: val[i].code });
} }
this.queryForm.queryObject.startSignalCode.config.data = list; this.queryForm.queryObject.startSignalCode.config.data = list;
this.queryForm.queryObject.endSignalCode.config.data = list; this.queryForm.queryObject.endSignalCode.config.data = list;
@ -231,8 +222,10 @@ export default {
const list = []; const list = [];
if (val && val.length) { if (val && val.length) {
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
if (val[i].centralized) {
list.push({ label: val[i].name, value: val[i].code }); list.push({ label: val[i].name, value: val[i].code });
} }
}
this.queryForm.queryObject.stationCode.config.data = list; this.queryForm.queryObject.stationCode.config.data = list;
} }
} }
@ -395,9 +388,7 @@ export default {
}, },
async conflictingRouteSection(index, row) { // async conflictingRouteSection(index, row) { //
if (this.$refs && this.$refs.previewField && row) { if (this.$refs && this.$refs.previewField && row) {
const sectionDict = {}; const conflictingRouteList = row.conflictingRouteList.map(elem => { return {code : elem}; });
this.sectionList.map(elem => { sectionDict[elem.code] = elem.name; });
const conflictingRouteList = row.conflictingRouteList.map(elem => { return {sectionCode : elem}; });
const fieldList = { const fieldList = {
id: row.id, id: row.id,
mapId: this.$route.params.mapId, mapId: this.$route.params.mapId,
@ -405,12 +396,12 @@ export default {
name: row.name, name: row.name,
model: { model: {
items: [ items: [
{ prop: 'sectionCode', label: '物理区段ID', type: 'text' }, { prop: 'code', label: '进路code', type: 'text' },
{ prop: 'sectionCode', label: '物理区段名称', type: 'select', options: sectionDict } { prop: 'code', label: '进路名称', type: 'select' }
] ]
} }
}; };
this.$refs.previewField.doShow(fieldList, conflictingRouteList); this.$refs.related.doShow(fieldList, conflictingRouteList);
} }
}, },
// //

View File

@ -388,12 +388,13 @@ export default {
changeSectionSelected(list, flag, type) { changeSectionSelected(list, flag, type) {
list && list.forEach((item) => { list && list.forEach((item) => {
const section = this.$store.getters['map/getDeviceByCode'](item); const section = this.$store.getters['map/getDeviceByCode'](item);
if (section.logicSectionCodeList && section.logicSectionCodeList.length) { if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach( (logicSectionCode) => { section.logicSectionCodeList.forEach( (logicSectionCode) => {
this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(flag, flag ? type : ''); const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : '');
}); });
} else { } else {
section.instance.drawBatchSelected(flag, flag ? type : ''); section && section.instance.drawBatchSelected(flag, flag ? type : '');
} }
}); });
}, },

View File

@ -1,14 +1,15 @@
<template> <template>
<el-dialog <el-dialog
v-dialogDrag v-dialogDrag
:title="mapInfo.name + ' / ' + editModel.name + ' / ' + title" v-loading="loadings"
:title="mapInfo.name + ' / ' + name + ' / ' + title"
:visible.sync="show" :visible.sync="show"
width="40%" width="40%"
:before-close="doClose" :before-close="doClose"
center center
append-to-body append-to-body
> >
<el-form ref="form" :model="editModel" label-width="120px" size="mini"> <!-- <el-form ref="form" :model="editModel" label-width="120px" size="mini">
<el-form-item :label="$t('map.pathName') + ':'" prop="name" readonly="true"> <el-form-item :label="$t('map.pathName') + ':'" prop="name" readonly="true">
<el-input v-model="editModel.name" :disabled="true" /> <el-input v-model="editModel.name" :disabled="true" />
</el-form-item> </el-form-item>
@ -26,13 +27,31 @@
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('map.save') }}</el-button> <el-button type="primary" @click="doSave">{{ $t('map.save') }}</el-button>
<el-button @click="show = false">{{ $t('map.cancel') }}</el-button> <el-button @click="show = false">{{ $t('map.cancel') }}</el-button>
</span> </span> -->
<el-table :data="data" border style="width: 100%">
<template v-for="(item, index) in form">
<el-table-column :key="index" :label="item.label">
<template slot-scope="scope">
<template v-if="item.type === 'select'">
<el-tooltip effect="dark" :content="routeList[scope.row[item.prop]]" placement="top">
<span>{{ routeList[scope.row[item.prop]] }}</span>
</el-tooltip>
</template>
<template v-if="item.type === 'text'">
<el-tooltip effect="dark" :content="scope.row[item.prop]" placement="top">
<span>{{ scope.row[item.prop] }}</span>
</el-tooltip>
</template>
</template>
</el-table-column>
</template>
</el-table>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
// //
import { listRouteMapRoute } from '@/api/jmap/mapdraft'; import { getRouteNewList } from '@/api/jmap/mapdraft';
export default { export default {
name: 'DictionaryDetailEdit', name: 'DictionaryDetailEdit',
props: { props: {
@ -46,59 +65,55 @@ export default {
data() { data() {
return { return {
show: false, show: false,
title: this.$t('map.associatedHostileRecord'),
routes: [], routes: [],
routeColloction: [], loadings: true,
routeData: [], title: '',
editModel: { name: '',
code: '', form: [],
name: '' data: [],
}, routeList: {}
row: {}
}; };
}, },
methods: { methods: {
filterRoute(query, item) { filterRoute(query, item) {
return item.pinyin.indexOf(query) > -1; return item.pinyin.indexOf(query) > -1;
}, },
doShow(fieldList, dataList, row) { doShow(fieldList, dataList) {
this.routeColloction = []; if (fieldList.model) {
this.routeData = [];
this.editModel.id = fieldList.id;
this.editModel.code = fieldList.code;
this.editModel.name = fieldList.name;
this.row = row || {};
this.routeColloction = (dataList || []).map(elem => { return elem.againstRouteCode; });
listRouteMapRoute(fieldList.mapId).then(response => {
if (response.data) {
this.routes = response.data;
this.routes.forEach(elem => {
if (elem.code !== this.editModel.code) {
this.routeData.push({
label: elem.name,
key: elem.code,
pinyin: elem.code
});
}
});
}
this.show = true; this.show = true;
this.loadings = true;
this.routes = [];
this.routeList = {};
const items = fieldList.model.items;
getRouteNewList(this.$route.params.mapId, { pageSize: 9999, pageNum: 1 }).then(response => {
if (response.data.list) {
response.data.list.map(elem => { this.routeList[elem.code] = elem.name; });
this.loadings = false;
if (items) {
this.form = items;
this.name = fieldList.name;
this.data = dataList;
this.title = fieldList.title;
}
}
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal')); this.$messageBox(this.$t('tip.operationAbnormal'));
this.loadings = false;
}); });
}
}, },
doClose(done) { doClose(done) {
this.show = false; this.show = false;
},
doSave() {
this.row.id = this.editModel.id;
this.row.routeCode = this.editModel.code;
this.row.mapId = this.mapInfo.id;
this.row.routeAgainstList = this.routeColloction.map(elem => { return { againstRouteCode: elem }; });
this.$emit('saveRelated', this.row);
} }
// doSave() {
// this.row.id = this.editModel.id;
// this.row.routeCode = this.editModel.code;
// this.row.mapId = this.mapInfo.id;
// this.row.routeAgainstList = this.routeColloction.map(elem => { return { againstRouteCode: elem }; });
// this.$emit('saveRelated', this.row);
// }
} }
}; };
</script> </script>

View File

@ -333,6 +333,7 @@ export default {
}, },
routeData(val, old) { routeData(val, old) {
if (val) { if (val) {
this.$refs.protect.clear();
this.addModel = val; this.addModel = val;
val.overlapCode && this.initProtectData(val); val.overlapCode && this.initProtectData(val);
this.addModel.routeFlankProtectionList.forEach(item => { this.addModel.routeFlankProtectionList.forEach(item => {
@ -512,12 +513,13 @@ export default {
changeSectionSelected(list, flag, type) { changeSectionSelected(list, flag, type) {
list && list.forEach((item) => { list && list.forEach((item) => {
const section = this.$store.getters['map/getDeviceByCode'](item); const section = this.$store.getters['map/getDeviceByCode'](item);
if (section.logicSectionCodeList && section.logicSectionCodeList.length) { if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach( (logicSectionCode) => { section.logicSectionCodeList.forEach( (logicSectionCode) => {
this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(flag, flag ? type : ''); const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : '');
}); });
} else { } else {
section.instance.drawBatchSelected(flag, flag ? type : ''); section && section.instance.drawBatchSelected(flag, flag ? type : '');
} }
}); });
}, },

View File

@ -233,12 +233,13 @@ export default {
changeSectionSelected(list, flag, type) { changeSectionSelected(list, flag, type) {
list && list.forEach((item) => { list && list.forEach((item) => {
const section = this.$store.getters['map/getDeviceByCode'](item); const section = this.$store.getters['map/getDeviceByCode'](item);
if (section.logicSectionCodeList && section.logicSectionCodeList.length) { if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach( (logicSectionCode) => { section.logicSectionCodeList.forEach( (logicSectionCode) => {
this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(flag, flag ? type : ''); const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : '');
}); });
} else { } else {
section.instance.drawBatchSelected(flag, flag ? type : ''); section && section.instance.drawBatchSelected(flag, flag ? type : '');
} }
}); });
} }

View File

@ -665,6 +665,7 @@ export default {
} }
this.$refs.dataform.resetFields(); this.$refs.dataform.resetFields();
this.editModel.points = []; this.editModel.points = [];
this.editModel.logicSectionCodeList = [];
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0]; this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];

View File

@ -88,7 +88,7 @@ export default {
logicSectionNumList.push(Number(ele.num)); logicSectionNumList.push(Number(ele.num));
counts += parseInt(ele.num); counts += parseInt(ele.num);
}); });
if (counts === 0 || allNotZeros) { if (counts == 0 || allNotZeros) {
let logicSectionCodeList = []; let logicSectionCodeList = [];
models.forEach(item=> { models.forEach(item=> {
logicSectionCodeList.push(item.code); logicSectionCodeList.push(item.code);
@ -98,7 +98,7 @@ export default {
models.push(deepAssign(section, {_dispose: true})); models.push(deepAssign(section, {_dispose: true}));
} }
}); });
if (counts === 0) { if (counts == 0) {
logicSectionNumList = []; logicSectionNumList = [];
logicSectionCodeList = []; logicSectionCodeList = [];
} }

View File

@ -129,7 +129,7 @@ export default {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList, disabled:true}, { prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList, disabled:true},
{ prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList } { prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, change: true, deviceChange: this.changeStation }
] ]
} }
} }
@ -258,6 +258,9 @@ export default {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
this.$emit('standStationCode', this.field); this.$emit('standStationCode', this.field);
}, },
changeStation(station) {
this.editModel.deviceStationCode = this.getDeviceStationCode(station);
},
deviceSelect(selected) { deviceSelect(selected) {
if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.$refs.dataform.resetFields(); this.$refs.dataform.resetFields();
@ -293,7 +296,7 @@ export default {
name: `PF${this.stationStandList.length + 1}`, name: `PF${this.stationStandList.length + 1}`,
width: this.addModel.width, width: this.addModel.width,
height: this.addModel.height, height: this.addModel.height,
deviceStationCode: this.getDeviceStationCode(), deviceStationCode: this.getDeviceStationCode(this.addModel.stationCode),
visible: true, visible: true,
position: { position: {
x: 0, x: 0,
@ -343,15 +346,15 @@ export default {
} }
}); });
}, },
getDeviceStationCode() { getDeviceStationCode(stationCode) {
// //
// //
let beCentralizedStation = {}; let beCentralizedStation = {};
this.stationList.some(data=>{ this.stationList.some(data=>{
if (data.centralized) { if (data.centralized) {
if (data.code == this.addModel.stationCode) { if (data.code == stationCode) {
beCentralizedStation = {}; beCentralizedStation = {};
beCentralizedStation[this.addModel.stationCode] = data.code; beCentralizedStation[stationCode] = data.code;
return true; return true;
} }
data.chargeStationCodeList.forEach(charge=>{ data.chargeStationCodeList.forEach(charge=>{
@ -359,7 +362,7 @@ export default {
}); });
} }
}); });
return beCentralizedStation[this.addModel.stationCode] || ''; return beCentralizedStation[stationCode] || '';
}, },
// //
edit() { edit() {

View File

@ -593,6 +593,16 @@ export default {
const station = this.stations[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' }; const station = this.stations[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' };
if (!arr.includes(`${item.data[0]}${item.data[1]}`)) { if (!arr.includes(`${item.data[0]}${item.data[1]}`)) {
arr.push(`${item.data[0]}${item.data[1]}`); arr.push(`${item.data[0]}${item.data[1]}`);
if (this.$route.query.lineCode == '06') {
const list = [
`${this.$t('planMonitor.stationName')}${station.name}<br>`,
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km <br>`,
`${this.$t('planMonitor.arriveTime')}${timeFormat(item.data[0] + this.planConvert.TranslationTime)}<br>`,
`${this.$t('planMonitor.serverTrainNum')}: ${item.seriesName}${item.data[3]}`,
`<hr size=1 style="margin: 3px 0">`
];
data += list.join('');
} else {
const list = [ const list = [
`${this.$t('planMonitor.stationName')}${station.name}<br>`, `${this.$t('planMonitor.stationName')}${station.name}<br>`,
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km <br>`, `${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km <br>`,
@ -602,6 +612,7 @@ export default {
]; ];
data += list.join(''); data += list.join('');
} }
}
}); });
return data; return data;
}, },

View File

@ -120,7 +120,7 @@ export default {
this.mapId = obj.id; this.mapId = obj.id;
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`}); this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
} else if ( obj.type === 'MapSystem') { } else if ( obj.type === 'MapSystem') {
getSubSystemInfo(obj.id).then(resp => { getSubSystemInfo(obj.id).then(resp => { //
let router = ''; let router = '';
switch (resp.data.type) { switch (resp.data.type) {
case 'Exam': case 'Exam':