This commit is contained in:
zyy 2020-10-22 18:33:51 +08:00
commit f9d38a4efc
18 changed files with 165 additions and 87 deletions

View File

@ -233,5 +233,28 @@ export default {
}
}
return null;
},
/** 检查公里表是否超出范围*/
limitAreaKmRange(stations, model) {
const closerKmRange = model.closerKmRange||0;
const fartherKmRange = model.fartherKmRange||0;
const length = stations.length;
const last = stations[length-1]||{};
const minRange = this.EdgeHeight/2;
const maxRange = last.kmRange;
if (closerKmRange < minRange) {
const offset = closerKmRange - minRange
model.closerKmRange = minRange;
model.fartherKmRange -= offset;
return Math.abs(offset) > 2;
} else if (fartherKmRange > maxRange) {
const offset = fartherKmRange - maxRange;
model.fartherKmRange = maxRange;
model.closerKmRange -= offset;
return Math.abs(offset) > 2;
}
return false;
}
};

View File

@ -128,7 +128,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}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
}
});
@ -138,7 +139,8 @@ export default {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}

View File

@ -128,7 +128,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}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
}
});
@ -138,7 +139,8 @@ export default {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}

View File

@ -106,7 +106,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}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
}
});
@ -116,7 +117,8 @@ export default {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}

View File

@ -125,7 +125,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 tripNumber = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const tripNumber = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, tripNumber]);
}
});

View File

@ -188,7 +188,8 @@ export default {
/** 计算非折返点车次点坐标集合*/
train.stationTimeList.forEach((elem, index) => {
idx = index;
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
});
@ -196,7 +197,8 @@ export default {
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
lastPoint = train.stationTimeList[idx];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
}

View File

@ -282,7 +282,8 @@ export default {
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.formModel = {
groupNumber: model.groupNumber,
tripNumber: `${model.directionCode}${model.tripNumber}`,
// ${model.directionCode}
tripNumber: `${model.tripNumber}`,
trainType: model.type,
serviceNumber: model.serviceNumber,
targetCode: model.targetCode,

View File

@ -188,7 +188,8 @@ export default {
/** 计算非折返点车次点坐标集合*/
train.stationTimeList.forEach((elem, index) => {
idx = index;
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
});
@ -196,7 +197,8 @@ export default {
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
lastPoint = train.stationTimeList[idx];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
}

View File

@ -152,7 +152,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}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa, `${service.serviceNumber}${train.tripNumber}${train.destinationCode || ''}`]);
}
});

View File

@ -138,7 +138,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}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
}
});
@ -148,7 +149,8 @@ export default {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}

View File

@ -138,7 +138,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}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
}
});
@ -148,7 +149,8 @@ export default {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}

View File

@ -191,7 +191,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}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
}
});
@ -201,7 +202,8 @@ export default {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.directionCode}${train.tripNumber}`;
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}

View File

@ -77,7 +77,8 @@ const runPlan = {
const trainList = service.tripNumberDataList;
state.initialPlanData[service.serviceNumber] = { oldIndex: i, serviceNumber: service.serviceNumber, backup: service.backup, trainMap: {} };
trainList.forEach((train, j) => {
state.initialPlanData[service.serviceNumber].trainMap[`${train.directionCode}${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList };
// ${train.directionCode}
state.initialPlanData[service.serviceNumber].trainMap[`${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList };
});
});
}
@ -91,7 +92,8 @@ const runPlan = {
const trainList = service.tripNumberDataList;
state.editData[service.serviceNumber] = { oldIndex: i, serviceNumber: service.serviceNumber, backup: service.backup, trainMap: {} };
trainList.forEach((train, j) => {
state.editData[service.serviceNumber].trainMap[`${train.directionCode}${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList };
// ${train.directionCode}
state.editData[service.serviceNumber].trainMap[`${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList };
});
});
}
@ -106,7 +108,8 @@ const runPlan = {
const trainList = service.tripNumberDataList;
state.draftEditData[service.serviceNumber] = { oldIndex: i, serviceNumber: service.serviceNumber, backup: service.backup, trainMap: {} };
trainList.forEach((train, j) => {
state.draftEditData[service.serviceNumber].trainMap[`${train.directionCode}${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList };
// ${train.directionCode}
state.draftEditData[service.serviceNumber].trainMap[`${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList };
});
});
}

View File

@ -2,8 +2,8 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.169:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9008'; // 杜康

View File

@ -3,7 +3,8 @@
<template v-if="maxmini">
<div class="nav">
<div class="title">{{ config.title }}</div>
<el-tooltip class="item" effect="dark" :content="config.handleTips" placement="bottom">
<el-tooltip class="item" effect="dark" placement="bottom">
<div slot="content" v-html="config.handleTips" />
<div class="el-icon-info handleTips" />
</el-tooltip>
<!-- <div v-show="config.showClose" class="cls-status" @click="touch('Close')"><span /></div>

View File

@ -81,7 +81,7 @@ export default {
highlightCurrentRow: true,
handleChange: this.serviceNumberChange,
handleModify:this.serviceNumberModify,
handleTips:'单击数字选择表号,双击数字修改表号',
handleTips:'单击数字选择表号,双击数字修改表号,<br/>有车次信息变动 车次号会重新自动排列',
showClose: false,
columns: [
{
@ -97,7 +97,7 @@ export default {
highlightCurrentRow: true,
handleChange: this.tripNumberChange,
handleModify:this.tripNumberModify,
handleTips:'单击数字选择车次号,双击数字修改车次号',
handleTips:'单击数字选择车次号,双击数字修改车次号,<br/>有车次信息变动 车次号会重新自动排列',
showClose: false,
columns: [
{
@ -310,6 +310,7 @@ export default {
this.analyticalTripNumber(serviceObj.trainMap || {});
},
tripNumberChange(row) {
debugger;
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
let tripNumber = null;
if (row) {

View File

@ -12,6 +12,7 @@
@clear="onClear"
@create="onCreate"
@translate="onTranslate"
@refresh="refresh"
>
<template slot="header">
<div class="header">
@ -201,26 +202,18 @@ export default {
}
},
onRemove(){
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
switch(this.model.choice) {
case 'Plan':
if (['Translate', 'Edit'].includes(this.model.action)) {
this.doRemoveService();
} else {
this.doRemoveTrip();
}
break;
case 'Construction':
this.doRemoveArea();
break;
}
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
});
switch(this.model.choice) {
case 'Plan':
if (['Translate', 'Edit'].includes(this.model.action)) {
this.doRemoveService();
} else {
this.doRemoveTrip();
}
break;
case 'Construction':
this.doRemoveArea();
break;
}
},
doNewPlan() {
clearRpPlan().then(resp => {
@ -372,35 +365,60 @@ export default {
}
},
doRemoveService() {
if (this.selected) {
delRpService(this.selected.serviceNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.$message.info(error.message);
})
}
if (this.selected) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delRpService(this.selected.serviceNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.$message.info(error.message);
})
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
});
}
},
doRemoveTrip() {
if (this.selected) {
delRpTrip(this.selected.tripNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.$message.info(error.message);
})
}
if (this.selected) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delRpTrip(this.selected.tripNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.$message.info(error.message);
})
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
});
}
},
doRemoveArea() {
if (this.target) {
const data = this.target.model;
delRpArea(data.areaNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.$message.info(error.message);
})
}
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = this.target.model;
delRpArea(data.areaNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.$message.info(error.message);
})
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
});
}
},
refresh() {
getRpTools().then(rest => {

View File

@ -117,7 +117,6 @@ export default {
onZrMouseDown(e) {
if (e.target && ['area'].includes(e.target.subType)) {
this.pixelExecCb(e, this.doSetTarget);
this.dragging = true;
if (this.model.choice == 'Construction') {
if (this.model.action == 'Note') {
this.pixelExecCb(e, this.doPopDialog);
@ -146,13 +145,14 @@ export default {
this.pixelExecCb(e, this.doTranslate)
}
}
this.dragging = false;
}
if (!e.target) {
this.$emit('clear')
}
// if (!e.target) {
// this.$emit('clear')
// }
this.dragging = false;
},
onZrMouseOut(e) {
},
@ -173,7 +173,6 @@ export default {
}
},
onMouseDown(e) {
this.dragging = true;
if (this.model.choice == 'Plan') {
if (this.model.action == 'Edit') {
this.pixelExecCb(e, this.doPopDialog);
@ -302,7 +301,7 @@ export default {
_y: pointInGrid[1]
})
this.target = target;
this.target = e.target;
this.$emit('tag', target);
}
},
@ -314,7 +313,7 @@ export default {
const option = this.myChart.getOption();
const dataList = option.series[e.seriesIndex].data;
const length = dataList.length;
const last = utils.findNext(dataList, e.dataIndex, (el, i) => { return el instanceof Array});
const next = utils.findNext(dataList, e.dataIndex, (el, i) => { return el instanceof Array});
const isService = this.model.choice == 'Plan' && ['Translate', 'Edit'].includes(this.model.action);
if (this.selected &&
@ -349,8 +348,8 @@ export default {
seriesIndex: e.seriesIndex,
seriesName: isService? e.seriesName: 'service-trip',
seriesId: e.seriesId,
depTime: e.dataIndex < length - 1? last[0] - value[0]: 0,
runTime: e.dataIndex < length - 1? last[0] - value[0]: 0,
depTime: e.dataIndex < length - 1? next[0] - value[0]: 0,
runTime: e.dataIndex < length - 1? next[0] - value[0]: 0,
... value[2],
_x: pointInGrid[0],
_y: pointInGrid[1],
@ -413,14 +412,15 @@ export default {
const option = this.myChart.getOption();
const dataList = option.series[e.seriesIndex].data;
const length = dataList.length;
const next = dataList[e.dataIndex+1];
const near = dataList[e.dataIndex+1];
const prev = utils.findPrev(dataList, e.dataIndex, (el, i) => { return el instanceof Array});
const next = utils.findNext(dataList, e.dataIndex, (el, i) => { return el instanceof Array});
this.doSetSelected({e, pointInGrid});
if (e.dataIndex < length - 1 && e.value[1] == next[1]) {
if (e.dataIndex < length - 1 && e.value[1] == near[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: MenuEnum.planJustStop });
} else if (e.dataIndex < length - 1 && e.value[1] != next[1]) {
} else if (e.dataIndex < length - 1 && e.value[1] != near[1] && e.value[1] == next[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: MenuEnum.planJustTurnBack });
} else if (e.dataIndex == 0 || e.dataIndex > 0 && e.value[1] == prev[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: MenuEnum.planJustRunning });
@ -434,7 +434,8 @@ export default {
}
},
doSeriesDragging({e, pointInGrid}) {
if (this.selected && this.dragging) {
if (this.selected) {
this.dragging = true;
this.selected.dx = pointInGrid[0] - this.selected._x;
this.selected.dy = pointInGrid[1] - this.selected._y;
this.selected._x = pointInGrid[0];
@ -469,12 +470,14 @@ export default {
}
},
doAreaDragging({e, pointInGrid}) {
if (this.target && ['area'].includes(this.target.subType) && this.dragging) {
if (this.target && ['area'].includes(this.target.subType)) {
this.dragging = true;
const target = this.target;
const model = target.model;
const dx = pointInGrid[0] - model._x;
const dy = pointInGrid[1] - model._y;
model._x = pointInGrid[0];
model._y = pointInGrid[1];
@ -482,10 +485,15 @@ export default {
model.endTime += dx;
model.fartherKmRange += dy;
model.closerKmRange += dy;
if (this.planUtil.limitAreaKmRange(this.stations, model)) {
this.onZrMouseUp(e);
}
}
},
doAreaHornDragging({e, pointInGrid}) {
if (e.target && ['drag'].includes(e.target.subType) && this.dragging) {
if (e.target && ['drag'].includes(e.target.subType)) {
this.dragging = true;
const option = this.myChart.getOption();
const target = this.target;
const model = target.model;
@ -495,6 +503,7 @@ export default {
const dx = pointInGrid[0] - model._x;
const dy = pointInGrid[1] - model._y;
model._x = pointInGrid[0];
model._y = pointInGrid[1];
@ -517,6 +526,10 @@ export default {
break;
}
if (this.planUtil.limitAreaKmRange(this.stations, model)) {
this.onZrMouseUp(e);
}
const args = this.planUtil.calcAreaArgsByModel(this.myChart, model);
const graph = option.graphic[0].elements.find(el => { return ['area'].includes(el.subType) && el.model.areaNo == model.areaNo; });
graph.position = args.position;