调整发布地图导出,调整大屏流程

This commit is contained in:
zyy 2020-08-26 17:44:01 +08:00
parent 4de5947d34
commit fc14cc41a7
9 changed files with 52 additions and 43 deletions

File diff suppressed because one or more lines are too long

View File

@ -14,10 +14,10 @@ export default class Text2 extends Group {
this.style = style;
this.z = 6;
this.isShowShape = true;
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
}
// if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create();
this.setState(model);
// }
if (model.previewOrMapDraw) {
this.setShowMode();
}
@ -50,6 +50,11 @@ export default class Text2 extends Group {
setState(model) {
if (!this.isShowShape) return;
}
getBoundingRect() {
if (this.text) {
return this.text.getBoundingRect().clone();
}
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;

View File

@ -226,11 +226,11 @@ export default {
}
/** 计算折返点*/
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.directionCode];
var num = this.computedReentryNumber(elem.tripNumber);
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false, num), 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]]);
}

View File

@ -250,6 +250,7 @@ export default {
markPointData: []
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
}
const time = elem.secondTime || elem.second;
/** 添加数据*/
series.forEach(serie => {
@ -269,25 +270,27 @@ export default {
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)],
coord: [parseInt(time), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000'
}));
}
/** 计算折返点*/
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]]);
}
}
var num = this.computedReentryNumber(elem.tripNumber);
var nextPoint = [parseInt(time), this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false, num), elem.stationCode, elem.directionCode];
/** 添加车组号数据到对应的服务图数据中*/
serie.data.push(nextPoint);
if (serie.data.length > 0) {
var lastPoint = serie.data[serie.data.length - 1];
// if (elem.reentry) {
// console.log(1111, '折返');
// }
if (lastPoint[3] !== nextPoint[3]) {
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[3], num), lastPoint[2], lastPoint[3]]);
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], nextPoint[3], num), nextPoint[2], nextPoint[3]]);
}
}
/** 保证原始数据排序*/
serie.data.sort((a, b) => {
@ -350,9 +353,9 @@ export default {
/** 根据方向计算y折返偏移量*/
getYvalueByDirectionCode(defaultVlue, directionCode, num) {
if (directionCode === '1') {
if (directionCode == '1') {
defaultVlue -= this.EdgeHeight / 2 * num;
} else if (directionCode === '2') {
} else if (directionCode == '2') {
defaultVlue += this.EdgeHeight / 2 * num;
}

View File

@ -40,13 +40,12 @@ class TransformHandle {
view.decomposeTransform(); // 修改 transform 后同步位置
if (view.screenShow) {
view.screenShow();
} else {
view.show();
}
view.show();
view.dirty(); // 更新
return;
}
}
view.dirty(); // 更新
}
}
@ -57,9 +56,8 @@ class TransformHandle {
view.decomposeTransform();
if (view.screenShow) {
view.screenShow();
} else {
view.show();
}
view.show();
view.dirty();
}
}
@ -115,9 +113,8 @@ class TransformHandle {
} else {
if (view.screenShow) {
view.screenShow();
} else {
view.show();
}
view.show();
}
view.dirty();
}

View File

@ -8,11 +8,13 @@
<script>
import Vue from 'vue';
import IbpPan from '@/ibp/ibpPan';
// import ibpData from '@/ibp/constant/ibpData';
import { parser } from '@/ibp/utils/parser';
import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen';
import { handlerIbpEvent } from '@/api/simulation';
import { IbpOperation } from '@/scripts/ConstDic';
import { getIbpInfoByStation } from '@/api/ibp';
export default {
@ -122,6 +124,7 @@ export default {
return;
}
try {
// const ibpDatas = ibpData[deviceCode];
const res = await getIbpInfoByStation(this.$route.query.mapId, deviceCode);
if (res.data.data) {
const ibpDatas = JSON.parse(res.data.data).drawData;

View File

@ -220,14 +220,25 @@ export default {
const initialPlanData = this.$store.state.runPlan.initialPlanData;
data.forEach(item => {
if (item && initialPlanData[item.serviceNumber]) {
// if (initialPlanData[item.serviceNumber]) {
// console.log(this.runSeries, data, '=====');
// debugger;
// }
Object.keys(initialPlanData[item.serviceNumber].trainMap).forEach(ele => {
if (initialPlanData[item.serviceNumber].trainMap[ele + ''].tripNumber == item.tripNumber) {
item.directionCode = initialPlanData[item.serviceNumber].trainMap[ele + ''].directionCode;
// item.reentry = initialPlanData[item.serviceNumber].trainMap[ele + ''].reentry;
// if (item.reentry) {
// debugger;
// }
// item.stationCode = initialPlanData[item.serviceNumber].trainMap[ele + ''].stationCode;
}
});
item.secondTime = item.second;
// item.backup = initialPlanData[item.serviceNumber].backup;
}
});
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
this.runSeries = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap,
planData, this.runSeries, { color: '#FF00DE', width: 2 }
);

View File

@ -218,16 +218,6 @@ export default {
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
// right: '30px',
// feature: {
// dataZoom: {
// yAxisIndex: 'none'
// },
// restore: {},
// saveAsImage: {}
// }
},
tooltip: {
axisPointer: {
trigger: 'item',

View File

@ -20,14 +20,14 @@ export default {
index: '',
row: '',
idx: '',
checkList: ['MAP_DATA'],
checkList: ['MAP_DATA', 'REAL_LINE_CONFIG'],
checksModels: [
{ label: '地图数据', value: 'MAP_DATA', selected: true },
{ label: '运行图数据', value: 'RUN_PLAN' },
{ label: '3d数据', value: 'MAP_3D_DATA' },
{ label: '3d模型', value: 'MAP_3D_MODEL' },
{ label: 'ibp数据', value: 'ibp' },
{ label: '指令定义', value: 'COMMAND_DEFINITION' },
{ label: '线路配置', value: 'REAL_LINE_CONFIG' }
{ label: '线路配置', value: 'REAL_LINE_CONFIG', selected: true }
]
};
},
@ -49,7 +49,7 @@ export default {
mapData: this.checkList.includes('MAP_DATA'),
runPlan: this.checkList.includes('RUN_PLAN'),
map3dData: this.checkList.includes('MAP_3D_DATA'),
map3dModel: this.checkList.includes('MAP_3D_MODEL'),
ibp: this.checkList.includes('ibp'),
commandDefinition: this.checkList.includes('COMMAND_DEFINITION'),
realLineConfig: this.checkList.includes('REAL_LINE_CONFIG')
};