修改优化代码

This commit is contained in:
ival 2019-07-30 16:47:11 +08:00
parent 66b2406d91
commit 276f68e7bc
74 changed files with 902 additions and 7365 deletions

View File

@ -5,9 +5,10 @@ import Painter from './painter';
import Options from './options';
import MouseController from './mouseController';
import deviceState from './constant/deviceState';
import { selectSkinStyle } from './config/deviceStyle';
import deviceType from './constant/deviceType';
import { selectSkinStyle } from './config/deviceStyle';
import { parser, deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser';
import Theme from './theme/factory';
const renderer = 'canvas';
const devicePixelRatio = 1;
@ -27,7 +28,10 @@ class Jlmap {
this.skinStyle = '';
// 皮肤风格
this.styleDict = {};
this.style = this.loadStyle();
// 地图主题
this.theme = this.loadTheme();
// 设备数据
this.mapDevice = {};
@ -63,6 +67,10 @@ class Jlmap {
return selectSkinStyle(skinStyle);
}
loadTheme(skinStyle) {
return new Theme(skinStyle);
}
loadDefaultState() {
const defaultStateDict = {};
@ -86,10 +94,13 @@ class Jlmap {
this.data = map;
// 加载对应皮肤
this.styleDict = this.loadStyle(this.skinStyle);
this.style = this.loadStyle(this.skinStyle);
// 主题模块
this.theme = this.loadTheme(this.skinStyle);
// 解析地图数据
this.mapDevice = parser(map);
this.mapDevice = parser(map, this);
// 数据加载完成 回调
if (this.methods.dataLoaded instanceof Function) { this.methods.dataLoaded(this.mapDevice); }
@ -306,18 +317,6 @@ class Jlmap {
return this.events;
}
getSkinStyle() {
return this.skinStyle;
}
getStyleDict() {
return this.styleDict;
}
getDefaultStateDict() {
return this.defaultStateDict;
}
getDeviceByCode(code) {
return this.mapDevice[code];
}
@ -333,11 +332,16 @@ class Jlmap {
clearTrainView() {
this.$painter.clearLevel(deviceType.Train);
zrUtil.each(Object.values(this.mapDevice), device => {
if (device._type == deviceType.Train) {
device.instance = null;
}
});
}
clear() {
this.skinStyle = '';
this.styleDict = {};
this.style = {};
this.mapDevice = {};
this.$painter.clear();
}

View File

@ -125,7 +125,7 @@ class Painter {
device.trainWindowModel = oldTrainWindowModel;
}
this.mapInstanceLevel[deviceType.Train].remove(instance);
instance && this.mapInstanceLevel[deviceType.Train].remove(instance);
this.add(device);
}

View File

@ -146,7 +146,7 @@ class Signal extends Group {
this.add(this.sigPost);
this.lamps.forEach(lamp => { this.add(lamp); });
this.add(this.sigName);
this.model.nameShow ? this.add(this.sigName) : null;
this.add(this.sigAuto);
this.add(this.sigRoute);
this.add(this.sigDelay);

View File

@ -39,11 +39,10 @@ mapShape[deviceType.Text] = Text2;
function shapefactory(device, jmap) {
const type = device._type;
const style = jmap.getStyleDict();
const shape = mapShape[type];
if (shape instanceof Function) {
// eslint-disable-next-line
return new shape(device, style);
return new shape(device, jmap.style);
}
}

View File

@ -113,48 +113,48 @@
})
},
setDeviceDisplay() {
// let show = false;
// let deviceList = [];
let show = false;
let deviceList = [];
// //
// let sectionList = this.$store.getters['map/sectionList'];
// if (sectionList && sectionList.length > 0) {
// sectionList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
// elem.borderBorderShow = show;
// elem.type = deviceType.Section;
// deviceList.push(elem);
// });
// }
//
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
//
show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
elem.borderBorderShow = show;
elem.type = deviceType.Section;
deviceList.push(elem);
});
}
// //
// let trainWindowList = this.$store.getters['map/trainWindowList'];
// if (trainWindowList && trainWindowList.length > 0) {
// trainWindowList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
// elem.type = deviceType.Section;
// elem.trainWindowShow = show;
// deviceList.push(elem);
// });
// }
//
let trainWindowList = this.$store.getters['map/trainWindowList'];
if (trainWindowList && trainWindowList.length > 0) {
trainWindowList.forEach(elem => {
//
show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
elem.type = deviceType.Section;
elem.trainWindowShow = show;
deviceList.push(elem);
});
}
// //ATS
// let signalList = this.$store.getters['map/signalList'];
// if (signalList && signalList.length > 0) {
// signalList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
// elem.linkageAutoRouteShow = show;
// //ATS
// show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
// elem.atsAutoTriggerShow = show;
// deviceList.push(elem);
// })
// }
//ATS
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
//
show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
elem.linkageAutoRouteShow = show;
//ATS
show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
})
}
// this.$store.dispatch('map/updateMapDevices', deviceList);
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}

View File

@ -147,115 +147,115 @@
})
},
setNameDisplay() {
// let show = false;
// let deviceList = [];
let show = false;
let deviceList = [];
// //
// show = this.nameLevels.indexOf(1) !== -1 ? true : false;
// let signalList = this.$store.getters['map/signalList'];
// if (signalList && signalList.length > 0) {
// signalList.forEach(elem => {
// elem.nameShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(1) !== -1 ? true : false;
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
elem.nameShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(3) !== -1 ? true : false;
//
show = this.nameLevels.indexOf(3) !== -1 ? true : false;
// //
// let switchList = this.$store.getters['map/switchList'];
// if (switchList && switchList.length > 0) {
// switchList.forEach(elem => {
// //
// show = this.nameLevels.indexOf(7) !== -1 ? true : false;
// elem.nameShow = show;
// //
// show = this.nameLevels.indexOf(9) !== -1 ? true : false;
// elem.switchSectionNameShow = show;
// deviceList.push(elem);
// })
// }
//
let switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) {
switchList.forEach(elem => {
//
show = this.nameLevels.indexOf(7) !== -1 ? true : false;
elem.nameShow = show;
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.switchSectionNameShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(8) !== -1 ? true : false;
// let control = this.$store.getters['map/stationControlList'];
// if (control && control.length > 0) {
// control.forEach(elem => {
// //
// elem.indicatorShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(8) !== -1 ? true : false;
let control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) {
control.forEach(elem => {
//
elem.indicatorShow = show;
deviceList.push(elem);
})
}
// //
// let sectionList = this.$store.getters['map/sectionList'];
// if (sectionList && sectionList.length > 0) {
// sectionList.forEach(elem => {
// if (elem.isSwitchSection && elem.parentCode) {
// //
// elem.nameShow = false;
// } else {
// if (elem.type === '01') {
// show = this.nameLevels.indexOf(11) !== -1 ? true : false;
// elem.nameShow = show;
// } else if (elem.type === '02') {
// //
// show = this.nameLevels.indexOf(5) !== -1 ? true : false;
// elem.nameShow = show;
// } else if (elem.type === '03') {
// //
// show = this.nameLevels.indexOf(9) !== -1 ? true : false;
// elem.nameShow = show;
// }
// }
//
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
if (elem.isSwitchSection && elem.parentCode) {
//
elem.nameShow = false;
} else {
if (elem.type === '01') {
show = this.nameLevels.indexOf(11) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '02') {
//
show = this.nameLevels.indexOf(5) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '03') {
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.nameShow = show;
}
}
// //
// if (elem.isStandTrack) {
// show = this.nameLevels.indexOf(2) !== -1 ? true : false;
// elem.standTrackNameShow = show;
// }
//
if (elem.isStandTrack) {
show = this.nameLevels.indexOf(2) !== -1 ? true : false;
elem.standTrackNameShow = show;
}
// //
// if (elem.isReentryTrack) {
// show = this.nameLevels.indexOf(4) !== -1 ? true : false;
// elem.reentryTrackNameShow = show;
// }
//
if (elem.isReentryTrack) {
show = this.nameLevels.indexOf(4) !== -1 ? true : false;
elem.reentryTrackNameShow = show;
}
// //
// if (elem.isTransferTrack) {
// show = this.nameLevels.indexOf(6) !== -1 ? true : false;
// elem.transferTrackNameShow = show;
// }
//
if (elem.isTransferTrack) {
show = this.nameLevels.indexOf(6) !== -1 ? true : false;
elem.transferTrackNameShow = show;
}
// deviceList.push(elem);
// })
// }
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(10) !== -1 ? true : false;
// let stopPointList = this.$store.getters['map/stopPointList'];
// if (stopPointList && stopPointList.length > 0) {
// stopPointList.forEach(elem => {
// //
// elem.destCodeShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(10) !== -1 ? true : false;
let stopPointList = this.$store.getters['map/stopPointList'];
if (stopPointList && stopPointList.length > 0) {
stopPointList.forEach(elem => {
//
elem.destCodeShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(12) !== -1 ? true : false;
// let stationList = this.$store.getters['map/stationList'];
// if (stationList && stationList.length > 0) {
// stationList.forEach(elem => {
// //
// elem.kmPostShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(12) !== -1 ? true : false;
let stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) {
stationList.forEach(elem => {
//
elem.kmPostShow = show;
deviceList.push(elem);
})
}
// this.$store.dispatch('map/updateMapDevices', deviceList);
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}

View File

@ -155,17 +155,17 @@
})
},
setTrainDispaly() {
// let trainList = this.$store.getters['training/viewTrainList'];
// if (trainList && trainList.length > 0) {
// let planFormat = this.trainNameFormatBy(this.planMode);
// let nameFontSize = this.fontSize;
// trainList.forEach(elem => {
// elem.nameFormat = planFormat;
// elem.nameFontSize = nameFontSize;
// });
let trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) {
let planFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize;
trainList.forEach(elem => {
elem.nameFormat = planFormat;
elem.nameFontSize = nameFontSize;
});
// this.$store.dispatch('map/updateMapDevices', trainList);
// }
this.$store.dispatch('map/updateMapDevices', trainList);
}
},
trainNameFormatBy(mode) {
switch (mode.toString()) {

View File

@ -1,65 +1,41 @@
/**
* 公共字段部分默认初始值
*/
const modelPublicInitialValue = {
Signal: {
import deviceType from '../../constant/deviceType';
class Model {
constructor() {
// 公共字段部分默认初始值
this['public'] = {};
this['public'][deviceType.Signal] = {
lampPositionType: '02',
lampPostType: '02'
}
};
/**
* 在绘图创建Model数据时根据皮肤类型修改公共属性默认值
* @param {Object} model
*/
export function InitPublicProperties(model) {
if (model) {
var modelInitial = modelPublicInitialValue[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
/**
* 私有字段部分默认初始值
*/
const modelPrivateInitialValue = {
StationControl: {
// 私有字段部分默认初始值
this['private'] = {};
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
},
Section: {
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示
},
Signal: {
};
this['private'][deviceType.Signal] = {
linkageAutoRouteShow: true, // 联锁自动进路表示灯显示
atsAutoTriggerShow: true // ATS自动触发表示灯显示
},
Train: {
nameFormat: 'targetCode:serverNo:trainNo', // 字体格式
nameFontSize: 10 // 字体大小
},
TrainWindow: {
// trainWindowShow: true, // 是否显示
trainWindowShow: false
}
};
this['private'][deviceType.Train] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
nameFontSize: 10 // 字体大小
};
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true
};
}
/**
* 加载Model数据时根据皮肤类型修改前端私有属性默认值
* @param {Object} model
*/
export function InitPrivateProperties(model) {
initPublicProps(model) {
if (model) {
var modelInitial = modelPrivateInitialValue[model._type];
var modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
@ -69,3 +45,19 @@ export function InitPrivateProperties(model) {
return model;
}
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
}
export default new Model();

View File

@ -114,46 +114,46 @@
})
},
setDeviceDisplay() {
// let show = false;
// let deviceList = [];
let show = false;
let deviceList = [];
// //
// let sectionList = this.$store.getters['map/sectionList'];
// if (sectionList && sectionList.length > 0) {
// sectionList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
// elem.borderBorderShow = show;
// deviceList.push(elem);
// });
// }
//
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
//
show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
elem.borderBorderShow = show;
deviceList.push(elem);
});
}
// //
// let trainWindowList = this.$store.getters['map/trainWindowList'];
// if (trainWindowList && trainWindowList.length > 0) {
// trainWindowList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
// elem.trainWindowShow = show;
// deviceList.push(elem);
// });
// }
//
let trainWindowList = this.$store.getters['map/trainWindowList'];
if (trainWindowList && trainWindowList.length > 0) {
trainWindowList.forEach(elem => {
//
show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
elem.trainWindowShow = show;
deviceList.push(elem);
});
}
// //ATS
// let signalList = this.$store.getters['map/signalList'];
// if (signalList && signalList.length > 0) {
// signalList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
// elem.linkageAutoRouteShow = show;
// //ATS
// show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
// elem.atsAutoTriggerShow = show;
// deviceList.push(elem);
// })
// }
//ATS
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
//
show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
elem.linkageAutoRouteShow = show;
//ATS
show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
})
}
// this.$store.dispatch('map/updateMapDevices', deviceList);
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}

View File

@ -147,116 +147,116 @@
})
},
setNameDisplay() {
// let show = false;
// let deviceList = [];
let show = false;
let deviceList = [];
// //
// show = this.nameLevels.indexOf(1) !== -1 ? true : false;
// let signalList = this.$store.getters['map/signalList'];
// if (signalList && signalList.length > 0) {
// signalList.forEach(elem => {
// elem.nameShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(1) !== -1 ? true : false;
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
elem.nameShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(3) !== -1 ? true : false;
//
show = this.nameLevels.indexOf(3) !== -1 ? true : false;
// //
// let switchList = this.$store.getters['map/switchList'];
// if (switchList && switchList.length > 0) {
// switchList.forEach(elem => {
// //
// show = this.nameLevels.indexOf(7) !== -1 ? true : false;
// elem.nameShow = show;
// //
// show = this.nameLevels.indexOf(9) !== -1 ? true : false;
// elem.switchSectionNameShow = show;
// deviceList.push(elem);
// })
// }
//
let switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) {
switchList.forEach(elem => {
//
show = this.nameLevels.indexOf(7) !== -1 ? true : false;
elem.nameShow = show;
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.switchSectionNameShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(8) !== -1 ? true : false;
// let control = this.$store.getters['map/stationControlList'];
// if (control && control.length > 0) {
// control.forEach(elem => {
// //
// elem.indicatorShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(8) !== -1 ? true : false;
let control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) {
control.forEach(elem => {
//
elem.indicatorShow = show;
deviceList.push(elem);
})
}
// //
// let sectionList = this.$store.getters['map/sectionList'];
// if (sectionList && sectionList.length > 0) {
// sectionList.forEach(elem => {
// if (elem.isSwitchSection && elem.parentCode) {
// //
// elem.nameShow = false;
// } else {
// if (elem.type === '01') {
// show = this.nameLevels.indexOf(11) !== -1 ? true : false;
// elem.nameShow = show;
// } else if (elem.type === '02') {
// //
// show = this.nameLevels.indexOf(5) !== -1 ? true : false;
// elem.nameShow = show;
// } else if (elem.type === '03') {
// //
// show = this.nameLevels.indexOf(9) !== -1 ? true : false;
// elem.nameShow = show;
// }
// }
//
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
if (elem.isSwitchSection && elem.parentCode) {
//
elem.nameShow = false;
} else {
if (elem.type === '01') {
show = this.nameLevels.indexOf(11) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '02') {
//
show = this.nameLevels.indexOf(5) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '03') {
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.nameShow = show;
}
}
// //
// if (elem.isStandTrack) {
// show = this.nameLevels.indexOf(2) !== -1 ? true : false;
// elem.standTrackNameShow = show;
// }
//
if (elem.isStandTrack) {
show = this.nameLevels.indexOf(2) !== -1 ? true : false;
elem.standTrackNameShow = show;
}
// //
// if (elem.isReentryTrack) {
// show = this.nameLevels.indexOf(4) !== -1 ? true : false;
// elem.reentryTrackNameShow = show;
// }
//
if (elem.isReentryTrack) {
show = this.nameLevels.indexOf(4) !== -1 ? true : false;
elem.reentryTrackNameShow = show;
}
// //
// if (elem.isTransferTrack) {
// show = this.nameLevels.indexOf(6) !== -1 ? true : false;
// elem.transferTrackNameShow = show;
// }
//
if (elem.isTransferTrack) {
show = this.nameLevels.indexOf(6) !== -1 ? true : false;
elem.transferTrackNameShow = show;
}
// deviceList.push(elem);
// })
// }
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(10) !== -1 ? true : false;
// let stopPointList = this.$store.getters['map/stopPointList'];
// if (stopPointList && stopPointList.length > 0) {
// stopPointList.forEach(elem => {
// //
// elem.destCodeShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(10) !== -1 ? true : false;
let stopPointList = this.$store.getters['map/stopPointList'];
if (stopPointList && stopPointList.length > 0) {
stopPointList.forEach(elem => {
//
elem.destCodeShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(12) !== -1 ? true : false;
// let stationList = this.$store.getters['map/stationList'];
// if (stationList && stationList.length > 0) {
// stationList.forEach(elem => {
// //
// elem.kmPostShow = show;
// deviceList.push(elem);
//
show = this.nameLevels.indexOf(12) !== -1 ? true : false;
let stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) {
stationList.forEach(elem => {
//
elem.kmPostShow = show;
deviceList.push(elem);
// })
// }
})
}
// this.$store.dispatch('map/updateMapDevices', deviceList);
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}

View File

@ -155,17 +155,17 @@
})
},
setTrainDispaly() {
// let trainList = this.$store.getters['training/viewTrainList'];
// if (trainList && trainList.length > 0) {
// let planFormat = this.trainNameFormatBy(this.planMode);
// let nameFontSize = this.fontSize;
// trainList.forEach(elem => {
// elem.nameFormat = planFormat;
// elem.nameFontSize = nameFontSize;
// });
let trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) {
let planFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize;
trainList.forEach(elem => {
elem.nameFormat = planFormat;
elem.nameFontSize = nameFontSize;
});
// this.$store.dispatch('map/updateMapDevices', trainList);
// }
this.$store.dispatch('map/updateMapDevices', trainList);
}
},
trainNameFormatBy(mode) {
switch (mode.toString()) {

View File

@ -17,7 +17,6 @@
import { getEveryDayRunPlanData } from '@/api/simulation';
import { getSkinStyleList } from '@/api/management/mapskin'
import { UrlConfig } from '@/router/index';
import ThemeFactory from '@/jmap/theme/factory';
export default {
name: 'ReloadTodayPlan',
@ -129,7 +128,7 @@
if (skinStyle) {
getStationListBySkinStyle(skinStyle).then(response => {
let stations = response.data;
this.PlanConvert = ThemeFactory.loadPlanConvert(skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);

View File

@ -1,64 +1,41 @@
/**
* 公共字段部分默认初始值
*/
const modelPublicInitialValue = {
Signal: {
import deviceType from '../../constant/deviceType';
class Model {
constructor() {
// 公共字段部分默认初始值
this['public'] = {};
this['public'][deviceType.Signal] = {
lampPositionType: '02',
lampPostType: '02'
}
};
/**
* 在绘图创建Model数据时根据皮肤类型修改公共属性默认值
* @param {Object} model
*/
export function InitPublicProperties(model) {
if (model) {
var modelInitial = modelPublicInitialValue[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
/**
* 私有字段部分默认初始值
*/
const modelPrivateInitialValue = {
StationControl: {
// 私有字段部分默认初始值
this['private'] = {};
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
},
Section: {
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示
},
Signal: {
};
this['private'][deviceType.Signal] = {
linkageAutoRouteShow: true, // 联锁自动进路表示灯显示
atsAutoTriggerShow: true // ATS自动触发表示灯显示
},
Train: {
};
this['private'][deviceType.Train] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
nameFontSize: 10 // 字体大小
},
TrainWindow: {
trainWindowShow: true
}
};
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true
};
}
/**
* 加载Model数据时根据皮肤类型修改前端私有属性默认值
* @param {Object} model
*/
export function InitPrivateProperties(model) {
initPublicProps(model) {
if (model) {
var modelInitial = modelPrivateInitialValue[model._type];
var modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
@ -68,3 +45,19 @@ export function InitPrivateProperties(model) {
return model;
}
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
}
export default new Model();

View File

@ -107,7 +107,7 @@
import XLSX from 'xlsx';
import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { importData } from '../convert';
import { importData } from '../planConvert';
import { launchFullscreen } from '@/utils/screen';
export default {

View File

@ -17,7 +17,6 @@
import { timeFormat } from '@/utils/date';
import { runDiagramGetTime } from '@/api/simulation';
import { getStationListBySkinStyle } from '@/api/runplan';
import ThemeFactory from '@/jmap/theme/factory';
import DataTable from '../menusPlan/components/dataTable';
export default {
@ -229,7 +228,7 @@
])
},
mounted() {
this.PlanConvert = ThemeFactory.loadPlanConvert(this.skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(this.skinStyle);
},
beforeDestroy() {
this.destroy();

View File

@ -114,46 +114,46 @@
})
},
setDeviceDisplay() {
// let show = false;
// let deviceList = [];
let show = false;
let deviceList = [];
// //
// let sectionList = this.$store.getters['map/sectionList'];
// if (sectionList && sectionList.length > 0) {
// sectionList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
// elem.borderBorderShow = show;
// deviceList.push(elem);
// });
// }
//
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
//
show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
elem.borderBorderShow = show;
deviceList.push(elem);
});
}
// //
// let trainWindowList = this.$store.getters['map/trainWindowList'];
// if (trainWindowList && trainWindowList.length > 0) {
// trainWindowList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
// elem.trainWindowShow = show;
// deviceList.push(elem);
// });
// }
//
let trainWindowList = this.$store.getters['map/trainWindowList'];
if (trainWindowList && trainWindowList.length > 0) {
trainWindowList.forEach(elem => {
//
show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
elem.trainWindowShow = show;
deviceList.push(elem);
});
}
// //ATS
// let signalList = this.$store.getters['map/signalList'];
// if (signalList && signalList.length > 0) {
// signalList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
// elem.linkageAutoRouteShow = show;
// //ATS
// show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
// elem.atsAutoTriggerShow = show;
// deviceList.push(elem);
// })
// }
//ATS
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
//
show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
elem.linkageAutoRouteShow = show;
//ATS
show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
})
}
// this.$store.dispatch('map/updateMapDevices', deviceList);
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}

View File

@ -147,116 +147,116 @@
})
},
setNameDisplay() {
// let show = false;
// let deviceList = [];
let show = false;
let deviceList = [];
// //
// show = this.nameLevels.indexOf(1) !== -1 ? true : false;
// let signalList = this.$store.getters['map/signalList'];
// if (signalList && signalList.length > 0) {
// signalList.forEach(elem => {
// elem.nameShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(1) !== -1 ? true : false;
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
elem.nameShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(3) !== -1 ? true : false;
//
show = this.nameLevels.indexOf(3) !== -1 ? true : false;
// //
// let switchList = this.$store.getters['map/switchList'];
// if (switchList && switchList.length > 0) {
// switchList.forEach(elem => {
// //
// show = this.nameLevels.indexOf(7) !== -1 ? true : false;
// elem.nameShow = show;
// //
// show = this.nameLevels.indexOf(9) !== -1 ? true : false;
// elem.switchSectionNameShow = show;
// deviceList.push(elem);
// })
// }
//
let switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) {
switchList.forEach(elem => {
//
show = this.nameLevels.indexOf(7) !== -1 ? true : false;
elem.nameShow = show;
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.switchSectionNameShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(8) !== -1 ? true : false;
// let control = this.$store.getters['map/stationControlList'];
// if (control && control.length > 0) {
// control.forEach(elem => {
// //
// elem.indicatorShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(8) !== -1 ? true : false;
let control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) {
control.forEach(elem => {
//
elem.indicatorShow = show;
deviceList.push(elem);
})
}
// //
// let sectionList = this.$store.getters['map/sectionList'];
// if (sectionList && sectionList.length > 0) {
// sectionList.forEach(elem => {
// if (elem.isSwitchSection && elem.parentCode) {
// //
// elem.nameShow = false;
// } else {
// if (elem.type === '01') {
// show = this.nameLevels.indexOf(11) !== -1 ? true : false;
// elem.nameShow = show;
// } else if (elem.type === '02') {
// //
// show = this.nameLevels.indexOf(5) !== -1 ? true : false;
// elem.nameShow = show;
// } else if (elem.type === '03') {
// //
// show = this.nameLevels.indexOf(9) !== -1 ? true : false;
// elem.nameShow = show;
// }
// }
//
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
if (elem.isSwitchSection && elem.parentCode) {
//
elem.nameShow = false;
} else {
if (elem.type === '01') {
show = this.nameLevels.indexOf(11) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '02') {
//
show = this.nameLevels.indexOf(5) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '03') {
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.nameShow = show;
}
}
// //
// if (elem.isStandTrack) {
// show = this.nameLevels.indexOf(2) !== -1 ? true : false;
// elem.standTrackNameShow = show;
// }
//
if (elem.isStandTrack) {
show = this.nameLevels.indexOf(2) !== -1 ? true : false;
elem.standTrackNameShow = show;
}
// //
// if (elem.isReentryTrack) {
// show = this.nameLevels.indexOf(4) !== -1 ? true : false;
// elem.reentryTrackNameShow = show;
// }
//
if (elem.isReentryTrack) {
show = this.nameLevels.indexOf(4) !== -1 ? true : false;
elem.reentryTrackNameShow = show;
}
// //
// if (elem.isTransferTrack) {
// show = this.nameLevels.indexOf(6) !== -1 ? true : false;
// elem.transferTrackNameShow = show;
// }
//
if (elem.isTransferTrack) {
show = this.nameLevels.indexOf(6) !== -1 ? true : false;
elem.transferTrackNameShow = show;
}
// deviceList.push(elem);
// })
// }
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(10) !== -1 ? true : false;
// let stopPointList = this.$store.getters['map/stopPointList'];
// if (stopPointList && stopPointList.length > 0) {
// stopPointList.forEach(elem => {
// //
// elem.destCodeShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(10) !== -1 ? true : false;
let stopPointList = this.$store.getters['map/stopPointList'];
if (stopPointList && stopPointList.length > 0) {
stopPointList.forEach(elem => {
//
elem.destCodeShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(12) !== -1 ? true : false;
// let stationList = this.$store.getters['map/stationList'];
// if (stationList && stationList.length > 0) {
// stationList.forEach(elem => {
// //
// elem.kmPostShow = show;
// deviceList.push(elem);
//
show = this.nameLevels.indexOf(12) !== -1 ? true : false;
let stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) {
stationList.forEach(elem => {
//
elem.kmPostShow = show;
deviceList.push(elem);
// })
// }
})
}
// this.$store.dispatch('map/updateMapDevices', deviceList);
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}

View File

@ -155,17 +155,17 @@
})
},
setTrainDispaly() {
// let trainList = this.$store.getters['training/viewTrainList'];
// if (trainList && trainList.length > 0) {
// let planFormat = this.trainNameFormatBy(this.planMode);
// let nameFontSize = this.fontSize;
// trainList.forEach(elem => {
// elem.nameFormat = planFormat;
// elem.nameFontSize = nameFontSize;
// });
let trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) {
let planFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize;
trainList.forEach(elem => {
elem.nameFormat = planFormat;
elem.nameFontSize = nameFontSize;
});
// this.$store.dispatch('map/updateMapDevices', trainList);
// }
this.$store.dispatch('map/updateMapDevices', trainList);
}
},
trainNameFormatBy(mode) {
switch (mode.toString()) {

View File

@ -17,7 +17,6 @@
import { getEveryDayRunPlanData } from '@/api/simulation';
import { getSkinStyleList } from '@/api/management/mapskin'
import { UrlConfig } from '@/router/index';
import ThemeFactory from '@/jmap/theme/factory';
export default {
name: 'ReloadTodayPlan',
@ -129,7 +128,7 @@
if (skinStyle) {
getStationListBySkinStyle(skinStyle).then(response => {
let stations = response.data;
this.PlanConvert = ThemeFactory.loadPlanConvert(skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);

View File

@ -1,64 +1,41 @@
/**
* 公共字段部分默认初始值
*/
const modelPublicInitialValue = {
Signal: {
import deviceType from '../../constant/deviceType';
class Model {
constructor() {
// 公共字段部分默认初始值
this['public'] = {};
this['public'][deviceType.Signal] = {
lampPositionType: '02',
lampPostType: '02'
}
};
/**
* 在绘图创建Model数据时根据皮肤类型修改公共属性默认值
* @param {Object} model
*/
export function InitPublicProperties(model) {
if (model) {
var modelInitial = modelPublicInitialValue[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
/**
* 私有字段部分默认初始值
*/
const modelPrivateInitialValue = {
StationControl: {
// 私有字段部分默认初始值
this['private'] = {};
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
},
Section: {
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示
},
Signal: {
};
this['private'][deviceType.Signal] = {
linkageAutoRouteShow: true, // 联锁自动进路表示灯显示
atsAutoTriggerShow: true // ATS自动触发表示灯显示
},
Train: {
};
this['private'][deviceType.Train] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
nameFontSize: 10 // 字体大小
},
TrainWindow: {
trainWindowShow: true
}
};
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true
};
}
/**
* 加载Model数据时根据皮肤类型修改前端私有属性默认值
* @param {Object} model
*/
export function InitPrivateProperties(model) {
initPublicProps(model) {
if (model) {
var modelInitial = modelPrivateInitialValue[model._type];
var modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
@ -68,3 +45,19 @@ export function InitPrivateProperties(model) {
return model;
}
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
}
export default new Model();

View File

@ -107,7 +107,7 @@
import XLSX from 'xlsx';
import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { importData } from '../convert';
import { importData } from '../planConvert';
import { launchFullscreen } from '@/utils/screen';
export default {

View File

@ -17,7 +17,6 @@
import { timeFormat } from '@/utils/date';
import { runDiagramGetTime } from '@/api/simulation';
import { getStationListBySkinStyle } from '@/api/runplan';
import ThemeFactory from '@/jmap/theme/factory';
import DataTable from '../menusPlan/components/dataTable';
export default {
@ -229,7 +228,7 @@
])
},
mounted() {
this.PlanConvert = ThemeFactory.loadPlanConvert(this.skinStyle);
this.PlanConvert = this.$theme().loadPlanConvert(this.skinStyle);
},
beforeDestroy() {
this.destroy();

View File

@ -1,308 +0,0 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
export default {
/** 边缘高度*/
EdgeHeight: 600,
/** 间隔高度*/
CoordMultiple: 1,
/** 偏移时间*/
TranslationTime: 60 * 60 * 2,
/** excel解析配置*/
ExcelConfig: {
beginRow: 1,
beginCol: 0,
fieldNum: 10,
sepField: '车次',
columns: {
'车站名': { key: 'stationName', formatter: (val) => { return val; } },
'到点': { key: 'arriveTime', formatter: (val) => { return val; } },
'发点': { key: 'departureTime', formatter: (val) => { return val; } }
}
},
/** 解析exal数据转换为Json后台数据*/
importData(Sheet, JsonData) {
var dataList = convertSheetToList(Sheet, true);
var needList = Object.keys(this.ExcelConfig.columns);
if (dataList && dataList.length) {
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += this.ExcelConfig.fieldNum + 1) {
var isContinue = true;
var tripObj = { code: '', arrivalList: [] };
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
isContinue = false;
var stationObj = {};
for (var index = 0; index < this.ExcelConfig.fieldNum; index += 1) {
if (dataList[colIndex + index]) {
var title = dataList[colIndex + index][0];
var value = dataList[colIndex + index][rowIndex];
if (title && value) {
// 数据列解析
isContinue = true;
var titleStr = `${title}`.trim();
var valueStr = `${value}`.trim();
if (titleStr == this.ExcelConfig.sepField) {
if (tripObj.code) {
const length = tripObj.arrivalList.length;
if (length == 1) {
tripObj.arrivalList[0]['flag'] = true;
}
JsonData.push(tripObj);
tripObj = { code: valueStr, arrivalList: [] };
} else {
tripObj.code = valueStr;
}
}
// 取需要的字段
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
stationObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
}
}
}
}
// 添加字段值
if (Object.keys(stationObj).length) {
tripObj.arrivalList.push(stationObj);
}
}
// 添加最后那条没有车次的记录
if (tripObj.code) {
const length = tripObj.arrivalList.length;
if (length) {
tripObj.arrivalList[length - 1]['flag'] = true;
}
JsonData.push(tripObj);
}
}
}
return JsonData;
},
/** 将后台数据解析成图表*/
convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) {
var models = [];
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
/** 按服务遍历数据*/
data.serviceNumberDataList.forEach((service) => {
/** 按车次遍历数据*/
var opt = { name: '', markPointData: [], data: [] };
if (service.tripNumberDataList && service.tripNumberDataList.length) {
service.tripNumberDataList.forEach((train, j) => {
var pointdata = {};
var idx = 0;
var num = 0;
var lastPoint = null;
var nextPoint = null;
/** 如果车次号为空,不显示名称*/
if (train.tripNumber) {
/** 创建标记点名称和坐标*/
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode;
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
opt.markPointData.push(createMartPoint(pointdata));
/** 创建服务号名称*/
opt.name = `${service.serviceNumber}`;
}
/** 计算非折返点车次点坐标集合*/
train.stationTimeList.forEach((elem, index) => {
idx = index;
if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode ||
index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime ||
index > 0 && index < train.stationTimeList.length - 1) {
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode]);
}
});
/** 计算折返点车次坐标点集合*/
if (!service.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode]);
}
/** 如果是备用车,按车次添加线*/
if (service.backup) {
/** 创建一条完成的服务数据*/
opt.name += j;
var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
if (model) {
models.push(model);
opt = { name: '', markPointData: [], data: [] };
}
}
});
// 不是备用车,按服务添加线
if (!service.backup) {
/** 创建一条完成的服务数据*/
var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
if (model) {
models.push(model);
}
}
}
});
return models;
} else {
return [];
}
},
/** 更新数据并解析成图表*/
updateDataToModels(data, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
if (data && data.length) {
data.forEach(elem => {
/** 判断此条记录的服务号是否存在*/
if (!runPlanData[elem.serviceNumber]) {
/** 创建一个新服务号标记*/
runPlanData[elem.serviceNumber] = {};
/** 不存在此服务号则需要创建一条新的line*/
series.push(createSeriesModel({
zlevel: 1,
name: `run${elem.serviceNumber}`,
data: [],
markPointData: []
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
}
/** 添加数据*/
series.forEach(serie => {
/** 找到服务号所在图数据的位置*/
if (serie.name == `run${elem.serviceNumber}`) {
/** 添加车组号记录标记*/
if (!runPlanData[elem.serviceNumber][elem.tripNumber]) {
runPlanData[elem.serviceNumber][elem.tripNumber] = [];
}
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
return parseInt(a.secondTime) - parseInt(b.secondTime);
});
/** 如果此记录车组号的数据为第一条时,则打上标签*/
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`
}));
}
/** 计算折返点*/
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode];
if (serie.data.length > 0) {
var lastPoint = serie.data[serie.data.length - 1];
if (lastPoint[2] !== nextPoint[2]) {
var num = this.computedReentryNumber(elem.tripNumber);
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2], num), lastPoint[2]]);
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2], num), lastPoint[2]]);
}
}
/** 添加车组号数据到对应的服务图数据中*/
serie.data.push(nextPoint);
/** 保证原始数据排序*/
serie.data.sort((a, b) => {
return parseInt(a[0]) - parseInt(b[0]);
});
}
});
});
}
return series;
},
/** 初始化Y轴*/
initializeYaxis(stations) {
return createMarkLineModels(stations, (elem) => {
return this.EdgeHeight + elem.kmRange * this.CoordMultiple;
});
},
/** 将后台数据转换为试图序列模型*/
convertStationsToMap(stations) {
var map = {};
if (stations && stations.length) {
stations.forEach((elem) => {
map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple;
});
}
return map;
},
/** 计算y轴最小值*/
computedYaxisMinValue(stations) {
return stations[0].kmRange * this.CoordMultiple;
},
/** 计算y轴最大值*/
computedYaxisMaxValue(stations) {
return stations[stations.length - 1].kmRange * this.CoordMultiple + this.EdgeHeight * 2;
},
/** 格式化y轴数据*/
computedFormatYAxis(stations, params) {
var yText = '';
stations.forEach(elem => {
if (elem.kmRange < parseInt(params.value) / this.CoordMultiple - this.EdgeHeight) {
yText = elem.kmRange + 'm';
}
});
return yText;
},
/** 根据是否和上一个车次是否相交,计算下一个车次的折返的高度*/
computedReentryNumber(code) {
return parseInt(code || 1) % 2 ? 1 : 2;
},
/** 根据方向计算y折返偏移量*/
getYvalueByDirectionCode(defaultVlue, directionCode, num) {
if (directionCode === '1') {
defaultVlue -= this.EdgeHeight / 2 * num;
} else if (directionCode === '2') {
defaultVlue += this.EdgeHeight / 2 * num;
}
return defaultVlue;
},
/** 根据elem计算y值*/
getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial, num) {
var defaultVlue = 0;
var station = stations.find(it => { return it.code == elem.stationCode; });
if (station) {
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
if (isSpecial) {
defaultVlue = this.getYvalueByDirectionCode(defaultVlue, directionCode, num);
}
}
return defaultVlue;
}
};

View File

@ -1,114 +0,0 @@
<template>
<el-dialog class="default__systerm route-cancel" title="取消列车进路" :visible.sync="show" width="360px"
:before-close="cancel" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-row>
<el-col :span="10" :offset="1">
<span>集中站</span>
</el-col>
<el-col :span="10" :offset="2">
<span>始端信号机</span>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="1">
<el-input v-model="model.stationName" :disabled="true" size="mini"></el-input>
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="model.signalName" :disabled="true" size="mini"></el-input>
</el-col>
</el-row>
</el-row>
<el-row class="botton-group" style="margin-top:20px">
<el-col :span="4" :offset="10">
<el-button id="route_cancel_1" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="4" :offset="3">
<el-button id="route_cancel_0" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'RouteCancel',
data() {
return {
dialogShow: false,
loading: false,
model: {
operation: '',
stationName: '',
signalName: '',
signalCode: '',
}
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operation, selected) {
this.model.signalName = '';
this.model.stationCode = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.model.signalName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.model.stationName = station.name;
}
}
this.model.operation = operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>

View File

@ -1,91 +0,0 @@
<template>
<el-dialog class="default__systerm" title="人解列车进路" :visible.sync="show" width="420px" label-position="top"
:before-close="cancel" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<h3 style="text-align: center;">是否执行人解列车进路命令</h3>
<el-row class="botton-group">
<el-col :span="4" :offset="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'RouteCancel',
data() {
return {
dialogShow: false,
loading: false
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Signal.humanTrainRoute.menu.domId;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow() {
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Signal.humanTrainRoute.menu.operation
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>

View File

@ -1,171 +0,0 @@
<template>
<el-dialog class="default__systerm route-setting" title="排列进路" :visible.sync="show" width="380px"
:before-close="cancel" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-col :span="11">
<span>集中站</span>
</el-col>
<el-col :span="11" :offset="2">
<span>始端信号机</span>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="model.stationName" :disabled="true" size="mini"></el-input>
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="model.signalName" :disabled="true" size="mini"></el-input>
</el-col>
</el-row>
<div class="table">
<el-row>
<el-col :span="10">
<span style="height: 30px; line-height: 30px">进路列表</span>
</el-col>
<el-col :span="8" :offset="6">
<el-button :id="domIdChoose" @click="" style="float: right;" size="mini">展开进路预览</el-button>
</el-col>
</el-row>
<el-table ref="tempData" :show-header="false" :data="tempData" border style="width: 100%" :height="80"
size="mini" @row-click="clickEvent" highlight-current-row>
<el-table-column>
<template slot-scope="scope">
<span style="margin-left: 10px" :id="scope.row.code">{{ scope.row.name }}</span>
</template>
</el-table-column>
</el-table>
<el-row class="button-group">
<el-col :span="4" :offset="8">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="2" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</div>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'RouteSetting',
props: {
tempData: {
type: Array
}
},
data() {
return {
dialogShow: false,
loading: false,
row: null,
model: {
operation: '',
stationName: '',
signalName: '',
}
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''
},
domIdConfirm() {
return OperationEvent.Signal.arrangementRoute.menu.domId;
},
domIdChoose() {
return OperationEvent.Signal.arrangementRoute.choose.domId
},
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operation, selected) {
this.model.signalName = '';
this.model.stationCode = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.model.signalName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.model.stationName = station.name;
}
}
this.model.operation = operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
clickEvent(row, event, column) {
if (row) {
this.row = row;
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
val: this.row.code
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
},
commit() {
if (this.row) {
let operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.arrangementRoute.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
}
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
<style>
.el-table__row>:hover {
background-color: #c0c4cc !important;
}
.current-row>td {
background: #e4e3e3 !important;
}
</style>

View File

@ -1,145 +0,0 @@
<template>
<el-dialog class="default__systerm" title="区段控制" :visible.sync="show" width="420px" :before-close="cancel"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-col :span="3" :offset="1">
<span style="height:30px; line-height:30px">集中站</span>
</el-col>
<el-col :span="7">
<el-input v-model="model.stationName" :disabled="true" size="mini"></el-input>
</el-col>
<el-col :span="3" :offset="2">
<span style="height:30px; line-height:30px">区段名</span>
</el-col>
<el-col :span="7">
<el-input v-model="model.sectionName" :disabled="true" size="mini"></el-input>
</el-col>
</el-row>
<el-row style="margin-top:30px">
<el-col :offset="1">
<el-radio-group v-if="grou1" v-model="model.operation">
<el-radio :label="lock" :disabled="true">封锁</el-radio>
<el-radio :label="unlock" :disabled="true">解封</el-radio>
</el-radio-group>
<el-radio-group v-if="grou2" v-model="model.operation">
<el-radio :label="active" :disabled="true">激活</el-radio>
<el-radio :label="split" :disabled="true">切除</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row style="margin-top:30px">
<el-col :span="4" :offset="12">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit"> </el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
export default {
name: 'SectionControl',
data() {
return {
dialogShow: false,
loading: false,
domIdConfirm: '',
model: {
operation: '',
stationName: '',
sectionName: '',
returnCode: '',
}
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
grou1() {
return this.model.operation === this.lock || this.model.operation === this.unlock;
},
grou2() {
return this.model.operation === this.active || this.model.operation === this.split;
},
lock() {
return OperationEvent.Section.lock.menu.operation
},
unlock() {
return OperationEvent.Section.unlock.menu.operation
},
active() {
return OperationEvent.Section.active.menu.operation
},
split() {
return OperationEvent.Section.split.menu.operation
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''
},
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operation, selected, type) {
this.model.sectionName = '';
this.model.stationName = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
this.model.sectionName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.model.stationName = station.name;
}
}
this.dialogShow = true;
this.model.operation = operation;
this.domIdConfirm = getDomIdByOperation(operation);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Section.type,
operation: this.model.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
},
cancel() {
let operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>

View File

@ -1,237 +0,0 @@
<template>
<el-dialog class="default__systerm" title="区段控制" :visible.sync="show" width="500px" :before-close="cancel"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div style="padding: 10px 20px;border: 1px solid lightgray;">
<span class="base-label">准备</span>
<div style="margin-top: 10px">
<el-row type="flex" justify="center">
<el-col :span="4" :offset="2">区段</el-col>
<el-col :span="12">
<el-input :type="type" v-model="model.sectionName" size="mini" :disabled="true"></el-input>
</el-col>
<el-col :span="4" :offset="2">
<el-button id="section_fault_1" size="mini" @click="commitOnce" :disabled="type==='password'">确认
</el-button>
</el-col>
</el-row>
</div>
</div>
<div style="padding: 10px 20px;border: 1px solid lightgray;margin-top: 10px">
<span class="base-label">确认</span>
<div>
<el-row type="flex" justify="center">
<el-col :span="4" :offset="2">区段</el-col>
<el-col :span="12">
<el-select id="section_fault_select" v-model="model.name" filterable size="mini"
@change="sectionSelectChange" :disabled="type==='text'">
<el-option v-for="option in filterSections" :key="option.name" :label="option.name"
:value="option.name">
</el-option>
</el-select>
</el-col>
<el-col :span="4" :offset="2">
<el-button id="section_fault_2" size="mini" :loading="loading" @click="commit"
:disabled="type==='text'">确认</el-button>
</el-col>
</el-row>
</div>
</div>
<el-row type="flex" justify="left" style="margin-top:20px">
<el-col :span="4" :offset="1"> 操作倒计时</el-col>
<el-col :span="19">
<el-input v-model="model.time" size="mini" readonly="true"></el-input>
</el-col>
</el-row>
<el-row>
<el-col :offset="1"> 状态</el-col>
</el-row>
<el-row>
<el-col :offset="1" :span="23">
<el-input type="textarea" :rows="2" placeholder="" v-model="model.status">
</el-input>
</el-col>
</el-row>
<el-row class="botton-group" style="margin-top:20px">
<el-col :span="4" :offset="10">
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'SectionFault',
data() {
return {
dialogShow: false,
loading: false,
type: 'text',
timeout: 1000,
timenum: 30,
stepNum: 0,
task: null,
model: {
name: '',
sectionName: '',
operation: '',
status: '',
time: 0,
}
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
lock() {
return OperationEvent.Section.lock.menu.operation;
},
unlock() {
return OperationEvent.Section.unlock.menu.operation;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''
},
...mapGetters('map', [
'sectionList'
]),
filterSections() {
let i = 0, list = [];
if (this.sectionList) {
this.sectionList.forEach(elem => {
for (i = 0; i < list.length; i++) {
if (list[i].name === elem.name) {
break;
}
}
if (i >= list.length) {
list.push({ name: elem.name });
}
});
}
return list;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
stopTask() {
if (this.task) {
clearInterval(this.task);
}
this.task = null;
if (this.stepNum < 3) {
this.$store.dispatch('training/backSteps', this.stepNum);
this.$store.dispatch('training/emitTipFresh');
this.model.name = '';
this.model.time = '';
this.type = 'text';
}
},
doShow(operation, selected) {
this.model.sectionName = '';
this.model.sectionCode = '';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
this.model.sectionName = selected.name;
this.model.sectionCode = selected.code;
}
this.stepNum = 0;
this.model.operation = operation;
this.dialogShow = true;
this.stopTask();
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
waitSelectEvent() {
if (!this.$store.state.menuOperation.break) {
this.model.time -= 1;
if (this.model.time <= 0) {
this.stopTask();
}
}
},
commitOnce() {
this.stepNum = 1;
let operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.fault.prepare.operation
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.type = 'password';
this.model.time = this.timenum;
this.task = setInterval(this.waitSelectEvent, this.timeout);
}
})
},
sectionSelectChange(val) {
if (this.model.name === this.model.sectionName) {
this.stepNum = 2;
}
let operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.fault.select.operation,
val: val
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
})
},
commit() {
this.model.status = '';
if (this.model.name && this.model.name === this.model.sectionName) {
this.stepNum = 3;
let operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.fault.confirm.operation,
val: this.model.sectionCode
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.type = 'password';
this.stopTask();
}
}).catch(error => {
this.loading = false;
})
} else {
this.model.status = '区段选择错误';
}
},
cancel() {
let operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>

View File

@ -1,119 +0,0 @@
<template>
<el-dialog class="default__systerm" title="信号重开" :visible.sync="show" width="360px" :before-close="cancel"
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-position="top">
<el-row>
<el-col :span="10" :offset="1">
<el-form-item label="集中站">
<el-input v-model="model.stationName" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="10" :offset="2">
<el-form-item label="信号机">
<el-input v-model="model.signalName" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row class="botton-group" style="margin-top:20px">
<el-col :span="4" :offset="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="3" :offset="3">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
export default {
name: 'SignalReopen',
data() {
return {
dialogShow: false,
loading: false,
domIdConfirm: '',
model: {
operation: '',
stationName: '',
signalName: '',
signalCode: '',
}
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operation, selected) {
this.model.signalName = '';
this.model.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.model.signalName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.model.stationName = station.name;
}
}
this.model.operation = operation;
this.domIdConfirm = getDomIdByOperation(operation);
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.reopenSignal.menu.operation
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
},
cancel() {
let operate = {
type: MapDeviceType.Signal.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>

View File

@ -1,137 +0,0 @@
<template>
<el-dialog class="default__systerm" title="提前发车" :visible="show" width="420px" :before-close="cancel" :zIndex="2000"
:modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-col :span="3" :offset="1">
<span style="height:30px; line-height:30px">集中站</span>
</el-col>
<el-col :span="7">
<el-input v-model="model.stationName" :disabled="true" size="mini"></el-input>
</el-col>
<el-col :span="3" :offset="2">
<span style="height:30px; line-height:30px">站台</span>
</el-col>
<el-col :span="7">
<el-input v-model="model.stationStandName" :disabled="true" size="mini"></el-input>
</el-col>
</el-row>
<el-row style="margin-top:30px">
<el-col :offset="1">
<el-radio-group v-model="model.direction">
<el-radio :label="upstream" :disabled="true">本站台上行</el-radio>
<el-radio :label="downstream" :disabled="true">本站台下行</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row style="margin-top:30px">
<el-col :span="4" :offset="12">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit"> </el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
export default {
name: 'earlyDeparture',
data() {
return {
dialogShow: false,
loading: false,
trainNoList: [],
domIdConfirm: '',
model: {
direction: '',
operation: '',
stationName: '',
tripNumber: '',
stationStandName: '',
}
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
upstream() {
return '02' //: 02
},
downstream() {
return '01' //: 01
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operation, selected) {
this.model.stationName = '';
this.model.stationStandName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.model.stationStandName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.model.stationName = station.name;
}
}
this.dialogShow = true;
this.model.operation = operation;
this.domIdConfirm = getDomIdByOperation(operation);
this.model.direction = selected.direction;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: this.model.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
},
cancel() {
let operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>

View File

@ -1,242 +0,0 @@
<template>
<el-dialog class="default__systerm" title="跳停" :visible="show" width="540px" :before-close="cancel" :zIndex="2000"
:modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row style="margin-left:10px">
<el-col :span="3">
<span style="height:30px; line-height:30px">集中站</span>
</el-col>
<el-col :span="8">
<el-input v-model="model.stationName" :disabled="true" size="mini"></el-input>
</el-col>
<el-col :span="2" :offset="1">
<span style="height:30px; line-height:30px">站台</span>
</el-col>
<el-col :span="9">
<el-input v-model="model.stationStandName" :disabled="true" size="mini"></el-input>
</el-col>
</el-row>
<el-form label-width="70px" size="mini" style="margin:10px">
<el-row style="margin-top: 20px;padding: 10px 20px; border: 2px solid lightgray;">
<span class="base-label" style="display:block">范围</span>
<el-radio-group v-model="model.val1">
<el-form-item label-width="20px">
<el-radio :label="upstream" :disabled="model.direction !== '02'">本站台上行跳停</el-radio>
</el-form-item>
<el-form-item label-width="20px">
<el-radio :label="downstream" :disabled="model.direction !== '01'">本站台下行跳停</el-radio>
</el-form-item>
</el-radio-group>
<el-row>
<el-col :span="10">
<el-radio-group id="stand_upDown_choose" v-model="model.val2" @change="upAndDownStreamChange">
<el-form-item label-width="20px">
<el-radio :label="upstream" :disabled="model.direction !== '02'">指定列车上行跳停</el-radio>
</el-form-item>
<el-form-item label-width="20px">
<el-radio :label="downstream" :disabled="model.direction !== '01'">指定列车下行跳停</el-radio>
</el-form-item>
</el-radio-group>
</el-col>
<el-col :span="1"></el-col>
<el-col :span="13" align="top">
<span>车组号</span>
<el-select id="stand_trainNo_select" v-model="model.tripNumber" size="mini"
@change="trainNoSelectChange">
<el-option v-for="option in trainList" :key="option.groupNumber" :label="option.groupNumber"
:value="option.groupNumber">
</el-option>
</el-select>
</el-col>
</el-row>
</el-row>
<el-row style="margin-top: 20px; padding: 10px 20px; border: 2px solid lightgray;">
<span class="base-label">功能</span>
<el-form-item label-width="20px">
<el-radio-group v-model="model.operation">
<el-radio :label="JumpStopSet" :disabled="true">设置</el-radio>
<el-radio :label="JumpStopCancel" :disabled="true">取消</el-radio>
</el-radio-group>
</el-form-item>
</el-row>
</el-form>
<el-row style="margin-top:20px">
<el-col :span="4" :offset="10">
<el-button id="stand_jumpstop_1" type="primary" :loading="loading" @click="commit"> </el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
export default {
name: 'StationStandControl',
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
domIdConfirm: '',
model: {
val1: '',
val2: '',
tripNumber: '',
direction: '',
operation: '',
stationName: '',
stationStandName: '',
}
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
upstream() {
return '02'; //
},
downstream() {
return '01'; //
},
JumpStopSet() {
return OperationEvent.StationStand.setJumpStop.menu.operation;
},
JumpStopCancel() {
return OperationEvent.StationStand.cancelJumpStop.menu.operation;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}
},
watch: {
'model.val1'(val) {
if (val) this.model.val2 = '';
},
'model.val2'(val) {
if (val) this.model.val1 = '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
//
//direction 01: /02:
//directionType 02:/ 03:
let directionType = this.model.direction === '02' ? '02' : '03';
this.trainList = this.$store.getters['map/viewTrainListBy'](directionType);
},
doShow(operation, selected) {
this.model.stationName = '';
this.model.stationStandName = '';
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.model.stationStandName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.model.stationName = station.name;
}
}
this.dialogShow = true;
this.model.direction = selected.direction;
this.model.operation = operation;
this.domIdConfirm = getDomIdByOperation(operation);
this.model.val1 = this.selected.direction //, 01: /02:
this.model.val2 = '';
this.model.tripNumber = '';
/** 加载列车数据*/
this.loadInitData(this.map);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
upAndDownStreamChange(val) {
let operation = this.val2 == this.JumpStopSet ?
OperationEvent.StationStand.setJumpStop.choose.operation : OperationEvent.StationStand.cancelJumpStop.choose.operation;
let operate = {
type: MapDeviceType.StationStand.type,
operation: operation,
val: val
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
trainNoSelectChange(val) {
let operation = this.val2 == this.JumpStopSet ?
OperationEvent.StationStand.setJumpStop.select.operation : OperationEvent.StationStand.cancelJumpStop.select.operation;
let operate = {
type: MapDeviceType.StationStand.type,
operation: operation,
val: val
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
commit() {
let val = this.model.val1;
if (this.model.val2) {
val = this.model.val2 + '::' + this.model.tripNumber;
}
let operate = {
send: true,
type: MapDeviceType.StationStand.type,
operation: this.model.operation,
val: val
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
},
cancel() {
let operate = {
type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>

View File

@ -1,151 +0,0 @@
<template>
<el-dialog class="default__systerm" title="道岔控制" :visible="show" width="420px" :before-close="cancel" :zIndex="2000"
:modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form label-width="70px" size="mini">
<el-row>
<el-col :span="3" :offset="1">
<span style="height:30px; line-height:30px">集中站</span>
</el-col>
<el-col :span="7">
<el-input v-model="model.stationName" :disabled="true" size="mini"></el-input>
</el-col>
<el-col :span="3" :offset="2">
<span style="height:30px; line-height:30px">道岔</span>
</el-col>
<el-col :span="7">
<el-input v-model="model.switchName" :disabled="true" size="mini"></el-input>
</el-col>
</el-row>
<el-row style="margin-top: 30px;">
<el-col :offset="1">
<el-radio-group v-if="group1" v-model="model.operation">
<el-radio :label="lock" :disabled="true">单锁</el-radio>
<el-radio :label="unlock" :disabled="true">解锁</el-radio>
</el-radio-group>
<el-radio-group v-if="group2" v-model="model.operation">
<el-radio :label="locate" :disabled="true">道岔定位</el-radio>
<el-radio :label="reverse" :disabled="true">道岔反位</el-radio>
</el-radio-group>
</el-col>
</el-row>
</el-form>
<el-row style="margin-top: 30px;">
<el-col :span="4" :offset="12">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit"> </el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
export default {
name: 'SwitchControl',
data() {
return {
dialogShow: false,
loading: false,
domIdConfirm: '',
model: {
operation: '',
stationName: '',
switchName: '',
}
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
group1() {
return this.model.operation === this.lock || this.model.operation === this.unlock;
},
group2() {
return this.model.operation === this.locate || this.model.operation === this.reverse;
},
lock() {
return OperationEvent.Switch.lock.menu.operation;
},
unlock() {
return OperationEvent.Switch.unlock.menu.operation;
},
locate() {
return OperationEvent.Switch.locate.menu.operation;
},
reverse() {
return OperationEvent.Switch.reverse.menu.operation;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
doShow(operation, selected) {
this.model.switchName = '';
this.model.stationName = '';
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
this.model.switchName = selected.name
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.model.stationName = station.name;
}
}
this.dialogShow = true;
this.model.operation = operation;
this.domIdConfirm = getDomIdByOperation(operation);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Switch.type,
operation: this.model.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
},
cancel() {
let operate = {
type: MapDeviceType.Switch.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>

View File

@ -1,135 +0,0 @@
<template>
<el-dialog class="default__systerm" title="设置列车" :visible.sync="show" width="420px" label-position="top"
:before-close="cancel" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form :model="formModel" size="small" label-width="100px">
<el-form-item label="列车:" prop="trainCode">
<el-select v-model="formModel.trainCode" filterable placeholder="列车">
<el-option v-for="item in trainList" :key="item.code" :label="item.groupNumber" :value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="列车车次:" prop="tripNumber">
<el-select v-model="formModel.tripNumber" filterable placeholder="列车车次">
<el-option v-for="no in trainNoList" :key="no" :label="no" :value="no"></el-option>
</el-select>
<div style="font-size: 12px;">(上行路线车次号选择偶数下行路线车次号选择基数)</div>
</el-form-item>
</el-form>
<el-row class="botton-group">
<el-col :span="4" :offset="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import { getPublishMapTrainNos } from '@/api/runplan';
export default {
name: 'RouteCancel',
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
formModel: {
trainCode: '',
tripNumber: ''
},
selected: null
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (Object.keys(map || {}).length) {
getPublishTrainList(map.skinStyle).then(response => {
this.trainList = response.data;
}).catch(error => {
this.$messageBox(`获取列车列表失败`);
})
getPublishMapTrainNos(map.skinStyle).then(response => {
this.trainNoList = response.data;
}).catch(error => {
this.$messageBox(`获取列车车次失败`);
});
}
},
doShow(operation, selected) {
this.dialogShow = true;
this.selected = selected;
/** 加载列车数据*/
this.loadInitData(this.map);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.formModel.tripNumber + '::' + this.formModel.trainCode
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose();
});
}
}
}
</script>

View File

@ -1,251 +0,0 @@
<template>
<div class="menus">
<menu-cancel ref="menuCancel"></menu-cancel>
<template v-if="!isShowAll">
<menu-button ref="menuButton"></menu-button>
<menu-station-control ref="menuStationControl" :selected="selected"></menu-station-control>
<menu-station-stand ref="menuStationStand" :selected="selected"></menu-station-stand>
<menu-switch ref="menuSwitch" :selected="selected"></menu-switch>
<menu-signal ref="menuSignal" :selected="selected"></menu-signal>
<menu-section ref="menuSection" :selected="selected"></menu-section>
<menu-train ref="menuTrain" :selected="selected"></menu-train>
</template>
</div>
</template>
<script>
import MenuCancel from './menuCancel';
import MenuButton from './menuButton';
import MenuSignal from './menuSignal';
import MenuStationControl from './menuStationControl';
import MenuStationStand from './menuStationStand';
import MenuSwitch from './menuSwitch';
import MenuSection from './menuSection';
import MenuTrain from './menuTrain';
export default {
name: 'Menus',
components: {
MenuCancel,
MenuButton,
MenuSignal,
MenuSwitch,
MenuSection,
MenuStationControl,
MenuStationStand,
MenuTrain,
},
props: {
selected: {
type: Object
}
},
computed: {
isShowAll() {
return this.$route.params.mode == 'dp'
}
},
data() {
return {
}
},
mounted() {
this.$store.dispatch('config/updateMenuBar');
}
}
</script>
<style>
.menus {
position: absolute;
}
.menus .pop-menu {
background: #F4F4F4;
}
.menus .pop-menu span {
color: #000;
}
.menus .pop-menu .is-disabled span {
color: #B4B3B8;
}
.default__systerm .el-dialog {
background: #FFFFFF;
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
border: 1px solid #C3C3C3;
border-radius: 4px;
color: #000;
font-size: 14px;
}
.default__systerm .el-dialog .el-dialog__header {
height: 40px;
padding: 5px;
}
.default__systerm .el-dialog .el-dialog__footer {
background: #FFFFFF;
opacity: 1;
}
.default__systerm .el-dialog .el-dialog__body {
padding: 20px 10px 20px 10px;
margin: 10px;
border: 2px solid #C3C3C3;
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
color: #000;
background: #FFFFFF;
opacity: 1;
}
.default__systerm .el-dialog .el-dialog__title {
margin-left: 10px;
font-size: 16px;
background: rgba(226, 226, 226, 0.5);
}
.default__systerm .el-dialog .el-dialog__headerbtn {
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: -o-linear-gradient(#CD98A0, #C27D6E #B63022, #C68770);
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border-left: 2px solid rgba(120, 121, 123, 0.5);
border-right: 2px solid rgba(120, 121, 123, 0.5);
border-bottom: 2px solid rgba(120, 121, 123, 0.5);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
top: 0px;
right: 3px;
line-height: 22px;
width: 60px;
}
.default__systerm .el-dialog .el-dialog__headerbtn .el-icon-close:before {
font-size: 16px;
}
.default__systerm .el-dialog .el-dialog__headerbtn .el-dialog__close {
color: #fff;
}
.default__systerm .el-dialog .el-button {
height: 30px;
line-height: 30px;
padding: 0px;
width: 80px;
border: 1px solid #B9B9B9;
border-radius: 4px !important;
color: #000;
background: #F0F0F0;
background: -webkit-linear-gradient(#FFFFFF, #DEDEDE);
background: -o-linear-gradient(#FFFFFF, #DEDEDE);
background: -moz-linear-gradient(#FFFFFF, #DEDEDE);
background: linear-gradient(#FFFFFF, #DEDEDE);
}
.default__systerm .el-dialog .el-button:focus span {
border: 1px dashed gray;
}
.default__systerm .el-dialog .el-button:active {
border: 2px inset #E2E2E2;
}
.default__systerm .el-dialog .el-button:disabled {
border: 2px outset #E2E2E2;
}
.default__systerm .el-dialog .el-button:disabled span {
border: 0px;
}
.default__systerm .el-dialog .el-input {
border: 1px solid #B9B9B9;
}
.default__systerm .el-dialog .el-input .el-input__inner {
color: #000;
background: #F0F0F0;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.default__systerm .el-dialog .el-textarea {
border: 1px solid #B9B9B9;
border-radius: 0px;
}
.default__systerm .el-dialog .el-textarea .el-textarea__inner {
color: #000;
background: #F0F0F0;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.default__systerm .el-dialog .el-table {
border: 1px solid #B9B9B9;
}
.default__systerm .el-dialog .el-table th.is-leaf {
background: #F0F0F0 !important;
border-right: 1px solid #BDBDBD !important;
border-bottom: 1px solid #BDBDBD !important;
height: 20px !important;
padding: 0px;
}
.default__systerm .el-dialog .el-table tr td {
height: 20px !important;
padding: 0px;
}
.default__systerm .el-dialog .el-table__row>:hover {
background-color: #c0c4cc !important;
}
.default__systerm .el-dialog .current-row>td {
background: #e4e3e3 !important;
}
.default__systerm .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -15px;
top: -18px;
}
.default__systerm .el-dialog .el-form-item label {
font-weight: normal !important;
color: #000 !important;
padding: 0px 0px 5px;
}
.default__systerm .el-dialog .el-row {
margin-bottom: 5px;
}
.default__systerm .el-dialog .context {
height: 160px;
border: 2px inset #E2E2E2;
}
.default__systerm .el-dialog .table {
margin-top: 20px;
}
.default__systerm .el-dialog .notice {
margin-left: 62px;
line-height: 30px;
}
.default__systerm .el-dialog .button-group {
margin-top: 10px;
}
</style>

View File

@ -1,305 +0,0 @@
<template>
<div class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }" v-if="!isScreen">
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id='Signal.arrangementRoute.button.domId' @click="buttonDown(Signal.arrangementRoute.button.operation)">
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Signal.cancelTrainRoute.button.operation"
@click="buttonDown(Signal.cancelTrainRoute.button.operation)">
<span style="color: black">
<center>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Signal.reopenSignal.button.operation" @click="buttonDown(Signal.reopenSignal.button.operation)">
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Signal.humanTrainRoute.button.operation" @click="buttonDown(Signal.humanTrainRoute.button.operation)">
<span style="color: red">
<center>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" id="mbm_05"
@click="buttonDown('mbm_05')">
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" id="mbm_06"
@click="buttonDown('mbm_06')">
<span style="color: red">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px',backgroundColor:buttonUpColor}"
:id="Switch.locate.button.operation" @click="buttonDown(Switch.locate.button.operation)">
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Switch.reverse.button.operation" @click="buttonDown(Switch.reverse.button.operation)">
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Switch.lock.button.operation" @click="buttonDown(Switch.lock.button.operation)">
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
:id="Switch.unlock.button.operation" @click="buttonDown(Switch.unlock.button.operation)">
<span style="color: red">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" id="mbm_11"
@click="buttonDown('mbm_11')">
<span style="color: black">
<center>
<b style="color:deepskyblue"></b>
<b style="color:burlywood"></b>
</center>
<center>
<b style="color: red"></b>
<b style="color:forestgreen"></b>
</center>
</span>
</button>
<button :style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}" id="mbm_12"
@click="buttonDown('mbm_12')">
<span style="color: black">
<center>
<b></b>
<b></b>
</center>
<center>
<b></b>
<b></b>
</center>
</span>
</button>
</div>
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { getDomOffset } from '@/utils/index';
export default {
name: 'MapButtonMenu',
data() {
return {
__type: 'mbm',
point: {
x: -1000,
y: -1000
},
operation: '0',
buttonName: '',
buttonDownColor: '#A8A8A8',
buttonUpColor: '#DCDCDC',
width: 58,
tempData: null,
offset: {},
}
},
computed: {
Switch() {
return OperationEvent.Switch;
},
Signal() {
return OperationEvent.Signal;
},
isScreen() { //
return this.$route.params.mode === 'dp'
}
},
watch: {
'$store.state.config.canvasOffsetCount': function (val) {
this.resetPosition();
},
'$store.state.menuOperation.buttonOperation': function (val, old) {
this.updateButtonShow(val, old);
},
'$store.state.menuOperation.selectedCount': function (val) {
this.selectedChange();
},
},
mounted() {
this.resetPosition();
},
methods: {
resetPosition() {
this.$nextTick(() => {
let canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
}
this.$store.dispatch('training/tipReload');
})
},
updateButtonShow(val, old) {
if (old) {
//
let domId = getDomIdByOperation(old);
let dom = document.getElementById(domId);
if (dom) {
dom.disabled = false;
dom.style.backgroundColor = this.buttonUpColor;
}
}
if (val) {
//
let domId = getDomIdByOperation(val);
let dom = document.getElementById(domId);
if (dom) {
dom.disabled = true;
dom.style.backgroundColor = this.buttonDownColor;
}
}
},
buttonDown(operation) {
if (!this.$store.state.menuOperation.buttonOperation) {
let operate = {
type: 'mbm',
operation: operation
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', operation);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('training/emitTipFresh');
}
});
}
},
selectedChange() {
//
if (this.$store.state.menuOperation.buttonOperation) {
let model = this.$store.state.menuOperation.selected;
if (model && model._type) {
let deviceType = MapDeviceType[model._type];
if (deviceType && deviceType.type) {
let operate = {
send: true,
model: model,
code: model.code,
type: deviceType.type,
operation: this.$store.state.menuOperation.buttonOperation,
tempData: this.tempData
}
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response) {
this.tempData = response.data;
}
}
});
}
}
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
$bg: #fff;
$hoverBg: #f5f7fa;
.menu {
background-color: $bg;
position: fixed;
border: 1px solid gray;
z-index: 1000;
display: block;
.dsp-block {
display: block;
text-align: center;
border-radius: unset;
width: 100%;
}
.dsp-block:hover {
background-color: $hoverBg;
}
}
</style>

View File

@ -1,119 +0,0 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuTrain: [
{
label: '命令下达',
handler: this.commandSend,
disabled: true
},
{
label: '命令清除',
handler: this.commandClear,
disabled: true
}
],
menuScreen: [
{
label: '放大地图',
handler: this.magnifyMap,
disabled: false
},
{
label: '缩小地图',
handler: this.shrinkMap,
disabled: false
},
{
label: '返回',
handler: this.back,
disabled: false
}
]
}
},
computed: {
isScreen() { //
return this.$route.params.mode === 'dp'
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
if (!this.isScreen && this.menu && this.menu.length > 1) {
this.menu[0].disabled = (this.menu[0] && val) ? true : true;
this.menu[1].disabled = (this.menu[1] && val) ? false : true;
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
doShow(point) {
this.menu = [];
this.clickEvent();
if (this.$refs && this.$refs.popMenu) {
if (this.isScreen) {
this.menu = [...this.menu, ...this.menuScreen];
} else {
this.menu = [...this.menu, ...this.menuTrain];
}
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
commandClear() {
OperateHandler.cleanOperates(); //
this.$store.dispatch('menuOperation/reset');
this.$store.dispatch('menuOperation/handleBreakFlag', { break: false });
},
commandSend() {
},
//
magnifyMap() {
this.$store.dispatch('menuOperation/handleMagnifyCount');
},
//
shrinkMap() {
this.$store.dispatch('menuOperation/handleShrinkCount');
},
//
back() {
history.go(-1);
exitFullscreen();
}
}
}
</script>

View File

@ -1,357 +0,0 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<section-fault ref="sectionfault"></section-fault>
<section-control ref="sectionControl"></section-control>
<train-create ref="trainCreate"></train-create>
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SectionFault from './dialog/sectionfault';
import SectionControl from './dialog/sectioncontrol';
import TrainCreate from './dialog/traincreate';
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert } from './utils/menuItemStatus';
export default {
name: 'SectionMenu',
components: {
PopMenu,
SectionFault,
SectionControl,
TrainCreate
},
props: {
selected: {
type: Object
}
},
data() {
return {
menu: [],
menuNormal: [
{
label: '封锁',
handler: this.lock,
disabledCallback: MenuDisabledState.Section.lock
},
{
label: '解禁',
handler: this.unlock,
disabledCallback: MenuDisabledState.Section.unlock
},
{
label: '区故解',
handler: this.fault,
disabledCallback: MenuDisabledState.Section.fault
},
{
label: '区段跟踪激活',
handler: this.active,
disabledCallback: MenuDisabledState.Section.active
},
{
label: '区段跟踪切除',
handler: this.split,
disabledCallback: MenuDisabledState.Section.split
},
{
label: '确认计轴有效',
handler: this.sureAxleEffective,
disabledCallback: MenuDisabledState.Section.sureAxleEffective
},
{
label: '设置临时限速',
handler: this.setTemporarySpeedLimit,
disabledCallback: MenuDisabledState.Section.setTemporarySpeedLimit
},
{
label: '查看设备状态',
handler: this.viewDeviceStatus,
disabledCallback: MenuDisabledState.Section.viewDeviceStatus
}
],
menuAdmin: [
{
label: '新建列车',
handler: this.newTrain,
disabledCallback: MenuDisabledState.Section.newTrain
},
{
label: '空闲',
handler: this.spare,
disabledCallback: MenuDisabledState.Section.spare
},
{
label: '故障锁闭',
handler: this.faultLock,
disabledCallback: MenuDisabledState.Section.faultLock
}
],
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Section.setStoppage
},
{
label: '取消故障',
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Section.cancelStoppage
}
]
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
initMenu() {
//
if (this.operatemode === OperateMode.ADMIN) {
this.menu = this.menuAdmin;
} else {
this.menu = this.menuNormal;
}
//
if (this.mode === TrainingMode.EDIT) {
this.menu = [...this.menu, ...this.menuForce]
}
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.stoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
cancelStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.cancelStoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
lock() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.lock.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate.operation, this.selected);
}
});
},
//
unlock() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.unlock.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate.operation, this.selected);
}
});
},
//
fault() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.fault.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionfault.doShow(operate.operation, this.selected);
}
});
},
//
active() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.active.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate.operation, this.selected);
}
});
},
//
split() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.split.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionControl.doShow(operate.operation, this.selected);
}
});
},
//
sureAxleEffective() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
setTemporarySpeedLimit() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
viewDeviceStatus() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
newTrain() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Section.type,
label: MapDeviceType.Section.label,
operation: OperationEvent.Section.newtrain.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainCreate.doShow(operate.operation, this.selected);
}
})
},
//
spare() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
// let operate = {
// start: true,
// code: this.selected.code,
// type: MapDeviceType.Section.type,
// label: MapDeviceType.Section.label,
// operation: OperationEvent.Section.split.menu.operation
// };
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.trainCreate.doShow(operate.operation, this.selected);
// }
// })
},
//
faultLock() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
// let operate = {
// start: true,
// code: this.selected.code,
// type: MapDeviceType.Section.type,
// label: MapDeviceType.Section.label,
// operation: OperationEvent.Section.split.menu.operation
// };
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.trainCreate.doShow(operate.operation, this.selected);
// }
// })
}
}
}
</script>

View File

@ -1,351 +0,0 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<route-setting ref="routeSetting" :tempData="tempData"></route-setting>
<route-cancel ref="routeCancel"></route-cancel>
<route-relieve ref="routeRelieve"></route-relieve>
<signal-reopen ref="signalReopen"></signal-reopen>
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import RouteSetting from './dialog/routesetting';
import RouteCancel from './dialog/routecancel';
import RouteRelieve from './dialog/routerelieve';
import SignalReopen from './dialog/signalreopen';
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert } from './utils/menuItemStatus';
export default {
name: 'SignalMenu',
components: {
PopMenu,
RouteSetting,
RouteCancel,
RouteRelieve,
SignalReopen
},
props: {
selected: {
type: Object
}
},
data() {
return {
tempData: [],
menu: [],
menuNormal: [
{
label: '排列进路',
handler: this.arrangementRoute,
disabledCallback: MenuDisabledState.Signal.arrangementRoute
},
{
label: '取消列车进路',
handler: this.cancelTrainRoute,
disabledCallback: MenuDisabledState.Signal.cancelTrainRoute
},
{
label: '人解列车进路',
handler: this.humanTrainRoute,
disabledCallback: MenuDisabledState.Signal.humanTrainRoute
},
{
label: '封锁',
handler: this.lock,
disabledCallback: MenuDisabledState.Signal.lock
},
{
label: '解锁',
handler: this.unlock,
disabledCallback: MenuDisabledState.Signal.unlock
},
{
label: '设置自动通过进路',
handler: this.setUpAutomaticRoute,
disabledCallback: MenuDisabledState.Signal.setUpAutomaticRoute
},
{
label: '信号重开',
handler: this.reopenSignal,
disabledCallback: MenuDisabledState.Signal.reopenSignal
},
{
label: '引导',
handler: this.guide,
disabledCallback: MenuDisabledState.Signal.guide
},
{
label: '进路交人工控',
handler: this.routeToIndustrialControl,
disabledCallback: MenuDisabledState.Signal.routeToIndustrialControl
},
{
label: '进路交自动控',
handler: this.routeToAutomaticControl,
disabledCallback: MenuDisabledState.Signal.routeToAutomaticControl
},
{
label: '查询进路控制状态',
handler: this.queryRouteAutomaticState,
disabledCallback: MenuDisabledState.Signal.queryRouteAutomaticState
}
],
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Signal.setStoppage
},
{
label: '取消故障',
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Signal.cancelStoppage
}
]
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
initMenu() {
//
this.menu = this.menuNormal;
//
if (this.mode === TrainingMode.EDIT) {
this.menu = [...this.menu, ...this.menuForce]
}
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.stoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
cancelStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.cancelStoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
arrangementRoute() {
let operate = {
start: true,
send: true,
model: this.selected,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.arrangementRoute.menu.operation
}
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response) {
this.tempData = response.data;
} else {
this.tempData = null;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeSetting.doShow(operate.operation, this.selected);
}
});
},
//
cancelTrainRoute() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeCancel.doShow(operate.operation, this.selected);
}
});
},
//
humanTrainRoute() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.humanTrainRoute.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.routeRelieve.doShow(operate.operation, this.selected);
}
});
},
//
lock() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
// let operate = {
// start: true,
// send: true,
// code: this.selected.code,
// type: MapDeviceType.Signal.type,
// label: MapDeviceType.Signal.label,
// operation: OperationEvent.Signal.lock.menu.operation
// };
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.routeSetting.doShow(operate.operation, this.selected);
// }
// });
},
//
unlock() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
// let operate = {
// start: true,
// send: true,
// code: this.selected.code,
// type: MapDeviceType.Signal.type,
// label: MapDeviceType.Signal.label,
// operation: OperationEvent.Signal.unlock.menu.operation
// };
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// this.$refs.routeSetting.doShow(operate.operation, this.selected);
// }
// });
},
//
setUpAutomaticRoute() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
reopenSignal() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Signal.type,
label: MapDeviceType.Signal.label,
operation: OperationEvent.Signal.reopenSignal.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.signalReopen.doShow(operate.operation, this.selected);
}
});
},
//
guide() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
routeToIndustrialControl() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
routeToAutomaticControl() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
queryRouteAutomaticState() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
}
}
}
</script>

View File

@ -1,206 +0,0 @@
<template>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert } from './utils/menuItemStatus';
export default {
name: 'StationControlMenu',
components: { PopMenu },
props: {
selected: {
type: Object
}
},
data() {
return {
menu: [],
menuNormal: [
{
label: '紧急站控',
handler: this.emergencyStationControl,
disabledCallback: MenuDisabledState.StationControl.emergencyStationControl
},
{
label: '请求站控',
handler: this.requestStationControl,
disabledCallback: MenuDisabledState.StationControl.requestStationControl
},
{
label: '强行站控',
handler: this.forcedStationControl,
disabledCallback: MenuDisabledState.StationControl.forcedStationControl
},
{
label: '请求中控',
handler: this.requestCentralControl,
disabledCallback: MenuDisabledState.StationControl.requestCentralControl
}
],
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
disabledCallback: MenuDisabledState.StationControl.setStoppage
},
{
label: '取消故障',
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.StationControl.cancelStoppage
}
]
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationControl) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
initMenu() {
//
this.menu = this.menuNormal;
//
if (this.mode === TrainingMode.EDIT) {
this.menu = [...this.menu, ...this.menuForce]
}
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationControl.type,
label: MapDeviceType.StationControl.label,
operation: OperationEvent.StationControl.stoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
})
},
//
cancelStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationControl.type,
label: MapDeviceType.StationControl.label,
operation: OperationEvent.StationControl.cancelStoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
emergencyStationControl() {
let operate = {
start: true,
send: true,
val: this.selected.code,
type: MapDeviceType.StationControl.type,
label: MapDeviceType.StationControl.label,
operation: OperationEvent.StationControl.emergencyStationControl.menu.operation
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
})
},
requestStationControl() {
let operate = {
start: true,
send: true,
val: this.selected.code,
type: MapDeviceType.StationControl.type,
label: MapDeviceType.StationControl.label,
operation: OperationEvent.StationControl.requestStationControl.menu.operation
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
})
},
forcedStationControl() {
let operate = {
start: true,
send: true,
val: this.selected.code,
type: MapDeviceType.StationControl.type,
label: MapDeviceType.StationControl.label,
operation: OperationEvent.StationControl.forcedStationControl.menu.operation
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
})
},
requestCentralControl() {
let operate = {
start: true,
send: true,
val: this.selected.code,
type: MapDeviceType.StationControl.type,
label: MapDeviceType.StationControl.label,
operation: OperationEvent.StationControl.requestCentralControl.menu.operation
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
})
}
}
}
</script>

View File

@ -1,277 +0,0 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<stand-jump-stop ref="standJumpStop"></stand-jump-stop>
<stand-early-departure ref="standEarlyDeparture"></stand-early-departure>
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import StandJumpStop from './dialog/standjumpstop';
import StandEarlyDeparture from './dialog/standearlydeparture';
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert } from './utils/menuItemStatus';
export default {
name: 'StationStandMenu',
components: {
PopMenu,
StandJumpStop,
StandEarlyDeparture
},
props: {
selected: {
type: Object
}
},
data() {
return {
menu: [],
menuNormal: [
// {
// label: '',
// handler: this.setDetainTrain,
// disabledCallback: MenuDisabledState.StationStand.setDetainTrain
// },
// {
// label: '',
// handler: this.cancelDetainTrain,
// disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain
// },
{
label: '设置跳停',
handler: this.setJumpStop,
disabledCallback: MenuDisabledState.StationStand.setJumpStop
},
{
label: '取消跳停',
handler: this.cancelJumpStop,
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop
},
{
label: '提前发车',
handler: this.earlyDeparture,
disabledCallback: MenuDisabledState.StationStand.earlyDeparture
},
{
label: '站台详细信息',
handler: this.stationStandDetail,
disabledCallback: MenuDisabledState.StationStand.stationStandDetail
}
],
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
disabledCallback: MenuDisabledState.StationStand.setStoppage
},
{
label: '取消故障',
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
},
// {
// label: '',
// handler: this.forceOpenDoor,
// disabledCallback: MenuDisabledState.StationStand.forceOpenDoor
// },
// {
// label: '',
// handler: this.forceCloseDoor,
// disabledCallback: MenuDisabledState.StationStand.forceCloseDoor
// }
]
}
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
initMenu() {
//
this.menu = this.menuNormal;
//
if (this.mode === TrainingMode.EDIT) {
this.menu = [...this.menu, ...this.menuForce]
}
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.stoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
cancelStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
// //
// forceOpenDoor() {
// let operate = {
// start: true,
// send: true,
// code: this.selected.code,
// type: MapDeviceType.StationStand.type,
// label: MapDeviceType.StationStand.label,
// operation: OperationEvent.StationStand.forceOpenDoor.menu.operation
// };
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// }
// })
// },
// //
// forceCloseDoor() {
// let operate = {
// start: true,
// send: true,
// code: this.selected.code,
// type: MapDeviceType.StationStand.type,
// label: MapDeviceType.StationStand.label,
// operation: OperationEvent.StationStand.forceCloseDoor.menu.operation
// };
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// }
// })
// },
//
setDetainTrain() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
cancelDetainTrain() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
setJumpStop() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.setJumpStop.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standJumpStop.doShow(operate.operation, this.selected);
}
});
},
//
cancelJumpStop() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standJumpStop.doShow(operate.operation, this.selected);
}
});
},
//
earlyDeparture() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.StationStand.type,
label: MapDeviceType.StationStand.label,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.standEarlyDeparture.doShow(operate.operation, this.selected);
}
});
},
//
stationStandDetail() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
}
}
}
</script>

View File

@ -1,277 +0,0 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<switch-control ref="switchControl"></switch-control>
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import SwitchControl from './dialog/switchcontrol';
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert } from './utils/menuItemStatus';
export default {
name: 'SwitchMenu',
components: {
PopMenu,
SwitchControl
},
props: {
selected: {
type: Object
}
},
data() {
return {
menu: [],
menuNormal: [
{
label: '定操',
handler: this.normalIndication,
disabledCallback: MenuDisabledState.Switch.normalIndication
},
{
label: '反操',
handler: this.reverseIndication,
disabledCallback: MenuDisabledState.Switch.reverseIndication
},
{
label: '单锁',
handler: this.lock,
disabledCallback: MenuDisabledState.Switch.lock
},
{
label: '解锁',
handler: this.unlock,
disabledCallback: MenuDisabledState.Switch.unlock
},
{
label: '封锁',
handler: this.block,
disabledCallback: MenuDisabledState.Switch.block
},
{
label: '区故解',
handler: this.fault,
disabledCallback: MenuDisabledState.Switch.fault
},
{
label: '区段跟踪激活',
handler: this.active,
disabledCallback: MenuDisabledState.Switch.active
},
{
label: '区段跟踪切除',
handler: this.splite,
disabledCallback: MenuDisabledState.Switch.splite
},
{
label: '查看设备状态',
handler: this.viewDeviceStatus,
disabledCallback: MenuDisabledState.Switch.viewDeviceStatus
}
],
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Switch.setStoppage
},
{
label: '取消故障',
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Section.cancelStoppage
}
]
}
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
initMenu() {
//
this.menu = this.menuNormal;
//
if (this.mode === TrainingMode.EDIT) {
this.menu = [...this.menu, ...this.menuForce]
}
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.stoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
cancelStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.cancelStoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
normalIndication() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.locate.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate.operation, this.selected);
}
});
},
//
reverseIndication() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.reverse.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate.operation, this.selected);
}
});
},
//
lock() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.lock.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate.operation, this.selected);
}
});
},
//
unlock() {
let operate = {
start: true,
code: this.selected.code,
type: MapDeviceType.Switch.type,
label: MapDeviceType.Switch.label,
operation: OperationEvent.Switch.unlock.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate.operation, this.selected);
}
});
},
//
block() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
fault() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
active() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
splite() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
//
viewDeviceStatus() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
},
}
}
</script>

View File

@ -1,201 +0,0 @@
<template>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert } from './utils/menuItemStatus';
export default {
name: 'menuTrain',
components: { PopMenu },
props: {
selected: {
type: Object
}
},
data() {
return {
menu: [],
menuNormal: [
{
label: '删除列车',
handler: this.remove,
disabledCallback: MenuDisabledState.Train.remove
},
{
label: '运行',
handler: this.run,
disabledCallback: MenuDisabledState.Train.run
},
{
label: '停止',
handler: this.stop,
disabledCallback: MenuDisabledState.Train.stop
}
],
menuForce: [
{
label: '设置故障',
handler: this.setStoppage,
disabledCallback: MenuDisabledState.Train.setStoppage
},
{
label: '取消故障',
handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Train.cancelStoppage
}
]
}
},
watch: {
'$store.state.menuOperation.menuCount': function () {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
methods: {
clickEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
initMenu() {
//
this.menu = this.menuNormal;
//
if (this.mode === TrainingMode.EDIT) {
this.menu = [...this.menu, ...this.menuForce]
}
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce
}
this.menu = menuConvert(this.menu);
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
setStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.stoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
cancelStoppage() {
let operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label,
operation: OperationEvent.Train.cancelStoppage.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
//
remove() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
// let operate = {
// start: true,
// send: true,
// code: this.selected.code,
// type: MapDeviceType.Train.type,
// label: MapDeviceType.Train.label,
// operation: OperationEvent.Train.remove.menu.operation
// }
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.doClose();
// }
// })
},
//
run() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
// let operate = {
// start: true,
// send: true,
// code: this.selected.code,
// type: MapDeviceType.Train.type,
// label: MapDeviceType.Train.label,
// operation: OperationEvent.Train.run.menu.operation
// }
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.doClose();
// }
// })
},
//
stop() {
this.$alert('未开发', '提示', {
confirmButtonText: '确定',
callback: action => { }
});
// let operate = {
// start: true,
// send: true,
// code: this.selected.code,
// type: MapDeviceType.Train.type,
// label: MapDeviceType.Train.label,
// operation: OperationEvent.Train.stop.menu.operation
// }
// this.$store.dispatch('training/next', operate).then(({ valid }) => {
// if (valid) {
// this.doClose();
// }
// })
}
}
}
</script>

View File

@ -1,302 +0,0 @@
import store from '@/store';
import deviceState from '@/jmap/constant/deviceState';
export function getCurrentStateObject() {
return store.getters['menuOperation/selected'];
}
export const MenuDisabledState = {
Section: {
// 封锁
lock() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Section.status.State06) {
return true;
}
},
// 解禁
unlock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Section.status.State06) {
return true;
}
},
// 区故解
fault() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Section.status.State05) {
return true;
}
},
// 区段跟踪激活
active() {
},
// 区段跟踪切除
splite() {
},
// 确认计轴有效
sureAxleEffective() {
// 未开发
},
// 设置临时限速
setTemporarySpeedLimit() {
// 未开发
},
// 查看设备状态
viewDeviceState() {
// 未开发
},
// 新建列车
newTrain() {
},
// 空闲
spare() {
// 未开发
},
// 故障锁闭
faultLock() {
// 未开发
},
// 设置故障
setStoppage() {
},
// 取消故障
cancelStoppage() {
},
// 强制开门
forceOpenDoor() {
},
// 强制关门
forceCloseDoor() {
}
},
Signal: {
// 排列进路
arrangementRoute() {
},
// 取消列车进路
cancelTrainRoute() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Signal.status.State01) {
return true;
}
},
// 人解列车进路
humanTrainRoute() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Signal.status.State01) {
return true;
}
},
// 封锁
lock() {
// 未开发
},
// 解锁
unlock() {
// 未开发
},
// 设置自动通过进路
setUpAutomaticRoute() {
// 未开发
},
// 信号重开
reopenSignal() {
},
// 引导
guide() {
// 未开发
},
// 进路交人工控
routeToIndustrialControl() {
// 未开发
},
// 进路交自动控
routeToAutomaticControl() {
// 未开发
},
// 查询进路控制状态
queryRouteAutomaticState() {
// 未开发
},
// 设置故障
setStoppage() {
},
// 取消故障
cancelStoppage() {
}
},
Station: {
},
StationControl: {
// 紧急站控
emergencyStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State03) {
return true;
}
},
// 请求站控
requestStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State02) {
return true;
}
},
// 强行站控
forcedStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State02) {
return true;
}
},
// 请求中控
requestCentralControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State01) {
return true;
}
},
// 设置故障
setStoppage() {
},
// 取消故障
cancelStoppage() {
}
},
StationStand: {
// 设置扣车
setDetainTrain() {
// 未开发
},
// 取消扣车
cancelDetainTrain() {
// 未开发
},
// 设置跳停
setJumpStop() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationStand.status.State03 || device && device.status == deviceState.StationStand.status.State04) {
return true;
}
},
// 取消跳停
cancelJumpStop() {
},
// 提前发车
earlyDeparture() {
},
// 站台详细信息
stationStandDetail() {
// 未开发
},
// 设置故障
setStoppage() {
},
// 取消故障
cancelStoppage() {
}
},
Switch: {
// 定操
normalIndication() {
const device = getCurrentStateObject();
if (device && device.locateType == deviceState.Switch.locateType.State01) {
return true;
}
},
// 反操
reverseIndication() {
const device = getCurrentStateObject();
if (device && device.locateType == deviceState.Switch.locateType.State02) {
return true;
}
},
// 单锁
lock() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Switch.status.State10) {
return true;
}
},
// 解锁
unlock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Switch.status.State10) {
return true;
}
},
// 封锁
block() {
// 未开发
},
// 区故解
fault() {
// 未开发
},
// 区段跟踪激活
active() {
// 未开发
},
// 区段跟踪切除
splite() {
// 未开发
},
// 查看设备状态
viewDeviceState() {
// 未开发
},
// 设置故障
setStoppage() {
},
// 取消故障
cancelStoppage() {
}
},
Train: {
// 删除列车
remove() {
// 未开发
},
// 运行
run() {
const device = getCurrentStateObject();
if (device && device.runState == deviceState.Train.runState.State02) {
return true;
}
},
// 停止
stop() {
const device = getCurrentStateObject();
if (device && device.runState == deviceState.Train.runState.State01) {
return true;
}
},
// 设置故障
setStoppage() {
},
// 取消故障
cancelStoppage() {
}
}
};
/**
* 将menu的disabled属性使用disabledCallback计算并返回
* @param {Array} menu
*/
export function menuConvert(menu) {
if (menu.constructor === Array) {
menu.forEach(elem => {
if (elem.disabledCallback.constructor === Function) {
elem.disabled = elem.disabledCallback();
}
});
}
return menu;
}

View File

@ -1,203 +0,0 @@
<template>
<div v-if="show">
<template v-if="maxmini">
<div class="nav">
<div class="cls-status" @click="touch('Close')" v-show="config.showClose"><span></span></div>
<div class="min-status" @click="touch('Minim')"><span></span></div>
</div>
<el-table ref="table" :data="config.data" :highlight-current-row="config.highlightCurrentRow"
@current-change="handleChange" :height="height" border>
<template v-for="item in config.columns">
<el-table-column :prop="item.prop" :label="item.label" :width="item.width">
</el-table-column>
</template>
</el-table>
</template>
<template v-else>
<div class="nav">
<div class=" max-status" @click="touch('Maxim')"><span></span></div>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'DataTable',
props: {
height: {
type: Number,
required: true
},
config: {
type: Object,
required: true,
}
},
data() {
return {
show: true,
maxmini: true,
touchStrategy: {
'Close': [false, true],
'Minim': [true, false],
'Maxim': [true, true]
}
}
},
methods: {
handleChange(row) {
if (this.config.handleChange) {
this.config.handleChange(row);
}
},
setCurrentRow(row) {
this.$refs.table.setCurrentRow(row);
},
touch(operate) {
this.$nextTick(() => {
[this.show, this.maxmini] = this.touchStrategy[operate];
this.$emit('touch', this.maxmini);
})
}
}
}
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
$height: 20px;
$width: 20px;
.nav {
display: table;
float: right;
width: 100%;
color: #0000;
background: -webkit-linear-gradient(#FDFDFE, #B1CBF3);
background: -o-linear-gradient(#FDFDFE, #B1CBF3);
background: -moz-linear-gradient(#FDFDFE, #B1CBF3);
background: linear-gradient(#FDFDFE, #B1CBF3);
border: 1px solid #B6BCCC !important;
border-bottom: 2px solid #B6BCCC !important;
list-style: none;
height: $height;
line-height: $height;
}
/deep/ {
.el-table--border th.gutter {
background: #EBEADB !important;
}
.el-table {
overflow-y: hidden;
width: 100%;
th.is-leaf {
padding: 0px 0;
background: #EBEADB;
border-right: none !important;
border-left: 1px solid #D1CDBD !important;
border-top: 1px solid #D1CDBD !important;
border-bottom: 1px inset #D1CDBD !important;
color: #000;
.cell {
height: $height;
line-height: $height;
}
}
td {
padding: 0px 0;
.cell {
height: $height;
line-height: $height;
font-size: smaller !important;
}
}
.current-row>td {
background: #316AC5 !important;
color: #fff !important;
}
}
.cls-status {
float: right;
width: 12px;
height: 100%;
line-height: 100%;
margin-left: 5px;
cursor: pointer;
span {
display: inline-block;
content: '/';
background: black;
width: 2px;
height: 12px;
vertical-align: middle;
-webkit-transform: rotate(45deg);
}
span::after {
display: block;
content: '/';
background: black;
width: 2px;
height: 12px;
-webkit-transform: rotate(-90deg);
}
}
.min-status {
float: right;
width: 20px;
height: 100%;
line-height: 100%;
cursor: pointer;
span {
display: inline-block;
content: '-';
background: black;
width: 2px;
height: 12px;
vertical-align: middle;
-webkit-transform: rotate(-90deg);
}
}
.max-status {
float: right;
width: 20px;
height: 100%;
line-height: 100%;
cursor: pointer;
span {
display: inline-block;
content: '';
background: black;
width: 2px;
height: 12px;
-webkit-transform: rotate(0deg);
}
span::after {
display: block;
content: '';
background: black;
width: 2px;
height: 12px;
-webkit-transform: rotate(90deg);
}
}
}
</style>

View File

@ -1,22 +0,0 @@
export const modelPublicInitialValue = {
};
/**
* 在创建Model数据时根据皮肤类型修改默认值
* @param {Object} model
*/
export function InitPublicProperties(model) {
if (model) {
let modelInitial = modelPublicInitialValue[model._type];
if (modelInitial) {
for (let prop in modelInitial) {
if (prop && modelInitial[prop]) {
model[prop] = modelInitial[prop];
}
}
}
}
return model;
}

View File

@ -1,391 +0,0 @@
<template>
<div class="plan-schedule" style="width: 100%">
<title-bar ref="titleBar" @back="back"></title-bar>
<menu-bar ref="menuBar" :skinStyle="skinStyle" @dispatchDialog="dispatchDialog"></menu-bar>
<!-- <menu-tool ref="menuTool" :skinStyle="skinStyle"></menu-tool> -->
<schedule ref="schedule" :group="group" :skinStyle="skinStyle" :maxHeight="height" :maxWidth="width"></schedule>
<status-bar ref="statusBar" :maxTop="height" @setPosition="setPosition"></status-bar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import TitleBar from './titleBar';
import MenuBar from './menuBar';
import MenuTool from './menuTool';
import StatusBar from './statusBar';
import Schedule from './schedule';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default {
name: 'Menus',
mixins: [
WindowResizeHandler
],
props: {
group: {
type: String,
required: true
}
},
components: {
TitleBar,
MenuBar,
MenuTool,
StatusBar,
Schedule
},
data() {
return {
width: 0,
height: 0
}
},
computed: {
skinStyle() {
return this.$route.query.skinStyle || '02';
}
},
methods: {
resizeHandler() {
this.width = this._clientWidth;
this.height = this._clientHeight;
},
setPosition() {
this.$nextTick(() => {
this.$refs.schedule.setPosition();
})
},
dispatchDialog(dialogObj) {
this.$nextTick(() => {
if (this.$refs[dialogObj.name]) {
this.$refs[dialogObj.name].doShow(dialogObj.params);
}
})
},
reloadTable(dialogObj) {
if (this.$refs[dialogObj.name]) {
this.$refs[dialogObj.name].reloadTable();
}
},
confirm(params) {
},
back() {
this.$emit('back');
}
}
}
</script>
<style>
.plan-schedule {
position: absolute;
background: gray;
}
.plan-schedule .pop-menu {
background: #F0F0F0;
}
.plan-schedule .pop-menu span {
color: #000;
}
.plan-schedule .system-close {
cursor: pointer;
position: absolute;
right: 0px;
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid white;
border-radius: 4px;
}
.plan-schedule .system-close::before {
position: absolute;
height: 22px;
line-height: 22px;
top: 0px;
left: 0px;
font-size: x-large;
}
.plan-schedule .pop-menu .is-disabled span {
color: #B4B3B8;
}
.default__schedule {
overflow: hidden !important;
}
.default__schedule .el-dialog {
background: rgba(0, 85, 231, 1);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
border: 2px solid #727375;
border-radius: 4px;
color: #000;
font-size: 14px;
}
.default__schedule .el-dialog .el-dialog__header {
height: 30px;
padding: 5px;
}
.default__schedule .el-dialog .el-dialog__footer {
background: #ECE9D8;
opacity: 1;
}
.default__schedule .el-dialog .el-dialog__body {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 5px;
padding-right: 5px;
margin: 0px 3px 3px 3px;
border: 2px solid rgba(120, 121, 123, 0.5);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
color: #000;
background: #ECE9D8;
opacity: 1;
}
.default__schedule .el-dialog .el-dialog__title {
font-size: 16px;
}
.default__schedule .el-dialog .el-dialog__headerbtn {
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid white;
border-radius: 4px;
top: 0px;
right: 3px;
line-height: 26px;
width: 26px;
}
.default__schedule .el-dialog .el-dialog__headerbtn .el-icon-close:before {
font-size: 16px;
}
.default__schedule .el-dialog .el-dialog__headerbtn .el-dialog__close {
color: #fff;
}
.default__schedule .el-dialog .el-form {
background: #ECE9D8 !important;
}
.default__schedule .el-dialog .el-card {
background: #ECE9D8 !important;
}
.default__schedule .el-dialog .el-button {
height: 32px;
line-height: 32px;
padding: 0px;
width: 80px;
border: 2px outset #E2E2E2;
border-radius: 0px !important;
color: #000;
background: #ECE9D8;
}
.default__schedule .el-dialog .expand {
width: 120px;
}
.default__schedule .el-dialog .el-button:focus span {
border: 1px dashed gray;
}
.default__schedule .el-dialog .el-button:active {
border: 2px inset #E2E2E2;
}
.default__schedule .el-dialog .el-button:disabled {
border: 2px inset #E2E2E2;
}
.default__schedule .el-dialog .el-button:disabled span {
border: 0px;
}
.default__schedule .el-dialog .button-group {
margin: 0px 5px;
text-align: center !important;
}
.default__schedule .el-dialog .el-input {
border: 2px inset #E9E9E9;
}
.default__schedule .el-dialog .el-input .el-input__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.default__schedule .el-dialog .el-input.is-disabled .el-input__inner {
background: #F0F0F0 !important;
}
.default__schedule .el-dialog .el-textarea {
border: 2px inset #E9E9E9;
border-radius: 0px;
}
.default__schedule .el-dialog .el-textarea .el-textarea__inner {
color: #000;
background: #fff !important;
border: 0px;
border-radius: 0px !important;
box-sizing: border-box;
}
.default__schedule .el-dialog .el-textarea.is-disabled .el-textarea__inner {
background: #F0F0F0 !important;
}
.default__schedule .el-dialog .el-table {
border: 2px inset #E9E9E9;
color: #000 !important;
}
.default__schedule .el-dialog .el-table .cell {
line-height: unset !important;
}
.default__schedule .el-dialog .el-table th.is-leaf {
background: #ECE9D8 !important;
border-right: 1px solid #BDBDBD !important;
border-bottom: 1px solid #BDBDBD !important;
color: #000 !important;
height: 20px !important;
padding: 0px;
}
.default__schedule .el-dialog .el-table tr td {
height: 20px !important;
padding: 0px;
}
.default__schedule .el-dialog .el-table .el-table__empty-text {
top: 15px !important;
}
.default__schedule .el-dialog .current-row>td {
background: #316AC5 !important;
color: #fff !important;
}
.default__schedule .el-dialog .el-checkbox__inner {
border: 1px inset #dcdfe6 !important;
}
.default__schedule .el-dialog .el-checkbox__label {
color: #000 !important;
}
.default__schedule .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
background: #E6E6E6 !important;
}
.default__schedule .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
color: #C5C9CC !important;
}
.default__schedule .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.default__schedule .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
position: absolute;
-webkit-box-sizing: content-box;
box-sizing: content-box;
content: "";
border: 1px solid #000;
border-left: 0;
border-top: 0;
height: 7px;
left: 4px;
top: 1px;
}
.default__schedule .el-dialog .el-radio__inner {
border: 1px inset #dcdfe6 !important;
}
.default__schedule .el-dialog .el-radio__label {
color: #000 !important;
}
.default__schedule .el-dialog .el-radio__input.is-checked .el-radio__inner {
background: #fff !important;
border: 1px inset #dcdfe6 !important;
}
.default__schedule .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
width: 4px;
height: 4px;
border-radius: 100%;
background-color: #000 !important;
position: absolute;
left: 50%;
top: 50%;
}
.default__schedule .el-dialog .el-radio.is-disabled .el-radio__inner {
background: #E6E6E6 !important;
}
.default__schedule .el-dialog .el-radio.is-disabled .el-radio__label {
color: #C5C9CC !important;
}
.default__schedule .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -15px;
top: -18px;
}
.default__schedule .el-dialog .el-form-item label {
font-weight: normal !important;
color: #000 !important;
}
.default__schedule .el-dialog .context {
height: 100px;
border: 2px inset #E2E2E2;
overflow-y: scroll;
}
.default__schedule .el-dialog .table {
margin-top: 10px;
}
.default__schedule .el-dialog .notice {
margin-left: 62px;
line-height: 30px;
}
.default__schedule .el-dialog .button-group {
margin-top: 10px;
}
.default__schedule .el-dialog .el-tree__empty-block {
background: #E9E9E9 !important;
color: #000 !important;
}
</style>

View File

@ -1,472 +0,0 @@
<template>
<div id="PlanMenuBar">
<div class="nav">
<template v-for="(item,i) in menu">
<template v-if="noShowingChildren(item.children)">
<li class="nav-li" @click="hookClick(item)">
<span class="nav-li-text">{{item.title}}</span>
</li>
</template>
<template v-else>
<li class="nav-li" @click.stop="popupMenuA(item, i)">
<span class="nav-li-text">{{item.title}}</span>
<ul class="nav-ul" :class="{'active' :i==classA}">
<template v-for="(child,j) in item.children">
<template
v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<li class="menu-separator" v-if="child.type === 'separator'">
<span class="status">&ensp;</span>
<span class="separator">&ensp;</span>
</li>
<li class="menu-li" v-else-if="child.type === 'file'">
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<el-button type="text" class="button" :disabled="child.disabled">
<input :ref="child.label" type="file" @change="openLoadFile(child)"
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
{{child.title}}
</el-button>
</span>
</div>
</li>
<li class="menu-li" v-else @click.stop="popupMenuB(child, j)">
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<span class="label">{{child.title}}</span>
</span>
</div>
<ul class="menu-ul" :class="{'active' :j==classB}">
<template v-for="(grandchild,k) in child.children">
<li class="menu-separator" v-if="grandchild.type === 'separator'">
<span class="status">&ensp;</span>
<span class="separator">&ensp;</span>
</li>
<li class="menu-li" v-else-if="grandchild.type === 'file'">
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<el-button type="text" class="button"
:disabled="grandchild.disabled">
<input :ref="grandchild.label" type="file"
@change="openLoadFile(grandchild)"
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
{{grandchild.title}}
</el-button>
</span>
</div>
</li>
<li class="menu-li" v-else @click.stop="hookClick(grandchild)">
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<span class="label">{{grandchild.title}}</span>
</span>
</div>
</li>
</template>
</ul>
</li>
</template>
<template v-else>
<li class="menu-separator" v-if="child.type === 'separator'">
<span class="status">&ensp;</span>
<span class="separator">&ensp;</span>
</li>
<li class="menu-li" v-else-if="child.type === 'file'">
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<el-button type="text" class="button" :disabled="child.disabled">
<input :ref="child.title" type="file" @change="openLoadFile(child)"
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
{{child.title}}
</el-button>
</span>
</div>
</li>
<li class="menu-li" v-else @click.stop="hookClick(child)">
<div class="menu-li-block">
<span class="menu-li-text">
<span class="status">&ensp;</span>
<span class="label">{{child.title}}</span>
</span>
</div>
</li>
</template>
</template>
</ul>
</li>
</template>
</template>
</div>
</div>
</template>
<script>
import XLSX from 'xlsx';
import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { importData } from '../convert';
import { launchFullscreen } from '@/utils/screen';
export default {
name: 'PlanMenuBar',
props: {
skinStyle: {
type: String,
required: true
}
},
data() {
return {
classA: -1,
classB: -1,
tempClassA: -1,
tempClassB: -1,
menu: [
{
title: '文件F',
children: [
],
},
{
title: '显示V',
children: [
],
},
{
title: '编辑E',
children: [
],
},
{
title: '工具T',
children: [
{
title: '查看计划列表',
click: this.handleViewPlanSchedule
},
{
title: '创建一周计划',
click: this.handleCreateWeekPlan
},
{
title: '加载当天计划',
click: this.handleReloadTodayPlan
},
],
},
{
title: '帮助H',
children: [
],
},
]
}
},
computed: {
...mapGetters('training', [
'mode',
]),
...mapGetters('map', [
'stationList'
]),
},
watch: {
tempClassA() {
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
},
tempClassB() {
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
},
'$store.state.menuOperation.break': function (val) {
if (val) {
this.classA = this.classB = -1;
} else {
this.classA = this.tempClassA;
this.classB = this.tempClassB;
}
}
},
mounted() {
this.initMenu();
},
methods: {
initMenu() {
this.clickEvent();
this.closeMenu();
},
clickEvent() {
let self = this;
window.onclick = function (e) {
self.closeMenu(false);
}
},
noShowingChildren(children) {
if (!children || children.length <= 0) {
return true;
}
return false;
},
hasShowingChildren(children) {
if (children && children.length > 0) {
return true
}
return false
},
closeMenu() {
this.classA = this.tempClassA = -1;
this.classB = this.tempClassB = -1;
},
hookClick(item, event) {
this.closeMenu();
// launchFullscreen();
setTimeout(() => {
if (item && typeof item.click == 'function') {
item.click();
}
}, 500);
},
popupMenuA(item, index) {
this.clickEvent();
this.tempClassA = index;
this.tempClassB = -1;
},
popupMenuB(item, index) {
this.tempClassB = index;
},
openLoadFile(item) {
let obj = this.$refs[item.title][0];
if (obj.files) {
let file = obj.files[0];
item.click(file);
obj.value = '';
}
},
doClose() {
this.$nextTick(() => {
eventBus.$emit('closeMenu');
})
},
//
refresh() {
this.closeMenu(true);
eventBus.$emit('refresh');
},
undeveloped() {
this.doClose();
this.$alert('实现中......', '提示', {
confirmButtonText: '确定',
callback: action => {
}
});
},
//
handleEditPlanningTrain() {
this.$emit('dispatchDialog', { name: 'modifyingPlan' })
},
//
handleAddTask() {
let params = this.$store.state.runPlan.selected;
this.$emit('dispatchDialog', { name: 'addTask', params });
},
//
handleDeleteTask() {
let params = this.$store.state.runPlan.selected;
this.$emit('dispatchDialog', { name: 'deleteTask', params });
},
//
handleModifyingTask() {
let params = this.$store.state.runPlan.selected;
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
},
//
handleModifyingPlanId() {
this.$emit('dispatchDialog', { name: 'modifyingPlanId' });
},
//
handleTranslationalMulTrain() {
this.$emit('dispatchDialog', { name: 'translationalMulTrain' });
},
//
handleViewPlanSchedule() {
this.$emit('dispatchDialog', { name: 'managePlanList' });
},
//
handleCreateWeekPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
},
//
handleReloadTodayPlan() {
this.$emit('dispatchDialog', { name: 'createTodayPlan' });
},
//
handleValidityCheck() {
}
}
}
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
$top: 25px;
$width: 30px;
$height: 20px;
$menuPadding: 10px;
$menuItemHeight: 30px;
$menuItemWidth: 160px;
$menuItemPadding: 5px;
#PlanMenuBar {
z-index: 10;
position: absolute;
top: $top;
width: 100%;
height: $height;
line-height: $height;
}
.nav {
display: block;
cursor: pointer;
color: #0000;
background: #EBEADB;
list-style: none;
border: 1px solid #B6BCCC !important;
}
.nav-li {
position: relative;
display: inline-block;
padding-left: $menuPadding;
padding-right: $menuPadding;
}
.nav-li:active {
background: #C9D0E1;
border-radius: 4px;
}
.nav-li-text {
font-size: 13px;
color: #000;
text-align: center;
text-decoration: none;
}
.nav-ul {
display: none;
position: absolute;
list-style: none;
border: 1px solid gray;
width: $menuItemWidth;
padding: 0px;
margin: 0px;
}
.menu-ul {
display: none;
list-style: none;
background: #F0F0F0;
line-height: $menuItemHeight;
width: $menuItemWidth;
bottom: $menuItemHeight;
}
.active {
position: absolute;
display: block !important;
}
.menu-ul-text {
font-size: 14px;
color: #000;
letter-spacing: 0;
height: $menuItemHeight;
line-height: $menuItemHeight;
border-left: 1px solid #000;
border-right: 1px solid #000;
}
.menu-separator {
text-align: left;
background: #F0F0F0;
height: 2px;
line-height: 2px;
}
.menu-separator .status {
display: inline-block;
border-right: 1px inset #CACACA;
width: $width;
height: 100%;
background: #EFECDE;
}
.menu-separator .separator {
display: inline-block;
background: #CACACA;
margin-left: 5px;
height: 2px;
width: $menuItemWidth - $width - 30px;
}
.menu-li {
text-align: left;
background: #F0F0F0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li-block {
letter-spacing: 0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li-text {
font-size: 14px;
color: #000;
}
.menu-li-text .status {
display: inline-block;
border-right: 1px inset #CACACA;
width: $width;
background: #EFECDE;
}
.menu-li-text .label {
display: inline-block;
margin-left: 5px;
}
.menu-li-text .button {
position: relative;
overflow: hidden;
margin-left: 10px;
line-height: 0px;
width: $menuItemWidth - $width;
top: -$menuItemHeight;
color: #000;
cursor: pointer;
input {
opacity: 0;
cursor: pointer;
position: absolute;
top: 0px;
width: $menuItemWidth - $width - 10px;
}
}
.menu-li-block:hover {
background: #C9DEF7;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
</style>

View File

@ -1,172 +0,0 @@
<template>
<div id="PlanMenuTool">
<div class="nav">
<div class="tool" v-for="(item,index) in tools" :key="index">
<img :src="item.src" :alt="item.title" />
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { prefixIntrger } from '@/utils/date';
import logo_ from '@/assets/logo_.png';
export default {
name: 'PlanMenuTool',
data() {
return {
tools: [
{
title: '服务器1',
operate: '',
src: logo_,
click: this.undeveloped,
},
{
title: '服务器2',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '前置机1',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '前置机2',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '主调',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '调度台1',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '调度台2',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '调度台3',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '大屏',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '维护工作站',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '运行图显示人工站',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '跳停',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '扣车',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '列车报警',
operate: '',
src: logo_,
click: this.undeveloped,
}
]
}
},
watch: {
'$store.state.training.initTime': function (initTime) {
let date = new Date(initTime);
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`
}
},
computed: {
isShowSystemTime() {
return this.$route.params.mode == 'demon' || this.$route.params.mode === 'dp' || !this.$route.params.mode;
}
},
mounted() {
this.initTools();
},
methods: {
initTools() {
this.tools = [];
}
}
}
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
$top: 48px;
$width: 25px;
$height: 25px;
#PlanMenuTool {
z-index: 5;
position: absolute;
width: 100%;
top: $top;
}
.nav {
display: block;
color: #0000;
background: #EBEADB;
border: 1px solid #B6BCCC !important;
border-bottom: 2px solid #B6BCCC !important;
list-style: none;
height: $height;
line-height: $height;
}
.tool {
padding-left: 10px;
display: flex;
justify-content: center;
cursor: pointer;
position: relative;
float: left;
margin: 1px;
width: $width;
img {
display: block;
text-align: center;
padding-top: 2px;
height: $height - 5;
width: $width - 5;
}
}
</style>

View File

@ -1,491 +0,0 @@
<template>
<div id="PlanSchedule" :style="{top: top+'px', height: height+'px'}">
<div class="left">
<div :id="runPlanId"></div>
</div>
<div class="right">
<data-table ref="serviceTable" :height="height/2" :config="serviceNumberConfig" @touch="scheduleTouch"
:style="{top: top-height/2+'px'}"></data-table>
<data-table ref="tripTable" :height="height/2" :config="tripNumberConfig" @touch="trainNumTouch"
:style="{top: top-height/2+'px'}"></data-table>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date';
import { runDiagramGetTime } from '@/api/simulation';
import { getStationListBySkinStyle } from '@/api/runplan';
import ThemeFactory from '@/jmap/theme/factory';
import DataTable from '../menusPlan/components/dataTable';
export default {
name: 'PlanSchedule',
props: {
group: {
type: String,
required: true
},
skinStyle: {
type: String,
required: true
},
maxWidth: {
type: Number,
require: true
},
maxHeight: {
type: Number,
required: true
}
},
components: {
DataTable
},
data() {
return {
top: 0,
height: 0,
heights: [100, 100],
runPlanId: 'plan-schedule-id',
myChart: null,
PlanConvert: {},
serviceNumberConfig: {
data: [],
highlightCurrentRow: true,
handleChange: this.serviceNumberChange,
showClose: false,
columns: [
{
prop: 'serviceNumber',
label: '表号',
},
{
width: 40
}
]
},
tripNumberConfig: {
data: [],
highlightCurrentRow: true,
handleChange: this.tripNumberChange,
showClose: false,
columns: [
{
prop: 'tripNumber',
label: '车次号',
},
{
width: 40
}
]
},
realData: {},
kmRangeCoordMap: {},
option: {
title: {
text: '',
left: 'center'
},
grid: {
top: '30px',
left: '120px',
right: '40px',
bottom: '65px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
right: '30px',
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
tooltip: {
axisPointer: {
trigger: 'item',
type: 'cross'
},
formatter: this.axisTooltip,
borderWidth: 1,
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
formatter: this.xAxisLableFormat,
textStyle: {
color: '#333'
}
},
axisPointer: {
snap: true,
label: {
formatter: this.xAxisPointFormat,
backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white',
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
show: false,
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat,
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white',
}
},
min: 0,
max: 0,
},
series: [],
dataZoom: [
{
type: 'inside',
},
{
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
bottom: '20px'
}
]
},
absoluteTime: 2 * 3600,
indexKmRangeMap: {}
}
},
watch: {
maxWidth() {
this.setPosition();
},
maxHeight() {
this.setPosition();
},
'$store.state.runPlan.planLoadedCount': async function () {
await this.loadChartPage();
},
'$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
},
'$store.state.runPlan.select.serviceNumber': function (val) {
let index = this.serviceNumberConfig.data.findIndex(elem => {
return elem.serviceNumber == val;
})
this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]);
},
'$store.state.runPlan.select.tripNumber': function (val) {
let index = this.tripNumberConfig.data.findIndex(elem => {
return elem.tripNumber == val;
})
this.$refs.tripTable.setCurrentRow(this.tripNumberConfig.data[index]);
}
},
computed: {
...mapGetters('runPlan', [
'stations'
])
},
mounted() {
this.PlanConvert = ThemeFactory.loadPlanConvert(this.skinStyle);
},
beforeDestroy() {
this.destroy();
},
methods: {
serviceNumberChange(row) {
if (row) {
this.$store.dispatch('runPlan/setSelected', { serviceNumber: row.serviceNumber, tripNumber: null });
let serviceObj = this.$store.state.runPlan.editData[row.serviceNumber]
if (serviceObj) {
this.analyticalTripNumber(serviceObj.trainMap);
}
}
},
tripNumberChange(row) {
if (row) {
this.$store.dispatch('runPlan/setSelected', { serviceNumber: this.$store.state.runPlan.selected.serviceNumber, tripNumber: row.tripNumber });
}
},
async analyticalServiceNumber(data) {
this.serviceNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex })
.map(serviceNumber => { return { serviceNumber } });
},
async analyticalTripNumber(data) {
this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex })
.map(tripNumber => { return { tripNumber } });
},
async setPosition() {
this.$nextTick(() => {
let top = 3;
let width = this.maxWidth * 0.85;
let height = this.maxHeight;
let titleBar = document.getElementById('PlanTitleBar');
let menuBar = document.getElementById('PlanMenuBar');
let menuTool = document.getElementById('PlanMenuTool');
let statusBar = document.getElementById('PlanStatusBar');
if (titleBar) {
top += (titleBar.offsetHeight || 0);
}
if (menuBar) {
top += (menuBar.offsetHeight || 0);
}
if (menuTool) {
top += (menuTool.offsetHeight || 0);
}
if (statusBar) {
height -= (statusBar.offsetHeight || 0);
}
height = height - top;
this.$store.dispatch('runPlan/resize', { width, height });
if (this.top != top) {
this.top = top;
}
if (this.height != height) {
this.height = height - 20 * 2;
}
})
},
async loadChartPage() {
try {
let series = [];
let stations = this.$store.state.runPlan.stations;
let planData = this.$store.state.runPlan.planData;
this.viewDisabled = true;
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
series = this.pushModels(series, [this.PlanConvert.initializeYaxis(stations)]);
series = this.pushModels(series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5 }));
await this.loadInitData(series);
await this.analyticalServiceNumber(this.$store.state.runPlan.editData);
this.viewDisabled = false;
} catch (error) {
this.viewDisabled = false;
this.$messageBox(`加载运行图数据失败`);
}
},
async loadInitData(series) {
this.myChart && this.myChart.showLoading();
await this.xAxisInit();
await this.yAxisInit();
await this.loadInitChart(series);
this.myChart && this.myChart.hideLoading();
},
pushModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
if (elem) {
series.push(elem);
}
})
}
return series;
},
popModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
let index = series.indexOf(elem);
if (index >= 0) {
series.split(index, 1);
}
})
}
return series;
},
loadInitChart(series) {
return new Promise((resolve, reject) => {
try {
let that = this;
//echart
require.config(
{
paths: {
echarts: './js/dist'
}
}
);
//
require(
[
'echarts',
'echarts/lib/chart/line',
],
function (ec) {
that.destroy();
let startValue = 3600 + that.PlanConvert.TranslationTime;
let offsetTime = 3600;
runDiagramGetTime(that.group).then(resp => {
startValue = resp.data - that.PlanConvert.TranslationTime;
that.option.dataZoom[0].startValue = that.option.dataZoom[1].startValue = startValue - offsetTime;
that.option.dataZoom[0].endValue = that.option.dataZoom[1].endValue = startValue + offsetTime;
that.option.series = series;
that.myChart = ec.init(document.getElementById(that.runPlanId));
if (that.myChart) {
that.myChart.setOption(that.option);
that.reSize({ width: that.$store.state.runPlan.width, height: that.$store.state.runPlan.height });
that.myChart.on('click', that.mouseClick);
}
resolve(true);
})
}
);
} catch (error) {
reject(error);
}
});
},
xAxisPointFormat(params) {
return timeFormat(params.value);
},
yAxisPointFormat(params) {
return this.PlanConvert.computedFormatYAxis(this.stations, params);
},
xAxisLableFormat(value, index) {
if (value % 60 === 0) {
return timeFormat(value);
}
},
yAxisLableFormat(value, index) {
return '';
},
xAxisInit() {
let list = [];
for (var time = 0 + this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
list.push(time);
}
let startValue = 3600 * 6;
let offsetTime = 3600 * 1;
this.option.xAxis[0].data = list;
if (!this.option.dataZoom[0].startValue) {
this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = startValue - offsetTime;
}
if (!this.option.dataZoom[0].endValue) {
this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = startValue + offsetTime;
}
},
yAxisInit() {
if (Object.keys(this.PlanConvert).length) {
this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations);
this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations);
}
},
axisTooltip(param) {
let station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' };
return [
`Point Data <hr size=1 style=" margin: 3px 0">`,
`车站名称: ${station.name}<br>`,
`车站公里标: ${station.kmRange} km <br>`,
`到站时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join('');
},
mouseClick(params) {
let model = {
serviceNumber: params.seriesName
}
this.$store.dispatch('runPlan/setSelected', model);
},
reSize(opt) {
if (this.myChart) {
this.myChart.resize({
width: opt.width,
height: opt.height,
silent: false
});
}
},
destroy() {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose();
this.myChart = null;
}
},
scheduleTouch() {
},
trainNumTouch() {
}
}
}
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
#PlanSchedule {
z-index: 5;
position: absolute;
width: 100%;
.left {
height: 100%;
width: 85%;
float: left;
}
.right {
height: 100%;
width: 15%;
float: right;
}
}
</style>

View File

@ -1,100 +0,0 @@
<template>
<data-table id="PlanStatusBar" ref="dataTable" :height="height-11" :config="stationListConfig" :close="false"
:style="{top: maxmini? maxTop-110+'px':maxTop-21+'px'}" @touch="touch"></data-table>
</template>
<script>
import DataTable from '../menusPlan/components/dataTable';
import { formatTime, formatName } from '@/utils/runPlan';
export default {
name: 'PlanStatusBar',
props: {
maxTop: {
type: Number,
required: true
}
},
components: {
DataTable
},
data() {
return {
maxmini: true,
height: 100,
stationListConfig: {
data: [],
showClose: true,
highlightCurrentRow: true,
columns: [
{
prop: 'stationName',
label: '站台',
width: 400
},
{
prop: 'startTime',
label: '到点',
},
{
prop: 'stopTime',
label: '停站时间',
},
{
prop: 'endTime',
label: '发点',
},
{
prop: 'level',
label: '运行等级'
}
]
}
}
},
watch: {
'$store.state.runPlan.select': function (select) {
this.stationListConfig.data = [];
let serviceObj = this.$store.state.runPlan.editData[select.serviceNumber];
if (serviceObj) {
let trainMap = serviceObj.trainMap;
if (trainMap) {
let trainObj = trainMap[select.tripNumber];
if (trainObj) {
let stationTimeList = trainObj.stationTimeList;
if (stationTimeList && stationTimeList.length) {
stationTimeList.forEach((elem, index) => {
let stationObj = {
stationName: formatName(elem.stationCode),
startTime: formatTime(index == 0 ? null : stationTimeList[index - 1].secondTime),
stopTime: formatTime(index == 0 ? null : elem.secondTime - stationTimeList[index - 1].secondTime),
endTime: formatTime(elem.secondTime),
level: ''
}
this.stationListConfig.data.push(stationObj);
});
}
}
}
}
}
},
methods: {
touch(maxmini) {
this.maxmini = maxmini;
this.$emit('setPosition');
}
}
}
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
#PlanStatusBar {
z-index: 5;
position: absolute;
width: 100%;
}
</style>

View File

@ -1,75 +0,0 @@
<template>
<div id="PlanTitleBar">
<img class="logo" :src="logoImg" />
<span> {{mapName}} &ensp;</span>
<span v-if="runPlanName">({{runPlanName}})</span>
<span class="system-close el-icon-close" @click="back"></span>
</div>
</template>
<script>
import logo_ from '@/assets/logo_.png';
import { getPublishMapInfo } from '@/api/jmap/map';
export default {
name: 'PlanTitleBar',
data() {
return {
mapName: '',
logoImg: logo_
}
},
computed: {
runPlanName() {
return this.$route.query.planName || '';
}
},
mounted() {
if (this.$route.query.mapId) {
getPublishMapInfo(this.$route.query.mapId).then(resp => {
this.mapName = resp.data.name;
})
}
},
methods: {
back() {
this.$emit('back');
}
}
}
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
$width: 25px;
$height: 25px;
#PlanTitleBar {
z-index: 10;
display: flex;
position: absolute;
width: 100%;
height: $height;
line-height: $height;
background: -webkit-linear-gradient(#0055E8, #0099F8);
background: -o-linear-gradient(#0055E8, #0099F8);
background: -moz-linear-gradient(#0055E8, #0099F8);
background: linear-gradient(#0055E8, #0099F8);
color: white;
font: bold;
font-size: 16px;
.logo {
display: inline-block;
width: $width;
height: $height;
padding-right: 5px;
}
.system-close {
width: 25px;
height: 25px;
position: absolute;
right: 1px;
}
}
</style>

View File

@ -1,8 +1,6 @@
class ThemeFactory {
constructor() {
this._default = '02';
class Theme {
constructor(code) {
this._mapMenu = {
// '01': 'default',
'02': 'fuzhou_01',
'03': 'beijing_01',
'04': 'chengdou_03',
@ -11,32 +9,33 @@ class ThemeFactory {
}
// 加载菜单组件
loadMenusComponent(code) {
return Object.assign({}, require(`./${this._mapMenu[code || this._default]}/menus/index`).default);
loadMenuComponent(code) {
return Object.assign({}, require(`./${this._mapMenu[code]}/menus/index`).default);
}
// 加载运行图计划表组件
loadPlanScheduleComponent(code) {
return Object.assign({}, require(`./${this._mapMenu[code || this._default]}/planSchedule/index`).default);
loadPlanComponent(code) {
return Object.assign({}, require(`./${this._mapMenu[code]}/planSchedule/index`).default);
}
// 加载运行图解析和转化函数
loadPlanConvert(code) {
return require(`./${this._mapMenu[code || this._default]}/convert`).default;
return require(`./${this._mapMenu[code]}/planConvert`).default;
}
// model字段转换器
modelConvert(code) {
const convert = require(`./${this._mapMenu[code || this._default]}/model`) || {};
if (!convert.hasOwnProperty('InitPublicProperties')) {
convert.InitPublicProperties = (model) => { return model; };
// 共有字段转换
loadPropConvert(code) {
var convert = require(`./${this._mapMenu[code]}/model`) || {};
if (!convert.hasOwnProperty('initPublicProps')) {
convert.initPublicProps = (model) => { return model; };
}
if (!convert.hasOwnProperty('InitPrivateProperties')) {
convert.InitPrivateProperties = (model) => { return model; };
if (!convert.hasOwnProperty('initPrivateProps')) {
convert.initPrivateProps = (model) => { return model; };
}
return convert;
}
}
export default new ThemeFactory();
export default Theme;

View File

@ -29,7 +29,8 @@
</template>
<script>
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import deviceType from '@/jmap/constant/deviceType';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
export default {
@ -114,46 +115,49 @@
})
},
setDeviceDisplay() {
// let show = false;
// let deviceList = [];
let show = false;
let deviceList = [];
// //
// let sectionList = this.$store.getters['map/sectionList'];
// if (sectionList && sectionList.length > 0) {
// sectionList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
// elem.borderBorderShow = show;
// deviceList.push(elem);
// });
// }
//
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
elem._type = deviceType.Section;
//
show = this.deviceLevels.indexOf(2) !== -1 ? true : false;
elem.borderBorderShow = show;
deviceList.push(elem);
});
}
// //
// let trainWindowList = this.$store.getters['map/trainWindowList'];
// if (trainWindowList && trainWindowList.length > 0) {
// trainWindowList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
// elem.trainWindowShow = show;
// deviceList.push(elem);
// });
// }
//
let trainWindowList = this.$store.getters['map/trainWindowList'];
if (trainWindowList && trainWindowList.length > 0) {
trainWindowList.forEach(elem => {
elem._type = deviceType.TrainWindow;
//
show = this.deviceLevels.indexOf(1) !== -1 ? true : false;
elem.trainWindowShow = show;
deviceList.push(elem);
});
}
// //ATS
// let signalList = this.$store.getters['map/signalList'];
// if (signalList && signalList.length > 0) {
// signalList.forEach(elem => {
// //
// show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
// elem.linkageAutoRouteShow = show;
// //ATS
// show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
// elem.atsAutoTriggerShow = show;
// deviceList.push(elem);
// })
// }
//ATS
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
elem._type = deviceType.Signal;
//
show = this.deviceLevels.indexOf(3) !== -1 ? true : false;
elem.linkageAutoRouteShow = show;
//ATS
show = this.deviceLevels.indexOf(4) !== -1 ? true : false;
elem.atsAutoTriggerShow = show;
deviceList.push(elem);
})
}
// this.$store.dispatch('map/updateMapDevices', deviceList);
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}

View File

@ -64,7 +64,8 @@
</template>
<script>
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import deviceType from '@/jmap/constant/deviceType';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
export default {
@ -147,118 +148,111 @@
})
},
setNameDisplay() {
// let show = false;
// let deviceList = [];
let show = false;
let deviceList = [];
// //
// show = this.nameLevels.indexOf(1) !== -1 ? true : false;
// let signalList = this.$store.getters['map/signalList'];
// if (signalList && signalList.length > 0) {
// signalList.forEach(elem => {
// elem.nameShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(1) !== -1 ? true : false;
let signalList = this.$store.getters['map/signalList'];
if (signalList && signalList.length > 0) {
signalList.forEach(elem => {
elem._type = deviceType.Signal;
elem.nameShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(3) !== -1 ? true : false;
//
show = this.nameLevels.indexOf(3) !== -1 ? true : false;
// //
// let switchList = this.$store.getters['map/switchList'];
// if (switchList && switchList.length > 0) {
// switchList.forEach(elem => {
// //
// show = this.nameLevels.indexOf(7) !== -1 ? true : false;
// elem.nameShow = show;
// //
// show = this.nameLevels.indexOf(9) !== -1 ? true : false;
// elem.switchSectionNameShow = show;
// deviceList.push(elem);
// })
// }
//
let switchList = this.$store.getters['map/switchList'];
if (switchList && switchList.length > 0) {
switchList.forEach(elem => {
elem._type = deviceType.Switch;
//
show = this.nameLevels.indexOf(7) !== -1 ? true : false;
elem.nameShow = show;
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.switchSectionNameShow = show;
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(8) !== -1 ? true : false;
// let control = this.$store.getters['map/stationControlList'];
// if (control && control.length > 0) {
// control.forEach(elem => {
// //
// elem.indicatorShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(8) !== -1 ? true : false;
let control = this.$store.getters['map/stationControlList'];
if (control && control.length > 0) {
control.forEach(elem => {
elem._type = deviceType.StationControl;
//
elem.indicatorShow = show;
deviceList.push(elem);
})
}
// //
// let sectionList = this.$store.getters['map/sectionList'];
// if (sectionList && sectionList.length > 0) {
// sectionList.forEach(elem => {
// if (elem.isSwitchSection && elem.parentCode) {
// //
// elem.nameShow = false;
// } else {
// if (elem.type === '01') {
// //
// show = this.nameLevels.indexOf(11) !== -1 ? true : false;
// elem.nameShow = show;
// } else if (elem.type === '02') {
// //
// show = this.nameLevels.indexOf(5) !== -1 ? true : false;
// elem.nameShow = show;
// } else if (elem.type === '03') {
// //
// show = this.nameLevels.indexOf(9) !== -1 ? true : false;
// elem.nameShow = show;
// }
// }
//
let sectionList = this.$store.getters['map/sectionList'];
if (sectionList && sectionList.length > 0) {
sectionList.forEach(elem => {
elem._type = deviceType.Section;
if (elem.isSwitchSection && elem.parentCode) {
//
elem.nameShow = false;
} else {
if (elem.type === '01') {
//
show = this.nameLevels.indexOf(11) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '02') {
//
show = this.nameLevels.indexOf(5) !== -1 ? true : false;
elem.nameShow = show;
} else if (elem.type === '03') {
//
show = this.nameLevels.indexOf(9) !== -1 ? true : false;
elem.nameShow = show;
}
}
// //
// if (elem.isStandTrack) {
// show = this.nameLevels.indexOf(2) !== -1 ? true : false;
// elem.standTrackNameShow = show;
// }
//
if (elem.isStandTrack) {
show = this.nameLevels.indexOf(2) !== -1 ? true : false;
elem.standTrackNameShow = show;
}
// //
// if (elem.isReentryTrack) {
// show = this.nameLevels.indexOf(4) !== -1 ? true : false;
// elem.reentryTrackNameShow = show;
// }
//
if (elem.isReentryTrack) {
show = this.nameLevels.indexOf(4) !== -1 ? true : false;
elem.reentryTrackNameShow = show;
}
// //
// if (elem.isTransferTrack) {
// show = this.nameLevels.indexOf(6) !== -1 ? true : false;
// elem.transferTrackNameShow = show;
// }
//
if (elem.isTransferTrack) {
show = this.nameLevels.indexOf(6) !== -1 ? true : false;
elem.transferTrackNameShow = show;
}
// deviceList.push(elem);
// })
// }
deviceList.push(elem);
})
}
// //
// show = this.nameLevels.indexOf(10) !== -1 ? true : false;
// let stopPointList = this.$store.getters['map/stopPointList'];
// if (stopPointList && stopPointList.length > 0) {
// stopPointList.forEach(elem => {
// //
// elem.destCodeShow = show;
// deviceList.push(elem);
// })
// }
//
show = this.nameLevels.indexOf(12) !== -1 ? true : false;
let stationList = this.$store.getters['map/stationList'];
if (stationList && stationList.length > 0) {
stationList.forEach(elem => {
elem._type = deviceType.Station;
//
elem.kmPostShow = show;
deviceList.push(elem);
// //
// show = this.nameLevels.indexOf(12) !== -1 ? true : false;
// let stationList = this.$store.getters['map/stationList'];
// if (stationList && stationList.length > 0) {
// stationList.forEach(elem => {
// //
// elem.kmPostShow = show;
// deviceList.push(elem);
})
}
// })
// }
// console.log(deviceList);
// this.$store.dispatch('map/updateMapDevices', deviceList);
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}
}

View File

@ -67,7 +67,8 @@
</template>
<script>
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import deviceType from '@/jmap/constant/deviceType';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
export default {
@ -155,17 +156,18 @@
})
},
setTrainDispaly() {
// let trainList = this.$store.getters['training/viewTrainList'];
// if (trainList && trainList.length > 0) {
// let planFormat = this.trainNameFormatBy(this.planMode);
// let nameFontSize = this.fontSize;
// trainList.forEach(elem => {
// elem.nameFormat = planFormat;
// elem.nameFontSize = nameFontSize;
// });
let trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) {
let planFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize;
trainList.forEach(elem => {
elem._type = deviceType.Train;
elem.nameFormat = planFormat;
elem.nameFontSize = nameFontSize;
});
// this.$store.dispatch('map/updateMapDevices', trainList);
// }
this.$store.dispatch('map/updateMapDevices', trainList);
}
},
trainNameFormatBy(mode) {
switch (mode.toString()) {

View File

@ -17,7 +17,6 @@
import { getEveryDayRunPlanData } from '@/api/simulation';
import { getSkinStyleList } from '@/api/management/mapskin'
import { UrlConfig } from '@/router/index';
import ThemeFactory from '@/jmap/theme/factory';
export default {
name: 'ReloadTodayPlan',
@ -129,7 +128,7 @@
if (skinStyle) {
getStationListBySkinStyle(skinStyle).then(response => {
let stations = response.data;
this.PlanConvert = ThemeFactory.loadPlanConvert(skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);

View File

@ -1,64 +1,41 @@
/**
* 公共字段部分默认初始值
*/
const modelPublicInitialValue = {
Signal: {
import deviceType from '../../constant/deviceType';
class Model {
constructor() {
// 公共字段部分默认初始值
this['public'] = {};
this['public'][deviceType.Signal] = {
lampPositionType: '02',
lampPostType: '02'
}
};
/**
* 在绘图创建Model数据时根据皮肤类型修改公共属性默认值
* @param {Object} model
*/
export function InitPublicProperties(model) {
if (model) {
var modelInitial = modelPublicInitialValue[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
/**
* 私有字段部分默认初始值
*/
const modelPrivateInitialValue = {
StationControl: {
// 私有字段部分默认初始值
this['private'] = {};
this['private'][deviceType.StationControl] = {
indicatorShow: true // 标识灯名称显示
},
Section: {
};
this['private'][deviceType.Section] = {
borderBorderShow: true, // 区段边界显示
standTrackNameShow: true, // 站台轨名称显示
reentryTrackNameShow: true, // 折返轨名称显示
transferTrackNameShow: true // 转换轨名称显示
},
Signal: {
};
this['private'][deviceType.Signal] = {
linkageAutoRouteShow: true, // 联锁自动进路表示灯显示
atsAutoTriggerShow: true // ATS自动触发表示灯显示
},
Train: {
};
this['private'][deviceType.Train] = {
nameFormat: 'targetCode:serviceNumber:tripNumber', // 字体格式
nameFontSize: 10 // 字体大小
},
TrainWindow: {
trainWindowShow: true
}
};
this['private'][deviceType.TrainWindow] = {
trainWindowShow: true
};
}
/**
* 加载Model数据时根据皮肤类型修改前端私有属性默认值
* @param {Object} model
*/
export function InitPrivateProperties(model) {
initPublicProps(model) {
if (model) {
var modelInitial = modelPrivateInitialValue[model._type];
var modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
@ -68,3 +45,19 @@ export function InitPrivateProperties(model) {
return model;
}
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
}
export default new Model();

View File

@ -107,7 +107,7 @@
import XLSX from 'xlsx';
import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { importData } from '../convert';
import { importData } from '../planConvert';
import { launchFullscreen } from '@/utils/screen';
export default {

View File

@ -17,7 +17,6 @@
import { timeFormat } from '@/utils/date';
import { runDiagramGetTime } from '@/api/simulation';
import { getStationListBySkinStyle } from '@/api/runplan';
import ThemeFactory from '@/jmap/theme/factory';
import DataTable from '../menusPlan/components/dataTable';
export default {
@ -229,7 +228,7 @@
])
},
mounted() {
this.PlanConvert = ThemeFactory.loadPlanConvert(this.skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(this.skinStyle);
},
beforeDestroy() {
this.destroy();

View File

@ -2,6 +2,7 @@ import * as zrUtil from 'zrender/src/core/util';
import * as matrix from 'zrender/src/core/matrix';
import deviceType from '../constant/deviceType';
import deviceRender from '../constant/deviceRender';
import Vue from 'vue';
export function createTransform(opts) {
let transform = matrix.create();
@ -32,80 +33,82 @@ export function deviceFactory(type, elem) {
return Object.assign(elem, deviceRender[type], { _type: type }, );
}
export function parser(data) {
const mapDevice = {};
export function parser(data, jmap) {
var mapDevice = {};
var propConvert = Vue.prototype.$theme.loadPropConvert(jmap.skinStyle);
if (data) {
zrUtil.each(data.linkList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Link, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Link, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.sectionList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Section, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Section, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.signalList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Signal, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Signal, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.stationList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Station, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Station, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.stationStandList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.StationStand, elem);
mapDevice[elem.code] = deviceFactory(deviceType.StationStand, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.stationControlList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.StationControl, elem);
mapDevice[elem.code] = deviceFactory(deviceType.StationControl, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.counterList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.StationCounter, elem);
mapDevice[elem.code] = deviceFactory(deviceType.StationCounter, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.delayShowList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.StationDelayUnlock, elem);
mapDevice[elem.code] = deviceFactory(deviceType.StationDelayUnlock, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.lineList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Line, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Line, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.textList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Text, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Text, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.zcList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.ZcControl, elem);
mapDevice[elem.code] = deviceFactory(deviceType.ZcControl, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.lcList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.LcControl, elem);
mapDevice[elem.code] = deviceFactory(deviceType.LcControl, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.tempSpeedLimitList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.LimitControl, elem);
mapDevice[elem.code] = deviceFactory(deviceType.LimitControl, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.resourceList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.ImageControl, elem);
mapDevice[elem.code] = deviceFactory(deviceType.ImageControl, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.trainList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Train, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Train, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.trainWindowList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.TrainWindow, elem);
mapDevice[elem.code] = deviceFactory(deviceType.TrainWindow, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.Line || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Line, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Line, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.Text || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Text, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Text, propConvert.initPrivateProps(elem));
}, this);
zrUtil.each(data.switchList || [], elem => {
@ -144,7 +147,7 @@ export function parser(data) {
rnodeSection['layer'] = -1;
}
mapDevice[elem.code] = deviceFactory(deviceType.Switch, elem);
mapDevice[elem.code] = deviceFactory(deviceType.Switch, propConvert.initPrivateProps(elem));
}, this);
}

View File

@ -12,6 +12,7 @@ import '@/styles/index.scss'; // global css
import App from './App';
import store from './store';
import router from './router';
import Theme from '@/jmap/theme/factory';
import '@/icons'; // icon
import '@/permission'; // permission control
@ -41,6 +42,7 @@ router.beforeEach((to, from, next) => {
next();
});
Vue.prototype.$theme = new Theme();
Vue.prototype.$messageBox = function(msge) {
if (this.$confirm) {
this.$confirm(`${msge || '处理失败'}`, '提示', {

View File

@ -344,20 +344,6 @@ const map = {
return [];
}
},
viewTrainList: (state) => {
// const trainList = [];
// const trainLevel = Vue.prototype.$jlmap.getTrainView();
// if (trainLevel) {
// trainLevel.eachChild((viewGroup) => {
// viewGroup.eachChild((train) => {
// if (train && train._type === deviceType.Train) {
// trainList.push(train.model);
// }
// }, this);
// }, this);
// }
// return trainList;
},
trainDetails: (state) => {
return state.trainDetails;
},
@ -423,7 +409,7 @@ const map = {
setMapData: (state, map) => {
state.map = map;
},
mapRender: (devices) => {
mapRender: (state, devices) => {
Vue.prototype.$jlmap && Vue.prototype.$jlmap.render(devices);
},
setTrainDetails: (state, details) => {
@ -530,8 +516,21 @@ const map = {
}
},
setTrainWindowShow: ({state}) => {
console.log('设置车次窗隐藏');
setTrainWindowShow: ({commit, state}, show) => {
if (state.map) {
var deviceList = [];
var trainWindowList = state.map.trainWindowList;
if (trainWindowList && trainWindowList.length) {
trainWindowList.forEach(elem => {
elem._type = deviceType.TrainWindow;
elem.trainWindowShow = show;
deviceList.push(elem);
});
}
commit('mapRender', deviceList);
}
},
operateTrainModel: ({ commit }, { model, type }) => {

View File

@ -1,6 +1,7 @@
import Vue from 'vue';
import { TrainingMode } from '@/scripts/ConstDic';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
import deviceType from '../../jmap/constant/deviceType';
/**
* 实训状态数据
@ -78,22 +79,15 @@ const training = {
},
// 视图中的列车列表
viewTrainList: (state) => {
// let trainList = [];
const trainList = [];
const mapDevice = Vue.prototype.$jlmap.mapDevice;
Object.values(mapDevice).forEach(device => {
if (device && device._type === deviceType.Train) {
trainList.push(device);
}
});
// if (state.jlmap && state.started) {
// let trainLevel = state.jlmap.getTrainView();
// if (trainLevel) {
// trainLevel.eachChild((viewGroup) => {
// viewGroup.eachChild((train) => {
// if (train && train._type === ModelType.Train) {
// trainList.push(train.model);
// }
// }, this);
// }, this);
// }
// }
// return trainList;
return trainList;
}
},

View File

@ -6,7 +6,7 @@
<script>
import { mapGetters } from 'vuex';
import ThemeFactory from '@/jmap/theme/factory';
import { debug } from 'util';
export default {
name: 'RunPlanLoad',
@ -30,12 +30,12 @@
watch: {
'$route.query.skinStyle': function (code) {
if (code) {
this.menus = ThemeFactory.loadPlanToolComponent(code);
this.menus = this.$theme.loadPlanComponent(code);
}
}
},
mounted() {
this.menus = ThemeFactory.loadPlanScheduleComponent(this.$route.query.skinStyle);
this.menus = this.$theme.loadPlanComponent(this.$route.query.skinStyle);
},
methods: {
doShow() {

View File

@ -10,7 +10,6 @@
import { runDiagramGetTime } from '@/api/simulation';
import { timeFormat } from '@/utils/date';
import { UrlConfig } from '@/router/index';
import ThemeFactory from '@/jmap/theme/factory';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import ChartSetting from '@/views/map/runplan/draft/setting';
@ -165,7 +164,7 @@
}
},
mounted() {
this.PlanConvert = ThemeFactory.loadPlanConvert(this.$route.query.skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinStyle);
},
beforeDestroy() {
if (this.myChart && this.myChart.isDisposed) {

View File

@ -15,7 +15,6 @@
import { timeFormat } from '@/utils/date';
import { UrlConfig } from '@/router/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import ThemeFactory from '@/jmap/theme/factory';
export default {
name: 'RunPlan',
@ -173,7 +172,7 @@
}
},
loadChartPage(opt) {
this.PlanConvert = ThemeFactory.loadPlanConvert(opt.skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(opt.skinStyle);
this.$store.dispatch('runPlan/clear').then(resp => {
this.loadInitChart().then(() => {
if (opt.skinStyle && opt.planId) {

View File

@ -12,7 +12,6 @@
import { UrlConfig } from '@/router/index';
import { DeviceMenu } from '@/scripts/ConstDic';
import { deleteRunPlan, importRunPlan } from '@/api/runplan';
import ThemeFactory from '@/jmap/theme/factory';
import ChartCreate from './create';
import ChartPublish from './publish';
import ChartCheck from './check';
@ -157,7 +156,7 @@
if (wb) {
try {
let jsonData = [];
let PlanConvert = ThemeFactory.loadPlanConvert(skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
for (let index in wb.Sheets) {
jsonData = PlanConvert.importData(wb.Sheets[index], jsonData);
}

View File

@ -13,8 +13,6 @@
import deviceType from '@/jmap/constant/deviceType';
import JlmapVisual from '@/views/jlmap/index';
import TrainingTips from '@/views/mapsystem/plugin/trainingtip';
import ThemeFactory from '@/jmap/theme/factory';
import { debug } from 'util';
export default {
name: 'LessonCanvas',
@ -50,7 +48,7 @@ import { debug } from 'util';
'$store.state.map.mapDataLoadedCount': function () {
const skinStyle = this.$jlmap.skinStyle;
if (skinStyle) {
this.menus = ThemeFactory.loadMenusComponent(skinStyle);
this.menus = this.$theme.loadMenuComponent(skinStyle);
}
}
},

View File

@ -57,7 +57,6 @@
import EditSmoothRunTime from './menus/editSmoothRunTime';
import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import ThemeFactory from '@/jmap/theme/factory';
import { mapGetters } from 'vuex';
import { deletePlanService } from '@/api/runplan';
@ -103,7 +102,8 @@
}
},
created() {
this.PlanConvert = ThemeFactory.loadPlanConvert(this.skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(this.skinStyle);
},
methods: {
resizeHandler() {

View File

@ -198,7 +198,6 @@
</template>
<script>
import ThemeFactory from '@/jmap/theme/factory';
import { getRoutingBySDTNumber, querySectionListByRouting, getRoutingList, getStationRunning, updatePlanTrip } from '@/api/runplan';
import { formatTime, formatName } from '@/utils/runPlan';
@ -324,7 +323,7 @@
this.editModel.taskIndex = params.taskIndex;
this.editModel.serviceNumber = params.serviceNumber;
this.editModel.tripNumber = params.tripNumber;
this.PlanConvert = ThemeFactory.loadPlanConvert(skinStyle);
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
let editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber]
if (editData) {