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

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.style = style;
this.z = 6; this.z = 6;
this.isShowShape = true; this.isShowShape = true;
if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) { // if (isShowThePrdType(model.prdType, model.showConditions) || model.previewOrMapDraw) {
this.create(); this.create();
this.setState(model); this.setState(model);
} // }
if (model.previewOrMapDraw) { if (model.previewOrMapDraw) {
this.setShowMode(); this.setShowMode();
} }
@ -50,6 +50,11 @@ export default class Text2 extends Group {
setState(model) { setState(model) {
if (!this.isShowShape) return; if (!this.isShowShape) return;
} }
getBoundingRect() {
if (this.text) {
return this.text.getBoundingRect().clone();
}
}
// 设置显示模式 // 设置显示模式
setShowMode() { setShowMode() {
const showMode = this.model.showMode; 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) { if (serie.data.length > 0) {
var lastPoint = serie.data[serie.data.length - 1]; var lastPoint = serie.data[serie.data.length - 1];
if (lastPoint[2] !== nextPoint[2]) { 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([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[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2], num), lastPoint[2]]);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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