This commit is contained in:
fan 2020-04-14 11:29:18 +08:00
commit 7c9d9ef4c7
11 changed files with 100 additions and 61 deletions

View File

@ -371,6 +371,7 @@ export default {
},
//
reopenSignalByRoute(selectType) {
debugger;
commitOperate(menuOperate.Signal.reopenSignal, {signalCode:selectType.code}, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);

View File

@ -491,7 +491,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3040', tip: '鼠标左键点击【信号重开】' },
{ deviceType: '04', orderNum: 2, operateCode: '3040', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'}
{ deviceType: '04', orderNum: 2, operateCode: '304', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'}
]
},
{
@ -505,7 +505,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3090', tip: '鼠标左键点击【自动进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '3090', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'}
{ deviceType: '04', orderNum: 2, operateCode: '3090', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'}
]
},
{
@ -519,7 +519,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3090', tip: '鼠标左键点击【自动进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '3090', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'}
{ deviceType: '04', orderNum: 2, operateCode: '3090', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'}
]
},
{
@ -533,7 +533,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3050', tip: '鼠标左键点击【总人解】' },
{ deviceType: '04', orderNum: 2, operateCode: '3050', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'}
{ deviceType: '04', orderNum: 2, operateCode: '3050', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'}
]
},
{
@ -547,7 +547,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '2994', tip: '鼠标左键点击【总取消】' },
{ deviceType: '04', orderNum: 2, operateCode: '2994', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'}
{ deviceType: '04', orderNum: 2, operateCode: '313', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'}
]
},
{
@ -561,7 +561,7 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '2994', tip: '鼠标左键点击【总取消】' },
{ deviceType: '04', orderNum: 2, operateCode: '2994', tip: '鼠标左键点击【信号机】', codeType:'SIGNAL'}
{ deviceType: '04', orderNum: 2, operateCode: '303', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'}
]
},
{
@ -575,8 +575,8 @@ export default {
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '3010', tip: '鼠标左键点击【排列进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '3010', tip: '鼠标左键点击【始端信号机】', codeType:'SIGNAL'},
{ deviceType: '04', orderNum: 3, operateCode: '3010', tip: '鼠标左键点击【终端信号机】', codeType:'SIGNAL'}
{ deviceType: '04', orderNum: 2, operateCode: '3010', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'},
{ deviceType: '04', orderNum: 3, operateCode: '3010', tip: '鼠标左键点击选择该信号机', codeType:'SIGNAL'}
]
}
// 自动折返 (暂时没有)

View File

@ -1,4 +1,4 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan';
export default {
/** 边缘高度*/
@ -116,7 +116,7 @@ export default {
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
opt.markPointData.push(createMartPoint(pointdata));
opt.markPointData.push(createMartPointReverse(pointdata));
/** 创建服务号名称*/
opt.name = `${service.serviceNumber}`;
}
@ -206,7 +206,7 @@ export default {
/** 如果此记录车组号的数据为第一条时,则打上标签*/
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
serie.markPoint.data.push(createMartPoint({
serie.markPoint.data.push(createMartPointReverse({
directionCode: elem.directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
@ -290,9 +290,9 @@ export default {
/** 根据方向计算y折返偏移量*/
getYvalueByDirectionCode(defaultVlue, directionCode, num) {
if (directionCode === '1') {
defaultVlue -= this.EdgeHeight / 2 * num;
} else if (directionCode === '2') {
defaultVlue += this.EdgeHeight / 2 * num;
} else if (directionCode === '2') {
defaultVlue -= this.EdgeHeight / 2 * num;
}
return defaultVlue;

View File

@ -1,4 +1,4 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan';
export default {
/** 边缘高度*/
@ -111,7 +111,7 @@ export default {
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
/** 给服务对象添加服务名称和标记点*/
opt.markPointData.push(createMartPoint(pointdata));
opt.markPointData.push(createMartPointReverse(pointdata));
/** 创建服务号名称*/
opt.name = `${service.serviceNumber}`;
}
@ -122,8 +122,8 @@ export default {
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) {
const aa = `${train.directionCode}${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
const tripNumber = `${train.directionCode}${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, tripNumber]);
}
});
@ -197,7 +197,7 @@ export default {
/** 如果此记录车组号的数据为第一条时,则打上标签*/
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
serie.markPoint.data.push(createMartPoint({
serie.markPoint.data.push(createMartPointReverse({
directionCode: elem.directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
@ -275,15 +275,16 @@ export default {
/** 根据是否和上一个车次是否相交,计算下一个车次的折返的高度*/
computedReentryNumber(code) {
return parseInt(code || 1) % 2 ? 1 : 2;
// return parseInt(code || 1) % 2 ? 1 : 2;
return 1;
},
/** 根据方向计算y折返偏移量*/
getYvalueByDirectionCode(defaultVlue, directionCode, num) {
if (directionCode === '1') {
defaultVlue -= this.EdgeHeight / 2 * num;
} else if (directionCode === '2') {
defaultVlue += this.EdgeHeight / 2 * num;
} else if (directionCode === '2') {
defaultVlue -= this.EdgeHeight / 2 * num;
}
return defaultVlue;

View File

@ -718,7 +718,7 @@ export const OperationEvent = {
reopenSignal: {
button: {
operation: '3040',
domId: '_Tips-Signal-Reopen-Mbm'
domId: '_Tips-Signal-Reopen-Mbm{TOP}'
},
menu: {
operation: '304',

View File

@ -190,6 +190,7 @@ const map = {
recoverStepData: [], // 缓存恢复数据
seclectDeviceList: [], // 包围框选中元素列表
trainWindowSectionCode: '', // 选择车次窗所属区段code
flankProtectList: [], // 侧防列表
map: null, // 地图数据
dataZoom: {}, // 缩放位置
mapDevice: {}, // 解析后的地图数据
@ -459,6 +460,9 @@ const map = {
trainDetails: (state) => {
return state.trainDetails;
},
flankProtectList: (state) => {
return state.flankProtectList;
},
mapDevice: (state) => {
return state.mapDevice;
},
@ -722,6 +726,16 @@ const map = {
},
setShowCentralizedStationNum: (state) => {
state.showCentralizedStationNum++;
},
setFlankProtectList: (state, data) => {
state.flankProtectList.push(data);
},
delFlankProtectList: (state, data) => {
state.flankProtectList.forEach((item, index) => {
if (item.code == data.code) {
state.flankProtectList.splice(index, 1);
}
});
}
},
@ -894,6 +908,12 @@ const map = {
},
setShowCentralizedStationNum: ({commit}) => {
commit('setShowCentralizedStationNum');
},
setFlankProtectList: ({ commit }, data) => {
commit('setFlankProtectList', data);
},
delFlankProtectList: ({ commit }, data) => {
commit('delFlankProtectList', data);
}
}
};

View File

@ -3,7 +3,26 @@ import { timeFormat } from '@/utils/date';
/** 创建一个车次数据点*/
export function createMartPoint(opt) {
const rotate = opt.directionCode === '2' ? 45 : (opt.directionCode === '1' ? -45 : 0);
const rotate = opt.directionCode == '2' ? 45 : (opt.directionCode == '1' ? -45 : 0);
const position = opt.type ? 'insideBottomLeft' : 'insideTopLeft';
return {
coord: opt.coord,
name: opt.name,
label: {
normal: {
rotate: rotate,
formatter: '{b}',
backgroundColor: 'rgb(242,242,242,0.1)',
color: 'black',
position: position
}
}
};
}
/** 创建一个车次数据点*/
export function createMartPointReverse(opt) {
const rotate = opt.directionCode == '1' ? 45 : (opt.directionCode == '2' ? -45 : 0);
const position = opt.type ? 'insideBottomLeft' : 'insideTopLeft';
return {
coord: opt.coord,

View File

@ -173,6 +173,7 @@ export default {
//
delFlankProtection(row.id).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.$store.dispatch('map/delFlankProtectList', row);
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('map.failDelete'));

View File

@ -315,7 +315,10 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
postFlankProtection(this.buildModel(setUID('flank'))).then(resp => {
const data = this.buildModel(setUID('flank'));
postFlankProtection(data).then(resp => {
const dataModel = JSON.parse(JSON.stringify(data));
this.$store.dispatch('map/setFlankProtectList', dataModel);
this.$message.success(this.$t('map.automaticSignalSuccessful'));
this.loading = false;
this.clear();

View File

@ -115,8 +115,8 @@
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="$t('map.accessSideTurnoutData') + ':'" prop="routeFlankProtectionList">
<el-select v-model="flankCode" clearable multiple filterable :placeholder="$t('map.pleaseSelect')">
<el-form-item label="侧防列表:">
<el-select v-model="addModel.flankProtectionList" clearable multiple filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in flankProtectList"
:key="item.code"
@ -200,7 +200,7 @@ export default {
{ name: '定位', code: true },
{ name: '反位', code: false }
],
flankProtectList: [], //
// flankProtectList: [], //
addModel: {
mapId: '',
code: '',
@ -217,6 +217,7 @@ export default {
routeSectionList: [], //
routeSwitchList: [], //
routeFlankProtectionList: [], //
flankProtectionList: [],
stationStandList: [], //
overlapCode:'',
conflictingSignalList: [] //
@ -231,7 +232,8 @@ export default {
'switchList',
'sectionList',
'stationList',
'stationStandList'
'stationStandList',
'flankProtectList'
]),
routeName: {
get() {
@ -329,11 +331,9 @@ export default {
this.initLoad();
}
},
created() {
this.getFlankProtectList();
},
mounted() {
this.getRouteList();
this.getFlankProtectList();
},
methods: {
initLoad() { //
@ -346,23 +346,11 @@ export default {
this.routeList = response.data.list;
},
async getFlankProtectList() { //
const response = await getFlankProtectionList(this.$route.params.mapId, { pageSize: 9999, pageNum: 1 });
this.flankProtectList = response.data.list;
// this.flankProtectList.map(elem => {
// elem.stationName = this.filterStation(elem.stationCode);
// });
const res = await getFlankProtectionList(this.$route.params.mapId, { pageSize: 9999, pageNum: 1 });
res.data.list.forEach(item => {
this.$store.dispatch('map/setFlankProtectList', item);
});
},
// filterStation(code) {
// let name = '';
// for (let i = 0; i < this.stationList.length; i++) {
// if (this.stationList[i].code == code) {
// name = this.stationList[i].name;
// return;
// }
// }
// return name;
// },
swictchName(code) {
let name = '';
if (code) {
@ -447,6 +435,7 @@ export default {
this.addModel.mapId = this.mapInfo.id;
this.addModel.routeSwitchList = [];
this.addModel.routeFlankProtectionList = [];
this.addModel.flankProtectionList = [];
this.addModel.overlapCode = '';
this.addModel.code = '';
this.addModel.conflictingSignalList = [];

View File

@ -208,7 +208,8 @@ export default {
]
},
absoluteTime: 2 * 3600,
indexKmRangeMap: {}
indexKmRangeMap: {},
stationsObj: {}
};
},
computed: {
@ -279,20 +280,20 @@ export default {
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
let tripNumber = null;
if (row) {
let data;
const data = [];
tripNumber = row.tripNumber;
const op = this.myChart.getOption();
op.series.forEach((item, index) => {
switch (item.name) {
case serviceNumber: {
const param = '\\[\\d*,\\d*,"Station_\\d*_[.\\d]*","' + tripNumber + '"\\]';
const temp = JSON.stringify(item.data).match(new RegExp(param, 'g'));
data = JSON.parse('[' + temp.toString() + ']');
// item.data.forEach(nor => {
// if (nor[3] == tripNumber) {
// data.push(nor);
// }
// });
// const param = '\\[\\d*,\\d*,"Station_\\d*_[.\\d]*","' + tripNumber + '"\\]';
// const temp = JSON.stringify(item.data).match(new RegExp(param, 'g'));
// data = JSON.parse('[' + temp.toString() + ']');
item.data.forEach(nor => {
if (nor[3] == tripNumber) {
data.push(nor);
}
});
break;
}
case 'trainLabel': {
@ -479,6 +480,10 @@ export default {
try {
const stations = this.$store.state.runPlan.stations;
const planData = this.$store.state.runPlan.planData;
this.stationsObj = {};
stations.forEach(item => {
this.stationsObj[Math.floor(item.kmRange)] = item;
});
this.viewDisabled = true;
@ -591,13 +596,13 @@ export default {
let data = '';
const arr = [];
param.forEach(item => {
const station = this.stations[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' };
const station = this.stationsObj[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' };
if (!arr.includes(`${item.data[0]}${item.data[1]}`)) {
arr.push(`${item.data[0]}${item.data[1]}`);
if (this.$route.query.lineCode == '06') {
if (this.$route.query.lineCode == '06' || this.$route.query.lineCode == '08') {
const list = [
`${this.$t('planMonitor.stationName')}${station.name}<br>`,
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km <br>`,
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} m <br>`,
`${this.$t('planMonitor.arriveTime')}${timeFormat(item.data[0] + this.planConvert.TranslationTime)}<br>`,
`${this.$t('planMonitor.serverTrainNum')}: ${item.seriesName}${item.data[3]}`,
`<hr size=1 style="margin: 3px 0">`
@ -606,7 +611,7 @@ export default {
} else {
const list = [
`${this.$t('planMonitor.stationName')}${station.name}<br>`,
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km <br>`,
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} m <br>`,
`${this.$t('planMonitor.arriveTime')}${timeFormat(item.data[0] + this.planConvert.TranslationTime)}<br>`,
`${this.$t('planMonitor.serverTrainNum')}: ${item.seriesName}${item.data[3]}(${item.data[3][0] == '2' ? '上行' : '下行'})`,
`<hr size=1 style="margin: 3px 0">`