From 509e5218a77db47eb08cc090edf18c765326629b Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 4 Sep 2019 17:58:22 +0800 Subject: [PATCH 01/35] =?UTF-8?q?desc:=20=E8=B0=83=E6=95=B4=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmap/map.js | 1 + .../map/mapdraft/mapedit/mapoperate/link.vue | 17 ++++++- .../mapdraft/mapedit/mapoperate/section.vue | 4 +- .../mapdraft/mapedit/mapoperate/signal.vue | 46 ++++++++++++++++++- .../mapdraft/mapedit/mapoperate/station.vue | 29 +++++++++++- .../mapedit/mapoperate/stationcontrol.vue | 20 +++++++- .../editTool/menus/editPlanName.vue | 2 +- .../editTool/menus/openRunPlan.vue | 26 +++++++---- 8 files changed, 124 insertions(+), 21 deletions(-) diff --git a/src/jmap/map.js b/src/jmap/map.js index fb303e8f1..bff6c1392 100644 --- a/src/jmap/map.js +++ b/src/jmap/map.js @@ -153,6 +153,7 @@ class Jlmap { const type = elem._type; const oDevice = this.mapDevice[code] || deviceFactory(type, elem); const nDevice = Object.assign(oDevice || {}, elem); + console.log(oDevice, nDevice, 111); this.$painter.delete(oDevice); if (!elem._dispose) { this.mapDevice[code] = nDevice; diff --git a/src/views/map/mapdraft/mapedit/mapoperate/link.vue b/src/views/map/mapdraft/mapedit/mapoperate/link.vue index eaf3265f3..fea73fc87 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/link.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/link.vue @@ -439,11 +439,24 @@ export default { edit() { this.$refs['dataform'].validate((valid) => { if (valid) { - const model = Object.assign({_type: 'Link'}, this.editModel); - this.$emit('addOrUpdateMapModel', model); + this.$emit('addOrUpdateMapModel', this.buildEditModel()); } }); }, + buildEditModel() { + const model = { + _type: 'Link', + code: this.editModel.code, + name: this.editModel.name, + color: this.editModel.color == '' ? '#4e8de6' : this.editModel.color, + leftFdCode: this.editModel.leftFdCode, + leftSdCode: this.editModel.leftSdCode, + rightFdCode: this.editModel.rightFdCode, + rightSdCode: this.editModel.rightSdCode, + lengthFact: this.editModel.lengthFact + }; + return model; + }, // 删除对象 deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); diff --git a/src/views/map/mapdraft/mapedit/mapoperate/section.vue b/src/views/map/mapdraft/mapedit/mapoperate/section.vue index 341724227..44db8cd34 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/section.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/section.vue @@ -312,8 +312,6 @@ export default { { prop: 'destinationCodePoint.y', firstLevel: 'destinationCodePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px'} ] }, { prop: 'destinationCodeShow', label: this.$t('map.destinationCodeShow'), type: 'checkbox', isHidden: !this.isdestinationCode }, - { prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset }, - { prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset }, { prop: 'isSwitchSection', label: this.$t('map.isSwitchSection'), type: 'checkbox', isHidden: !this.isSectionType }, { prop: 'relSwitchCode', label: this.$t('map.relSwitchCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange, isHidden: !this.isRelSwitchCode, disabled: true }, @@ -340,6 +338,8 @@ export default { { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList }, { prop: 'offsetLeft', label: this.$t('map.sectionOffsetLeft'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType }, { prop: 'offsetRight', label: this.$t('map.sectionOffsetRight'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType }, + { prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset }, + { 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 }, { prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0 }, diff --git a/src/views/map/mapdraft/mapedit/mapoperate/signal.vue b/src/views/map/mapdraft/mapedit/mapoperate/signal.vue index 031c5d261..5726a7d87 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/signal.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/signal.vue @@ -366,11 +366,53 @@ export default { edit() { this.$refs['dataform'].validate((valid) => { if (valid) { - const model = Object.assign({_type: 'Signal'}, this.editModel); - this.$emit('addOrUpdateMapModel', model); + // const model = Object.assign({_type: 'Signal'}, this.editModel); + // console.log(model.directionType, this.editModel, this.editModel.directionType); + // this.$emit('addOrUpdateMapModel', model); + this.$emit('addOrUpdateMapModel', this.buildEditModel()); } }); }, + buildEditModel() { + // console.log(this.editModel, this.editModel.positionType); + const model = { + _type: 'Signal', + code: this.editModel.code, + name: this.editModel.name, + uniqueName: this.editModel.uniqueName, + useType: this.editModel.useType, + lampPostType: this.editModel.lampPostType, + lampPositionType: this.editModel.lampPositionType, + potLampType: this.editModel.potLampType, + positionType: this.editModel.positionType, + directionType: this.editModel.directionType, + nameShow: this.editModel.nameShow, + buttonShow: this.editModel.buttonShow, + guideShow: this.editModel.guideShow, + offset: this.editModel.offset, + rotate: this.editModel.rotate, + position: { + x: this.editModel.position.x, + y: this.editModel.position.y + }, + namePosition: { + x: this.editModel.namePosition.x, + y: this.editModel.namePosition.y + }, + guidePosition: { + x: this.editModel.guidePosition.x, + y: this.editModel.guidePosition.y + }, + buttonPosition: { + x: this.editModel.buttonPosition.x, + y: this.editModel.buttonPosition.y + }, + stationCode: this.editModel.stationCode, + linkCode: this.editModel.linkCode + }; + console.log(model, this.editModel); + return model; + }, // 删除对象 deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); diff --git a/src/views/map/mapdraft/mapedit/mapoperate/station.vue b/src/views/map/mapdraft/mapedit/mapoperate/station.vue index 8fd641a95..3f9e23865 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/station.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/station.vue @@ -241,11 +241,36 @@ export default { edit() { this.$refs['dataform'].validate((valid) => { if (valid) { - const model = Object.assign({_type: 'Station'}, this.editModel); - this.$emit('addOrUpdateMapModel', model); + this.$emit('addOrUpdateMapModel', this.buildEditModel()); } }); }, + buildEditModel() { + var model = { + _type: 'Station', + code: this.editModel.code, + visible: this.editModel.visible, + runPlanName: this.editModel.runPlanName, + name: this.editModel.name, + zcCode: this.editModel.zcCode, + nameFont: this.editModel.nameFont, + nameFontColor: this.editModel.nameFontColor, + kmPostShow: this.editModel.kmPostShow, + kmRange: this.editModel.kmRange, + kmPost: this.editModel.kmPost, + kmPostFontColor: this.editModel.kmPostFontColor, + kmPostFont: this.editModel.kmPostFont, + isShowControlMode: this.editModel.isShowControlMode, + centralized: this.editModel.centralized, + concentrateStationCode: this.editModel.concentrateStationCode, + position: { + x: this.editModel.position.x, + y: this.editModel.position.y + } + }; + + return model; + }, // 删除对象 deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); diff --git a/src/views/map/mapdraft/mapedit/mapoperate/stationcontrol.vue b/src/views/map/mapdraft/mapedit/mapoperate/stationcontrol.vue index 4a2fa8923..7f502eb49 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/stationcontrol.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/stationcontrol.vue @@ -224,11 +224,27 @@ export default { edit() { this.$refs['dataform'].validate((valid) => { if (valid) { - const model = Object.assign({_type: 'StationControl'}, this.editModel); - this.$emit('addOrUpdateMapModel', model); + this.$emit('addOrUpdateMapModel', this.buildEditModel()); } }); }, + buildEditModel() { + const model = { + _type: 'StationControl', + code: this.editModel.code, + zokContent: this.editModel.zokContent, + zbjkContent: this.editModel.zbjkContent, + zakContent: this.editModel.zakContent, + jjzkContent: this.editModel.jjzkContent, + zzkContent: this.editModel.zzkContent, + stationCode: this.editModel.stationCode, + position: { + x: this.editModel.position.x, + y: this.editModel.position.y + } + }; + return model; + }, // 删除对象 deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); diff --git a/src/views/planMonitor/editTool/menus/editPlanName.vue b/src/views/planMonitor/editTool/menus/editPlanName.vue index e14ae26bc..44b2fbe71 100644 --- a/src/views/planMonitor/editTool/menus/editPlanName.vue +++ b/src/views/planMonitor/editTool/menus/editPlanName.vue @@ -47,7 +47,7 @@ export default { }, computed: { title() { - return '新建运行图'; + return '修改运行图名称'; }, rules() { return { diff --git a/src/views/planMonitor/editTool/menus/openRunPlan.vue b/src/views/planMonitor/editTool/menus/openRunPlan.vue index 2fda864f2..688855d92 100644 --- a/src/views/planMonitor/editTool/menus/openRunPlan.vue +++ b/src/views/planMonitor/editTool/menus/openRunPlan.vue @@ -126,16 +126,22 @@ export default { }, // 删除运行图 handleDelete() { - deleteRunPlan(this.planId).then(Response => { - this.$message.success(`删除成功!`); - if (this.planId === this.$route.query.planId) { - const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId }; - this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); - } - this.doClose(); - }).catch(() => { - this.$messageBox(this.$t('tip.deleteOperationGraphFailed')); - }); + this.$confirm('您确认是否删除此运行图?', this.$t('tip.hint'), { + confirmButtonText: this.$t('tip.confirm'), + cancelButtonText: this.$t('tip.cancel'), + type: 'warning' + }).then(() => { + deleteRunPlan(this.planId).then(Response => { + this.$message.success(`删除成功!`); + if (this.planId === this.$route.query.planId) { + const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId }; + this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); + } + this.doClose(); + }).catch(() => { + this.$messageBox(this.$t('tip.deleteOperationGraphFailed')); + }); + }).catch(() => { }); }, // 修改运行图名称 handleEdit() { From 0f9b0f84a5b3c91e1bf3d7f5660767a884efd7e1 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 4 Sep 2019 18:29:47 +0800 Subject: [PATCH 02/35] =?UTF-8?q?desc:=20=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/map/mapdraft/mapedit/mapoperate/signal.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/views/map/mapdraft/mapedit/mapoperate/signal.vue b/src/views/map/mapdraft/mapedit/mapoperate/signal.vue index 5726a7d87..eb0a1b86f 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/signal.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/signal.vue @@ -366,15 +366,11 @@ export default { edit() { this.$refs['dataform'].validate((valid) => { if (valid) { - // const model = Object.assign({_type: 'Signal'}, this.editModel); - // console.log(model.directionType, this.editModel, this.editModel.directionType); - // this.$emit('addOrUpdateMapModel', model); this.$emit('addOrUpdateMapModel', this.buildEditModel()); } }); }, buildEditModel() { - // console.log(this.editModel, this.editModel.positionType); const model = { _type: 'Signal', code: this.editModel.code, @@ -410,7 +406,6 @@ export default { stationCode: this.editModel.stationCode, linkCode: this.editModel.linkCode }; - console.log(model, this.editModel); return model; }, // 删除对象 From 8df4cfd6e1364285088bce170559970a8a06ceb8 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 4 Sep 2019 18:47:49 +0800 Subject: [PATCH 03/35] =?UTF-8?q?ibp=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ibp/ibpPan.js | 8 +++++ src/ibp/shape/arrow.js | 2 +- src/ibp/shape/utils.js | 11 +++++++ .../ibpDraft/ibpEdit/ibpOperate/ibpArrow.vue | 33 ++++++++++++------- 4 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 src/ibp/shape/utils.js diff --git a/src/ibp/ibpPan.js b/src/ibp/ibpPan.js index 4607bfb9e..a824bf8a1 100644 --- a/src/ibp/ibpPan.js +++ b/src/ibp/ibpPan.js @@ -141,6 +141,14 @@ class IbpPan { (list || []).forEach(elem => { const code = elem.code; const type = elem._type; + if (type === deviceType.Background) { + this.canvasSize = { + x: 0, + y: 0, + width: elem.width, + height: elem.height + }; + } updateIbpData(elem); const oDevice = this.ibpDevice[code] || deviceFactory(type, elem); const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, elem)); diff --git a/src/ibp/shape/arrow.js b/src/ibp/shape/arrow.js index 12185f403..68dd56ca0 100644 --- a/src/ibp/shape/arrow.js +++ b/src/ibp/shape/arrow.js @@ -1,6 +1,6 @@ import Polygon from 'zrender/src/graphic/shape/Polygon'; import Group from 'zrender/src/container/Group'; -import {arrow} from '@/jmap/shape/utils/ShapePoints'; +import {arrow} from './utils'; // import { updateIbpData } from '@/ibp/utils/parser'; import store from '@/store'; diff --git a/src/ibp/shape/utils.js b/src/ibp/shape/utils.js new file mode 100644 index 000000000..ee57950a6 --- /dev/null +++ b/src/ibp/shape/utils.js @@ -0,0 +1,11 @@ +export function arrow(modelX, modelY, length, radius) { + return [ + [modelX, modelY], + [modelX + radius /1.5, modelY - radius/1.5], + [modelX + radius /1.5, modelY - radius/3], + [modelX + length, modelY - radius/3], + [modelX + length, modelY + radius/3], + [modelX + radius /1.5, modelY + radius/3], + [modelX + radius /1.5, modelY + radius/1.5] + ]; +} diff --git a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpArrow.vue b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpArrow.vue index 973336e01..b33d57b19 100644 --- a/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpArrow.vue +++ b/src/views/ibp/ibpDraft/ibpEdit/ibpOperate/ibpArrow.vue @@ -1,6 +1,6 @@