diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index 4b80a96f3..d2ba76f2b 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -329,6 +329,13 @@ export default { stationPositionX: 'X coordinate:', stationPositionY: 'Y coordinate:', stationPosition: 'Station position:', + isCIStation:'Concentrate station or not', + stationNumber:'Station number:', + subhead:'Subhead:', + subheadDisplay:'Subhead display:', + subheadFont:'Subhead font:', + subheadFontColor:'Subhead font color:', + subheadPosition:'Subhead position:', stationControlCode: 'Control mode coding:', stationControlName: 'Control mode name:', diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index 83da46743..51aee2a8f 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -321,6 +321,8 @@ export default { stationPositionX: 'x坐标:', stationPositionY: 'y坐标:', stationPosition: '车站坐标:', + isCIStation:'是否联锁站', + stationNumber:'车站编号:', stationControlPosition: '控制模式坐标:', stationControlCode: '控制模式编码:', @@ -340,6 +342,11 @@ export default { stationstandWidth: '宽度 w:', stationstandHeight: '高度 h:', stationstandPosition: '车站坐标:', + subhead:'副标题:', + subheadDisplay:'是否显示副标题:', + subheadFont:'副标题字体:', + subheadFontColor:'副标题字体颜色:', + subheadPosition:'副标题坐标:', switchCode: '道岔编码:', switchName: '道岔名称:', diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js index 2fb3c6506..e29b617e7 100644 --- a/src/jmapNew/mouseController.js +++ b/src/jmapNew/mouseController.js @@ -304,10 +304,14 @@ class MouseController extends Eventful { // 右键拖动区域大小 handleMouseMoveRight(point2) { const point1 = this.rightClickPoint; - const x = Math.min(point1.x, point2.x) + this.$jmap.$options.offsetX; - const y = Math.min(point1.y, point2.y) + this.$jmap.$options.offsetY; - const width = Math.abs(point1.x - point2.x); - const height = Math.abs(point1.y - point2.y); + const originX = Math.min(point1.x, point2.x); + const originY = Math.min(point1.y, point2.y); + const dx = originX + this.$jmap.$options.offsetX; + const dy = originY + this.$jmap.$options.offsetY; + const x = dx / this.$jmap.$options.scaleRate; + const y = dy / this.$jmap.$options.scaleRate; + const width = Math.abs(point1.x - point2.x) / this.$jmap.$options.scaleRate + 10; + const height = Math.abs(point1.y - point2.y) / this.$jmap.$options.scaleRate + 10; this.$jmap.renderCheckBox({code: 'check_box', _type: 'CheckBox', point: {x: x, y: y}, width: width, height: height }); } } diff --git a/src/jmapNew/shape/Psd/index.js b/src/jmapNew/shape/Psd/index.js index 2fbdc93ba..bcc748286 100644 --- a/src/jmapNew/shape/Psd/index.js +++ b/src/jmapNew/shape/Psd/index.js @@ -1,5 +1,6 @@ import Group from 'zrender/src/container/Group'; import ESafeDoor from './ESafeDoor'; +import EHighlight from '../element/EHighlight'; export default class Line2 extends Group { constructor(model, style) { @@ -12,6 +13,7 @@ export default class Line2 extends Group { this.style = style; this.create(); this.setState(model); + this.checkIsDrawMap(); } create() { @@ -34,4 +36,17 @@ export default class Line2 extends Group { setState(model) { } + drawSelected(selected) { + this.highlight && this.highlight.drawSelected(selected); + } + + checkIsDrawMap() { + const path = window.location.href; + if (path.includes('/map/draw')) { + this.highlight = new EHighlight(this); + this.add(this.highlight); + this.on('mouseout', () => { this.highlight.mouseout(); }); + this.on('mouseover', () => { this.highlight.mouseover(); }); + } + } } diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 075031b0f..4d974c9ed 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -853,7 +853,7 @@ export default class Section extends Group { drawSelected(selected) { this.selected = selected; if (selected) { - this.section && this.section.setStyle({stroke: 'rgba(204,255,255,0.8)'}); + this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'}); } else { this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor }); } @@ -863,7 +863,7 @@ export default class Section extends Group { const path = window.location.href; if (path.includes('/map/draw')) { this.on('mouseout', () => { !this.selected && this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor }); }); - this.on('mouseover', () => { this.section && this.section.setStyle({stroke: 'rgba(204,255,255,0.8)'}); }); + this.on('mouseover', () => { this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'}); }); } } } diff --git a/src/jmapNew/shape/Station/EMouse.js b/src/jmapNew/shape/Station/EMouse.js index e954afcb6..a7654a713 100644 --- a/src/jmapNew/shape/Station/EMouse.js +++ b/src/jmapNew/shape/Station/EMouse.js @@ -21,7 +21,7 @@ export default class EMouse extends Group { z: this.device.z + 1, shape: stationTextRect, style: { - fill: 'rgba(204,255,255,0.5)' + fill: 'rgba(0,255,255,0.6)' } }); diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index e864b6941..e4785f3e0 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -40,7 +40,7 @@ export default class Station extends Group { fontWeight: model.fontWeight, fontSize: model.nameFont || 18, fontFamily: style.fontFamily, - text: model.name, + text: model.number ? model.number + model.name : model.name, textAlign: 'middle', textVerticalAlign: 'top', textFill: model.nameFontColor @@ -74,6 +74,23 @@ export default class Station extends Group { }); this.add(this.mileageText); } + if (model.subheadDisplay) { + this.subheadText = new ETextName({ + zlevel: this.zlevel, + z: this.z, + position: [0, 0], + x: model.subheadPosition.x, + y: model.subheadPosition.y, + fontWeight: model.fontWeight, + fontSize: model.subheadFont || 18, + fontFamily: style.fontFamily, + text: model.subhead, + textAlign: 'middle', + textVerticalAlign: 'top', + textFill: model.subheadFontColor + }); + this.add(this.subheadText); + } } } createTurnBack() { // 创建按图折返 diff --git a/src/jmapNew/shape/checkBox/checkBox.js b/src/jmapNew/shape/checkBox/checkBox.js index 55ad94de6..5e3e64902 100644 --- a/src/jmapNew/shape/checkBox/checkBox.js +++ b/src/jmapNew/shape/checkBox/checkBox.js @@ -14,17 +14,13 @@ export default class checkBox extends Group { create() { const model = this.model; - this.grouper = new Group({ - id: model.code, - position: [model.point.x, model.point.y] - }); this.box = new Rect({ zlevel: model.zlevel, z: model.z, draggable: false, shape: { - x: 0, - y: 0, + x: model.point.x, + y: model.point.y, width: this.model.width, height: this.model.height }, @@ -32,15 +28,6 @@ export default class checkBox extends Group { fill: 'rgb(135,206,250,0.2)' } }); - this.grouper.add(this.box); - this.add(this.grouper); - } - setModel(dx, dy) { - this.model.point.x += dx; - this.model.point.y += dy; - } - setSize(width, height) { - this.model.width = width; - this.model.height = height; + this.add(this.box); } } diff --git a/src/jmapNew/shape/element/EHighlight.js b/src/jmapNew/shape/element/EHighlight.js index 67776df0e..f15c68c8c 100644 --- a/src/jmapNew/shape/element/EHighlight.js +++ b/src/jmapNew/shape/element/EHighlight.js @@ -1,6 +1,5 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; -import Polygon from 'zrender/src/graphic/shape/Polygon'; class EHighlight extends Group { constructor(device) { @@ -11,13 +10,17 @@ class EHighlight extends Group { } create() { if (this.device) { + let fill = 'rgba(0,255,255,0.6)'; + if (this.device._type === 'Psd') { + fill = 'rgba(255,0,0,0.6)'; + } const rect = this.device.getBoundingRect(); this.lineBorder = new Rect({ zlevel: this.device.zlevel, z: this.device.z + 1, shape: rect, style: { - fill: 'rgba(204,255,255,0.5)' + fill: fill } }); this.add(this.lineBorder); diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 67b80ae24..82b85c4b0 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -27,8 +27,8 @@ export default { ], SignalLeftOrRightList: [ - { label: '左侧', value: '0' }, - { label: '右侧', value: '1' } + { label: '左侧', value: 'L' }, + { label: '右侧', value: 'R' } ], roleList: [ diff --git a/src/views/newMap/newMapdraft/dataRelation/index.vue b/src/views/newMap/newMapdraft/dataRelation/index.vue index d5361bdd6..b419ceb79 100644 --- a/src/views/newMap/newMapdraft/dataRelation/index.vue +++ b/src/views/newMap/newMapdraft/dataRelation/index.vue @@ -109,7 +109,8 @@ export default { }, data() { return { - enabledTab: 'route' + enabledTab: 'route', + oldDevice: null }; }, mounted() { @@ -172,6 +173,7 @@ export default { this.enabledTab = data.name; }, setSelected(selected) { + this.handleHightLight(selected); switch (this.enabledTab) { case 'protect': this.$refs.protectOperate.setSelected(selected); @@ -201,6 +203,31 @@ export default { }, drawMap() { this.$emit('selectView', 'draft'); + }, + handleHightLight(selected) { + if (this.oldDevice && (this.oldDevice._type === 'Section' || this.oldDevice._type === 'Psd') && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') { + if (this.isSwitchSection) { + if (this.oldDevice._type == 'Section' && this.oldDevice.type == '04') { + this.oldDevice.relevanceSectionList.forEach(item => { + const sectionModel = this.$store.getters['map/getDeviceByCode'](item); + sectionModel.instance.drawSelected(false); + }); + this.isSwitchSection = false; + } + } + this.oldDevice.instance.drawSelected(false); + } + if (selected && (selected._type === 'Section' || selected._type === 'Psd') && selected.instance && typeof selected.instance.drawSelected === 'function' ) { + if (selected._type == 'Section' && selected.type == '04') { + this.isSwitchSection = true; + selected.relevanceSectionList.forEach(item => { + const sectionModel = this.$store.getters['map/getDeviceByCode'](item); + sectionModel.instance.drawSelected(true); + }); + } + selected.instance.drawSelected(true); + } + this.oldDevice = selected; } } }; diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue index a818207d8..649a69ecf 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue @@ -5,9 +5,9 @@ - + - + @@ -177,6 +177,10 @@ :value="item.code" /> + {{ $t('map.activate') }} @@ -258,6 +262,7 @@ export default { routeCode: '', routeType: '', loading: false, + interBlockStationList:[], SwitchLocateTypeList: [ { name: '定位', code: true }, { name: '反位', code: false } @@ -361,6 +366,9 @@ export default { // this.$Dictionary.normal().then(list => { // this.SwitchLocateTypeList = list; // }); + this.interBlockStationList = this.stationList.filter(station=>{ + return station.isCIStation; + }); }, methods: { swictchName(code) { @@ -468,6 +476,8 @@ export default { this.routeCode = selected.code; } else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeFlankProtectionList'.toUpperCase()) { this.flankCode = selected.code; + } else if (selected._type.toUpperCase() === 'Psd'.toUpperCase() && this.field.toUpperCase() === 'routePsdList'.toUpperCase()) { + this.addModel.psdList.push(selected.code); } } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue index 4321f4097..feecf224a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue @@ -17,21 +17,6 @@
- - - - - {{ $t('map.activate') }} - { @@ -253,8 +221,7 @@ export default { name: `Psd${this.psdList.length + 1}`, width: this.addModel.width, height: this.addModel.height, - standCode: this.addModel.standCode, // 关联站台唯一code - standTrackCode: this.addModel.standTrackCode // 关联站台轨编码 + standCode: this.addModel.standCode // 关联站台唯一code }; this.stationStandList.forEach(elem => { if (elem.code === this.addModel.standCode) { diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 00dcc2aae..82693258b 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -133,11 +133,11 @@ - + {{ $t('map.split') }} @@ -253,10 +253,9 @@ export default { stationCode: '', logicSectionNameSort: '', sepTypeLeft: '', - offsetLeft: 0, sepTypeRight: '', offsetRight: 0, - trainPosType: '', // 列车所在方向 + // trainPosType: '', // 列车所在方向 parentCode: '', points: [], lengthFact: 0, @@ -264,13 +263,15 @@ export default { leftSectionCode: '', rightSectionCode: '', trainWindowCode: '', - relevanceSectionList: [] + relevanceSectionList: [], + lSectionEndOffset: {x:0, y:0}, + lSectionStartOffset: {x:0, y:0} }, oldPoint: [], // 区段未修改前 坐标 addModel: { code: '', splitNumber: 2, - trainPosType: '01', // 列车所在方向 + // trainPosType: '01', // 列车所在方向 splitOffsetMax: 15 }, operationModel: { // 区段集中站列表 @@ -282,7 +283,6 @@ export default { rsectioncode: '' }, logicSectionNums: [1], - fieldS: '', field: '', addRules: { code: [ @@ -290,10 +290,10 @@ export default { ], splitNumber: [ { required: true, message: this.$t('rules.pleaseEnterSplit'), trigger: 'blur' } - ], - trainPosType: [ - { required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' } ] + // trainPosType: [ + // { required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' } + // ] }, mergeRules: { lsectioncode: [ @@ -387,7 +387,14 @@ export default { { prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType }, { prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType }, { prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, pointDisabled: this.isStationCodeDisabled, addPoint: this.addPoint, delPoint: this.delPoint, lastDisabled: true }, - + { prop: 'lSectionStartOffset', label: '逻辑区段起点偏移:', type: 'coordinate', width: '150px', isHidden: !this.isLSectionOffsetShow, children: [ + { prop: 'lSectionStartOffset.x', firstLevel: 'lSectionStartOffset', secondLevel: 'x', label: 'x', type: 'number', labelWidth: '25px'}, + { prop: 'lSectionStartOffset.y', firstLevel: 'lSectionStartOffset', secondLevel: 'y', label: 'y', type: 'number', labelWidth: '25px'} + ]}, + { prop: 'lSectionEndOffset', label: '逻辑区段终点偏移:', type: 'coordinate', width: '150px', isHidden: !this.isLSectionOffsetShow, children:[ + {prop: 'lSectionEndOffset.x', firstLevel: 'lSectionEndOffset', secondLevel: 'x', label: 'x', type: 'number', labelWidth: '25px'}, + {prop: 'lSectionEndOffset.y', firstLevel: 'lSectionEndOffset', secondLevel: 'y', label: 'y', type: 'number', labelWidth: '25px'} + ]}, { prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1 { prop: 'standTrackName', label: this.$t('map.standTrackName'), type: 'input', isHidden: !this.isstandTrackNameShow }, @@ -395,8 +402,6 @@ export default { { prop: 'standTrackNamePosition.x', firstLevel: 'standTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px'}, { prop: 'standTrackNamePosition.y', firstLevel: 'standTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px'} ] }, - { prop: 'relStandCode', label: this.$t('map.relStandCode'), type: 'selectHover', optionLabel: 'code&&name', optionValue: 'code', options: this.stationStandList, hover: this.hover, buttonType: 'relStandCode', buttonShowType: this.isButtonType, isHidden: !this.isrelStandCode }, - { prop: 'isReentryTrack', label: this.$t('map.isReentryTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1 { prop: 'reentryTrackName', label: this.$t('map.reentryTrackName'), type: 'input', isHidden: !this.isreentryTrackName }, @@ -444,8 +449,8 @@ export default { { prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset }, { prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow }, { prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') }, - { prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') }, - { prop: 'trainPosType', label: this.$t('map.trainDirection'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.TrainPositionTypeList } + { prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') } + // { prop: 'trainPosType', label: this.$t('map.trainDirection'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.TrainPositionTypeList } ] } } @@ -453,22 +458,22 @@ export default { return form; }, rules() { - var validateLeftSection = (rule, value, callback) => { - const leftSection = value ? this.$store.getters['map/getDeviceByCode'](value) : null; - if (leftSection && !(this.checkPointsCoincide(leftSection.points[leftSection.points.length - 1], this.editModel.points[0].x) || this.checkPointsCoincide(leftSection.points[leftSection.points.length - 1], this.oldPoint[0]) )) { - callback(new Error(this.$t('rules.theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent'))); - } else { - callback(); - } - }; - var validateRightSection = (rule, value, callback) => { - const rightSection = value ? this.$store.getters['map/getDeviceByCode'](value) : null; - if (rightSection && !(this.checkPointsCoincide(rightSection.points[0], this.editModel.points[this.editModel.points.length - 1]) || this.checkPointsCoincide(rightSection.points[0], this.oldPoint[this.oldPoint.length - 1]))) { - callback(new Error(this.$t('rules.theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent'))); - } else { - callback(); - } - }; + // var validateLeftSection = (rule, value, callback) => { + // const leftSection = value ? this.$store.getters['map/getDeviceByCode'](value) : null; + // if (leftSection && !(this.checkPointsCoincide(leftSection.points[leftSection.points.length - 1], this.editModel.points[0].x) || this.checkPointsCoincide(leftSection.points[leftSection.points.length - 1], this.oldPoint[0]) )) { + // callback(new Error(this.$t('rules.theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent'))); + // } else { + // callback(); + // } + // }; + // var validateRightSection = (rule, value, callback) => { + // const rightSection = value ? this.$store.getters['map/getDeviceByCode'](value) : null; + // if (rightSection && !(this.checkPointsCoincide(rightSection.points[0], this.editModel.points[this.editModel.points.length - 1]) || this.checkPointsCoincide(rightSection.points[0], this.oldPoint[this.oldPoint.length - 1]))) { + // callback(new Error(this.$t('rules.theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent'))); + // } else { + // callback(); + // } + // }; const rules = { code: [ { required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' } @@ -479,9 +484,6 @@ export default { type: [ { required: true, message: this.$t('rules.pleaseEnterSectionType'), trigger: 'blur' } ], - relStandCode: [ - { required: true, message: this.$t('rules.pleaseSelectAssociatedPlatform'), trigger: 'change' } - ], leftStopPointOffset: [ { required: true, message: this.$t('rules.pleaseEnterLeftStopPointOffset'), trigger: 'blur' } ], @@ -514,13 +516,13 @@ export default { ], relSwitchCode: [ { required: true, message: this.$t('rules.sectionRelSwitchCode'), trigger: 'change' } - ], - leftSectionCode: [ - { validator: validateLeftSection, trigger: 'change' } - ], - rightSectionCode: [ - { validator: validateRightSection, trigger: 'change'} ] + // leftSectionCode: [ + // { validator: validateLeftSection, trigger: 'change' } + // ], + // rightSectionCode: [ + // { validator: validateRightSection, trigger: 'change'} + // ] }; return rules; }, @@ -579,13 +581,6 @@ export default { isStopPointOffset() { return this.editModel.type !== '04' && (this.editModel.isReentryTrack || this.editModel.isStandTrack || this.editModel.isTransferTrack); }, - - isButtonType() { - return this.fieldS == 'relStandCode'; - }, - isrelStandCode() { - return this.editModel.type !== '04' && this.editModel.isStandTrack && this.editModel.type == '01'; - }, isRelSwitchCode() { return this.editModel.type !== '04' && this.editModel.isSwitchSection; }, @@ -621,6 +616,9 @@ export default { }, hasAssociatedSection() { return this.editModel.type === '01' || this.editModel.type === '03'; + }, + isLSectionOffsetShow() { + return this.editModel.type === '02'; } }, watch: { @@ -647,90 +645,76 @@ export default { }, deviceSelect(selected) { const obj = this; - if (!this.fieldS) { // 判断是否激活选择站台 - if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { - if (this.field === 'leftSection') { - if (selected.type === '01' || selected.type === '03') { - this.editModel.leftSectionCode = selected.code; - this.activeName = 'first'; - this.field = ''; - this.$emit('fieldSelect', ''); - } - return; - } else if (this.field === 'rightSection') { - if ((selected.type === '01' || selected.type === '03')) { - this.editModel.rightSectionCode = selected.code; - this.activeName = 'first'; - this.field = ''; - this.$emit('fieldSelect', ''); - } - return; - } - this.$refs.dataform.resetFields(); - this.editModel.points = []; - this.activeName = 'first'; - this.editModel = deepAssign(this.editModel, selected); - this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0]; - this.editModel.isSegmentation = selected.isSegmentation || false; - this.editModel.points = JSON.parse(JSON.stringify(selected.points)); - this.oldPoint = JSON.parse(JSON.stringify(selected.points)); - this.oldLeftSectionCode = selected.leftSectionCode; - this.oldRightSectionCode = selected.rightSectionCode; - this.editModel.lengthFact = selected.lengthFact || 0; - - this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz); - this.addModel.splitOffset = this.addModel.splitOffsetMax / 2; - - obj.$refs.logicBlock.computedLogicSectionNumList(this.editModel.logicSectionNum); - - if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) { - this.addModel.code = selected.code; - this.activeName = 'three'; - this.field = ''; - this.$emit('fieldSelect', ''); - } else if (this.field.toUpperCase() === 'leftSectionCode'.toUpperCase()) { - this.mergeModel.lsectioncode = selected.code; - this.activeName = 'three'; - this.field = ''; - this.$emit('fieldSelect', ''); - } else if (this.field.toUpperCase() === 'rightSectionCode'.toUpperCase()) { - this.mergeModel.rsectioncode = selected.code; - this.activeName = 'three'; - this.field = ''; - this.$emit('fieldSelect', ''); - } else if (this.field.toUpperCase() === 'getSectionStart'.toUpperCase()) { - this.createModel.leftSectionCode = selected.code; - this.activeName = 'second'; - this.field = ''; - this.$emit('fieldSelect', ''); - } else if (this.field.toUpperCase() === 'getSectionEnd'.toUpperCase()) { - this.createModel.rightSectionCode = selected.code; - this.activeName = 'second'; + // 判断是否激活选择站台 + if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { + if (this.field === 'leftSection') { + if (selected.type === '01' || selected.type === '03') { + this.editModel.leftSectionCode = selected.code; + this.activeName = 'first'; this.field = ''; this.$emit('fieldSelect', ''); } + return; + } else if (this.field === 'rightSection') { + if ((selected.type === '01' || selected.type === '03')) { + this.editModel.rightSectionCode = selected.code; + this.activeName = 'first'; + this.field = ''; + this.$emit('fieldSelect', ''); + } + return; + } + this.$refs.dataform.resetFields(); + this.editModel.points = []; + this.activeName = 'first'; + this.editModel = deepAssign(this.editModel, selected); + this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0]; + this.editModel.isSegmentation = selected.isSegmentation || false; + this.editModel.points = JSON.parse(JSON.stringify(selected.points)); + this.oldPoint = JSON.parse(JSON.stringify(selected.points)); + this.oldLeftSectionCode = selected.leftSectionCode; + this.oldRightSectionCode = selected.rightSectionCode; + this.editModel.lengthFact = selected.lengthFact || 0; + this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz); + this.addModel.splitOffset = this.addModel.splitOffsetMax / 2; + this.setLSectionOffsetByPoint(this.editModel); + + obj.$refs.logicBlock.computedLogicSectionNumList(this.editModel.logicSectionNum); + + if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) { + this.addModel.code = selected.code; + this.activeName = 'three'; + this.field = ''; + this.$emit('fieldSelect', ''); + } else if (this.field.toUpperCase() === 'leftSectionCode'.toUpperCase()) { + this.mergeModel.lsectioncode = selected.code; + this.activeName = 'three'; + this.field = ''; + this.$emit('fieldSelect', ''); + } else if (this.field.toUpperCase() === 'rightSectionCode'.toUpperCase()) { + this.mergeModel.rsectioncode = selected.code; + this.activeName = 'three'; + this.field = ''; + this.$emit('fieldSelect', ''); + } else if (this.field.toUpperCase() === 'getSectionStart'.toUpperCase()) { + this.createModel.leftSectionCode = selected.code; + this.activeName = 'second'; + this.field = ''; + this.$emit('fieldSelect', ''); + } else if (this.field.toUpperCase() === 'getSectionEnd'.toUpperCase()) { + this.createModel.rightSectionCode = selected.code; + this.activeName = 'second'; + this.field = ''; + this.$emit('fieldSelect', ''); } - } else { - this.editModel.relStandCode = selected.code; - this.selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); - this.fieldS = ''; - this.$emit('fieldSelect', ''); } }, handleClick(tab, event) { - if (tab.name != 'first') { - this.fieldS = ''; - } this.questionList = []; }, hover(field) { - if (field == 'relStandCode') { - this.fieldS = field == this.fieldS ? '' : field; - this.$emit('fieldSelect', this.fieldS); - } else { - this.field = field == this.field ? '' : field; - this.$emit('fieldSelect', this.field); - } + this.field = field == this.field ? '' : field; + this.$emit('fieldSelect', this.field); }, addPoint(index) { const data = { x: 0, y: 0 }; @@ -781,9 +765,8 @@ export default { logicSectionShow: true, logicSectionNameSort: true, sepTypeLeft: '01', // 分隔符类型 - offsetLeft: 0, sepTypeRight: '01', - trainPosType: '', // 默认不填写 列车所在方向 + // trainPosType: '', // 默认不填写 列车所在方向 lengthFact: 0, parentCode: '', relStandCode: '', @@ -911,12 +894,13 @@ export default { return; } let models = []; + this.setPointByLSectionOffset(this.editModel); const model = deepAssign(this.editModel, {_type: 'Section'}); // 修改元素model model.leftStopPointOffset = Number(model.leftStopPointOffset); model.rightStopPointOffset = Number(model.rightStopPointOffset); - this.fieldS = ''; const changeSectionList = this.handleOtherSectionChange(model); models = [model, ...changeSectionList]; + this.$emit('updateMapModel', models); this.oldPoint = JSON.parse(JSON.stringify(model.points)); this.oldLeftSectionCode = model.leftSectionCode; @@ -932,36 +916,54 @@ export default { if (section.parentCode === model.code) { const copySection = deepAssign({}, section); copySection.logicSectionShow = model.logicSectionShow; - copySection.trainPosType = model.trainPosType; + // copySection.trainPosType = model.trainPosType; models.push(copySection); - } - if (model.code !== section.code && (section.type === '01' || section.typel === '03')) { + } else if ( model.code !== section.code && section.type === '02' && model.type === '02' && section.parentCode === model.parentCode) { const copySection = deepAssign({}, section); if (this.checkPointsCoincide(this.oldPoint[0], section.points[section.points.length - 1])) { copySection.points[copySection.points.length - 1].x = model.points[0].x; copySection.points[copySection.points.length - 1].y = model.points[0].y; - copySection.offsetRight = model.offsetLeft; } if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], section.points[0])) { copySection.points[0].x = model.points[model.points.length - 1].x; copySection.points[0].y = model.points[model.points.length - 1].y; - copySection.offsetLeft = model.offsetRight; + } + models.push(copySection); + } else if (model.code !== section.code && (section.type === '01' || section.type === '03')) { + const copySection = deepAssign({}, section); + let updataFlag = false; + if (this.checkPointsCoincide(this.oldPoint[0], section.points[section.points.length - 1])) { + copySection.points[copySection.points.length - 1].x = model.points[0].x; + copySection.points[copySection.points.length - 1].y = model.points[0].y; + updataFlag = true; + } + if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], section.points[0])) { + copySection.points[0].x = model.points[model.points.length - 1].x; + copySection.points[0].y = model.points[model.points.length - 1].y; + updataFlag = true; } if (model.leftSectionCode !== this.oldLeftSectionCode) { if (copySection.code === model.leftSectionCode) { copySection.rightSectionCode = model.code; + updataFlag = true; } else if (copySection.code === this.oldLeftSectionCode) { copySection.rightSectionCode = ''; + updataFlag = true; } } if (model.rightSectionCode !== this.oldRightSectionCode) { if (copySection.code === model.rightSectionCode) { copySection.leftSectionCode = model.code; + updataFlag = true; } else if (copySection.code === this.oldRightSectionCode) { copySection.leftSectionCode = ''; + updataFlag = true; + } } - models.push(copySection); + if (updataFlag) { + models.push(copySection); + } } }); return models; @@ -1048,10 +1050,9 @@ export default { logicSectionNum: selected.logicSectionNum, logicSectionShow: selected.logicSectionShow, sepTypeLeft: index == 0 ? selected.sepTypeLeft : '01', // 左侧分隔符类型 (起始左侧按原来区段类型走 其余 默认 01) - offsetLeft: selected.offsetLeft, sepTypeRight: index == this.addModel.splitNumber ? selected.sepTypeRight : '01', // 右侧分隔符类型 (终点右侧按原来区段类型走 其余 默认 01) offsetRight: selected.offsetRight, - trainPosType: this.addModel.trainPosType, + // trainPosType: this.addModel.trainPosType, isCurve: selected.isCurve, lengthFact: 0, points: [ @@ -1154,11 +1155,9 @@ export default { model.axleShow = lsection.axleShow; model.logicSectionNum = lsection.logicSectionNum; model.logicSectionShow = lsection.logicSectionShow; - model.trainPosType = lsection.trainPosType; + // model.trainPosType = lsection.trainPosType; model.sepTypeLeft = lsection.sepTypeLeft; - model.offsetLeft = lsection.offsetLeft; model.sepTypeRight = rsection.sepTypeRight; - model.offsetRight = lsection.offsetRight + rsection.offsetRight; model.isCurve = lsection.isCurve; model.points = [ { x: lsection.points[0].x, y: lsection.points[0].y }, @@ -1186,7 +1185,7 @@ export default { model.axleShow = rsection.axleShow; model.logicSectionNum = rsection.logicSectionNum; model.logicSectionShow = rsection.logicSectionShow; - model.trainPosType = rsection.trainPosType; + // model.trainPosType = rsection.trainPosType; model.sepTypeLeft = rsection.sepTypeLeft; model.offsetLeft = rsection.offsetLeft; model.sepTypeRight = lsection.sepTypeRight; @@ -1231,6 +1230,32 @@ export default { return point1.x === point2.x && point1.y === point2.y; } return false; + }, + setLSectionOffsetByPoint(model) { + if (model.type === '02') { + const parentSection = this.$store.getters['map/getDeviceByCode'](model.parentCode); + model.lSectionStartOffset = { + x: model.points[0].x - parentSection.points[0].x, + y: model.points[0].y - parentSection.points[0].y + }; + model.lSectionEndOffset = { + x: model.points[1].x - parentSection.points[0].x, + y: model.points[1].y - parentSection.points[0].y + }; + } + }, + setPointByLSectionOffset(model) { + if (model.type === '02') { + const parentSection = this.$store.getters['map/getDeviceByCode'](model.parentCode); + model.points[0] = { + x: parentSection.points[0].x + model.lSectionStartOffset.x, + y: parentSection.points[0].y + model.lSectionStartOffset.y + }; + model.points[1] = { + x: parentSection.points[0].x + model.lSectionEndOffset.x, + y: parentSection.points[0].y + model.lSectionEndOffset.y + }; + } } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/create.vue b/src/views/newMap/newMapdraft/mapoperate/signal/create.vue index d5d457227..5ba3d58d0 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/create.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/create.vue @@ -62,7 +62,7 @@ { + return station.centralized; + }); + return list; } }, mounted() { @@ -171,6 +179,7 @@ export default { sectionCode: this.addModel.sectionCode, positionType: this.addModel.positionType, directionShowType: this.addModel.directionShowType, + // leftOrRight: this.addModel.leftOrRight, nameShow: true, namePosition: { x: 0, y: 0 }, buttonShow: true, @@ -184,7 +193,7 @@ export default { this.sectionList.forEach(elem => { if (elem.code === this.addModel.sectionCode) { - if (this.addModel.leftOrRight === '0') { + if (this.addModel.leftOrRight === 'L') { const beg = elem.points[0]; const end = elem.points[0 + 1]; const traingle = new JTriangle(beg, end); diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index 421419e4b..6f3d11ac2 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -16,6 +16,19 @@ + +
+ 构建信号机偏移量 + {{ $t('map.clearHint') }} +
+
+ + +
{{ item }}
+
+
+
+
@@ -56,6 +69,7 @@ export default { { code: '00', name: this.$t('map.normal') }, { code: '01', name: this.$t('map.signalFilamentAlarm') } ], + questionList: [], field:'', editModel: { code: '', @@ -65,6 +79,7 @@ export default { lampPostType: '', lampPositionType: '', potLampType: '01', + leftOrRight: 'L', directionShowType: '', positionType: '', namePosition: { x: 0, y: 0 }, @@ -105,6 +120,13 @@ export default { } return list; }, + centralizedStationList() { + let list = []; + list = this.stationList.filter(station=>{ + return station.centralized; + }); + return list; + }, form() { return { labelWidth: '150px', @@ -146,11 +168,11 @@ export default { map: { name: this.$t('map.mapData'), item: [ - { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList }, + { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }, { prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' }, { prop: 'useType', label: this.$t('map.signalUseType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList }, { prop: 'potLampType', label: this.$t('map.potLampType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPotLampTypeList }, - { prop: 'sectionCode', label: this.$t('map.belongsSection'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList, disabled: true }, + { prop: 'sectionCode', label: this.$t('map.belongsSection'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList }, { prop: 'offset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') } ] @@ -227,7 +249,6 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - // this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() != 'selectSingalCode'.toUpperCase()) { this.$refs.dataform.resetFields(); this.activeName = 'first'; @@ -278,6 +299,46 @@ export default { _that.$message.info(this.$t('tip.cancelledDelete')); }); } + }, + // 构建信号机偏移量 + editAll() { + const models = []; + this.questionList = []; + this.signalList.forEach(item => { + const signalModel = deepAssign({}, item); + const section = this.findSection(signalModel); + if (section.code && item.sectionCode != section.code) { + item.sectionCode = section.code; + } + if (!section.code) { + this.questionList.push(`${item.name} 信号机位置可能不正确,请手动调试归属区段及偏移量.`); + } + signalModel.offset = 2; + if (signalModel.directionShowType == '02') { + if (section.lengthFact) { + signalModel.offset = Math.abs(Number(section.lengthFact) - 2); + } + } + models.push(signalModel); + }); + this.$emit('updateMapModel', models); + }, + // 寻找信号机关联区段 + findSection(signal) { + // 01 向左 02 向右 + let model = {}; + this.sectionList.forEach(section => { + if (signal.directionShowType == '01' && section.type != '02') { + if (section.points[0].x == signal.position.x && Math.abs(section.points[0].y - signal.position.y) <= 20) { + model = section; + } + } else if (signal.directionShowType == '02' && section.type != '02') { + if (section.points[section.points.length - 1].x == signal.position.x && Math.abs(section.points[section.points.length - 1].y - signal.position.y) <= 20) { + model = section; + } + } + }); + return model; } } }; @@ -288,6 +349,24 @@ export default { height: 100%; } + .flex_box{ + display: flex; + justify-content: center; + } + + .box-card { + width: calc(100% - 80px); + margin: 20px auto 0; + padding: 0 20px; + .text { + font-size: 14px; + } + + .item { + padding: 6px 0; + } + } + .card { height: 100%; } diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index 82bf1c5ff..9edcf70aa 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -95,7 +95,9 @@ export default { chargeStation:[], editModel: { centralized: false, - concentrateStationCode: '', + concentrateStationCode: '', // 所属集中站 + isCIStation:false, // 是否联锁站 + number:'', // 编号 code: '', zcCode: '', visible: true, @@ -103,6 +105,11 @@ export default { name: '', nameFont: '', nameFontColor: '#FFFFFF', + subheadDisplay:false, + subhead:'', // 副标题 + subheadFont:'', + subheadFontColor:'#FFFFFF', + subheadPosition:{ x: 0, y: 0 }, kmPostShow: '', kmRange: 0, kmPost: '', @@ -151,6 +158,7 @@ export default { item: [ { prop: 'code', label: this.$t('map.stationCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, change: true, deviceChange: this.deviceChange }, { prop: 'name', label: this.$t('map.stationName'), type: 'input' }, + { prop: 'number', label: this.$t('map.stationNumber'), type: 'input' }, { prop: 'position', label: this.$t('map.stationPosition'), type: 'coordinate', width: '120px', children: [ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' } @@ -158,6 +166,14 @@ export default { { prop: 'visible', label: this.$t('map.stationstandShowName'), type: 'checkbox' }, { prop: 'nameFont', label: this.$t('map.stationNameFont'), type: 'font', placeholder: this.$t('tip.stationFont') }, { prop: 'nameFontColor', label: this.$t('map.stationNameFontColor'), type: 'color' }, + { prop: 'subheadDisplay', label: this.$t('map.subheadDisplay'), type: 'checkbox' }, + { prop: 'subhead', label: this.$t('map.subhead'), type: 'input', isHidden:!this.editModel.subheadDisplay }, + { prop: 'subheadFont', label: this.$t('map.subheadFont'), type: 'font', isHidden:!this.editModel.subheadDisplay }, + { prop: 'subheadFontColor', label: this.$t('map.subheadFontColor'), type: 'color', isHidden:!this.editModel.subheadDisplay }, + { prop: 'subheadPosition', label: this.$t('map.subheadPosition'), type: 'coordinate', width: '120px', isHidden:!this.editModel.subheadDisplay, children: [ + { prop: 'subheadPosition.x', firstLevel: 'subheadPosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, + { prop: 'subheadPosition.y', firstLevel: 'subheadPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' } + ] }, { prop: 'kilometerPosition', label: '公里标偏移坐标:', type: 'coordinate', width: '120px', children: [ { prop: 'kilometerPosition.x', firstLevel: 'kilometerPosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'kilometerPosition.y', firstLevel: 'kilometerPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' } @@ -181,7 +197,7 @@ export default { map: { name: this.$t('map.mapData'), item: [ - { prop: 'concentrateStationCode', label: this.$t('map.concentrateStationCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationList, disabled:this.editModel.controlled }, + { prop: 'isCIStation', label: this.$t('map.isCIStation'), type: 'checkbox'}, { prop: 'centralized', label: this.$t('map.centralized'), type: 'checkbox', disabled:this.editModel.controlled, change:true, deviceChange:this.changeCentralized }, { prop: 'zcCode', label: this.$t('map.zcCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.zcList, isHidden: !this.isZcCode }, { prop: 'chargeStationCodeList', label: this.$t('map.chargeStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.chargeStation, isHidden: !this.isZcCode, deviceChange:this.changeChargeStation}, @@ -339,6 +355,8 @@ export default { _type: 'Station', code: uid, name: item.stationName, + number:'', + subheadDisplay:false, zcCode: '', runPlanName: '', visible: true, diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index b21ad8dc6..1cbe0c94a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -17,23 +17,6 @@
-
@@ -73,6 +56,10 @@ export default { { code: '01', name: '朝下' }, { code: '02', name: '朝上' } */ + isRightList: [ + { code: 'right', name: '向右'}, + { code: 'left', name: '向左'} + ], editModel: { code: '', name: '', @@ -83,7 +70,10 @@ export default { height: 0, stationCode: '', // 所属车站 position: { x: 0, y: 0 }, - visible: true // 是否显示 + visible: true, // 是否显示 + isRight: 'right', + standTrackCode: '', + small: false // direction: '' // 上下行方向 }, field: '', @@ -93,11 +83,12 @@ export default { pointY: 0, // y坐标 width: 60, height: 20, - doorType: '01', // 屏蔽门类型 standTrackCode: '', // 关联站台轨 standTrackUpCode: '', // 上行站台轨 standTrackDownCode: '', // 下行站台轨 - stationstandDirection: '02' // 屏蔽门方向 + stationstandDirection: '02', // 屏蔽门方向 + isRight: 'right', + small: false } }; }, @@ -127,7 +118,10 @@ export default { ] }, { prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' }, { prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' }, - { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' } + { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' }, + { prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'editSectionSelectCode', buttonShowType: this.isButtonTypeES }, + { prop: 'isRight', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList }, + { prop: 'small', label: '是否小型站台:', type: 'checkbox' } ] }, map: { @@ -163,6 +157,9 @@ export default { ], 'position.y': [ { required: true, message: this.$t('rules.trainPositionY'), trigger: 'change' } + ], + standTrackCode: [ + { required: true, message: '请选择关联站台轨', trigger: 'change' } ] }; // 清空表单验证提示信息 @@ -183,20 +180,16 @@ export default { { prop: 'stationCode', label: this.$t('map.stationstandName'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, hover: this.hover, buttonType: 'standSelectStationCode', buttonShowType: this.isButtonType }, { prop: 'pointY', label: 'Y 坐标:', type: 'number' }, { prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' }, - { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' } + { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' }, + { prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS }, + { prop: 'isRight', label: '行驶方向:', type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.isRightList }, + { prop: 'small', label: '是否小型站台:', type: 'checkbox' } ] }, door: { name: '屏蔽门数据', item: [ - { prop: 'doorType', label: '屏蔽门类型:', type: 'radio', radioList: [ - {value: '01', label: '单侧屏蔽门' }, - {value: '02', label: '双侧屏蔽门' } - ] }, - { prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS, isHidden: !this.doorTypeOne }, - { prop: 'stationstandDirection', label: '屏蔽门朝向:', type: 'radio', radioList: this.DoorLocationTypeList, isHidden: !this.doorTypeOne }, - { prop: 'standTrackUpCode', label: '上行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectUpCode', buttonShowType: this.isButtonTypeU, isHidden: !this.doorTypeTwo }, - { prop: 'standTrackDownCode', label: '下行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectDownCode', buttonShowType: this.isButtonTypeD, isHidden: !this.doorTypeTwo } + { prop: 'stationstandDirection', label: '屏蔽门朝向:', type: 'radio', radioList: this.DoorLocationTypeList } ] } } @@ -218,12 +211,6 @@ export default { ], standTrackCode: [ { required: true, message: '请选择关联站台轨', trigger: 'change' } - ], - standTrackUpCode: [ - { required: true, message: '请选择站台轨', trigger: 'change' } - ], - standTrackDownCode: [ - { required: true, message: '请选择站台轨', trigger: 'change' } ] }; }, @@ -233,17 +220,8 @@ export default { isButtonTypeS() { return this.field == 'sectionSelectCode'; }, - isButtonTypeU() { - return this.field == 'sectionSelectUpCode'; - }, - isButtonTypeD() { - return this.field == 'sectionSelectDownCode'; - }, - doorTypeOne() { - return this.addModel.doorType == '01'; - }, - doorTypeTwo() { - return this.addModel.doorType == '02'; + isButtonTypeES() { + return this.field === 'editSectionSelectCode'; }, PhysicalSectionList() { let list = []; @@ -295,6 +273,7 @@ export default { this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); + this.editModel.isRight = selected.isRight ? 'right' : 'left'; } if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'standSelectStationCode'.toUpperCase()) { this.addModel.stationCode = selected.code; @@ -306,14 +285,9 @@ export default { this.activeName = 'second'; this.field = ''; this.$emit('standStationCode', ''); - } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectUpCode'.toUpperCase()) { - this.addModel.standTrackUpCode = selected.code; - this.activeName = 'second'; - this.field = ''; - this.$emit('standStationCode', ''); - } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectDownCode'.toUpperCase()) { - this.addModel.standTrackDownCode = selected.code; - this.activeName = 'second'; + } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'editSectionSelectCode'.toUpperCase()) { + this.editModel.standTrackCode = selected.code; + this.activeName = 'first'; this.field = ''; this.$emit('standStationCode', ''); } @@ -335,7 +309,10 @@ export default { position: { x: 0, y: this.addModel.pointY - } + }, + standTrackCode: this.addModel.standTrackCode, + isRight: this.addModel.isRight === 'right', + small: this.addModel.small }; this.stationList.forEach(elem => { if (elem.code == this.addModel.stationCode) { @@ -344,7 +321,7 @@ export default { } }); models.push(model); - if (this.addModel.doorType == '01') { + if (!this.addModel.small) { const uid = getUID('Psd', this.psdList); const param = { _type: 'Psd', @@ -353,7 +330,6 @@ export default { width: this.addModel.width, height: 3, standCode: Standuid, // 关联站台唯一code - standTrackCode: this.addModel.standTrackCode, // 关联站台轨编码 position: { x: models[0].position.x, y: this.addModel.pointY - (this.addModel.height / 2) - space @@ -363,35 +339,6 @@ export default { param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space; } models.push(param); - } else if (this.addModel.doorType == '02') { - const arr = []; - for (let index = 0; index < 2; index++) { - const uid = getUID('Psd', [...this.psdList, ...arr]); - const param = { - _type: 'Psd', - code: uid, - name: `Psd${[...this.psdList, ...arr].length + 1}`, - width: this.addModel.width, - height: 3, - standCode: Standuid, // 关联站台唯一code - standTrackCode: '', // 关联站台轨编码 - position: { - x: models[0].position.x, - y: this.addModel.pointY - } - }; - if (index == 0) { - param.standTrackCode = this.addModel.standTrackUpCode; - param.position.y = this.addModel.pointY - (this.addModel.height / 2) - space; - } else { - param.standTrackCode = this.addModel.standTrackDownCode; - param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space; - } - arr.push(param); - } - arr.forEach(item => { - models.push(item); - }); } this.$emit('updateMapModel', models); } @@ -401,7 +348,9 @@ export default { edit() { this.$refs.dataform.validate((valid) => { if (valid) { + this.editModel.isRight = this.addModel.isRight === 'right'; const data = Object.assign({_type: 'StationStand'}, this.editModel); + console.log(data); this.$emit('updateMapModel', data); } }); diff --git a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue index 973c4278e..f03e7c110 100644 --- a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue @@ -13,7 +13,7 @@
- +
@@ -23,6 +23,43 @@
+ +
+ + + + + + + {{ $t('map.activate') }} + + + + + + + + + + + + +
+
+ + {{ $t('map.updateObj') }} + +
+
@@ -77,6 +114,27 @@ export default { height: [ { required: true, message: this.$t('rules.trainWindowHeight'), trigger: 'blur' } ] + }, + field: '', + addModel: { + pointY: '', + width: '', + height: '', + modelList: [] + }, + mergeRules: { + pointY: [ + { required: true, message: '请输入', trigger: 'blur' } + ], + modelList: [ + { required: true, message: '请选择', trigger: 'change' } + ], + width: [ + { required: true, message: this.$t('rules.trainWindowWidth'), trigger: 'blur' } + ], + height: [ + { required: true, message: this.$t('rules.trainWindowHeight'), trigger: 'blur' } + ] } }; }, @@ -140,11 +198,20 @@ export default { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + hover(field) { + this.field = field == this.field ? '' : field; + }, deviceSelect(selected) { this.$refs.form.resetFields(); if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); + if (this.field == 'trainWindowCode') { + if (this.addModel.modelList.indexOf(selected.code) == -1) { + this.addModel.modelList.push(selected.code); + } + this.activeName = 'three'; + } } }, createModel(opts) { @@ -314,6 +381,22 @@ export default { _that.$message.info(this.$t('tip.cancelledDelete')); }); } + }, + editTrainWindow() { + this.$refs['addForm'].validate((valid) => { + if (valid) { + const models = []; + this.addModel.modelList.forEach(item => { + const model = this.$store.getters['map/getDeviceByCode'](item); + model.point.y = this.addModel.pointY; + model.height = this.addModel.height; + model.width = this.addModel.width; + models.push(model); + }); + this.$emit('updateMapModel', models); + this.addModel.modelList = []; + } + }); } } };