From 6aea2334e66fb4137f62b728f02f05f9506fa38b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 18 Jan 2021 14:10:55 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E4=BA=8C=E5=8F=B7?= =?UTF-8?q?=E7=BA=BF=20=E6=8E=A7=E5=88=B6=E6=A8=A1=E5=BC=8Fnone=20?= =?UTF-8?q?=E8=BD=A6=E7=AB=99=E5=AD=97=E4=BD=93=E9=97=AA=E7=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/haerbin_01.js | 3 ++- src/jmapNew/config/skinCode/nanjing_02.js | 7 ++++-- src/jmapNew/shape/Station/EStationText.js | 10 +++++++- src/jmapNew/shape/Station/index.js | 28 +++++++++++------------ 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index 73b0881ef..10dea3cf8 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -389,7 +389,8 @@ class SkinCode extends defaultStyle { fontWeight:'normal', // 字体粗细 textPadding:[2, 6], // 字体边距 borderColor:'', // 字体边框颜色 - textBorderWidth:1 // 字体边框宽度 + textBorderWidth:1, // 字体边框宽度 + noneModeColor: '#FF0' // 无模式时字体颜色 }, syncCentralizeStation: true, // 集中站和下辖车站控制权状态同步 kmPostShow: true, // 公里标显示 diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index b7eecc54c..8c5e63eb3 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -428,14 +428,17 @@ class SkinCode extends defaultStyle { } }; this[deviceType.Station] = { - // 哈尔滨一号线 车站元素 车站名称 + // 车站元素 车站名称 elemnetType:['stationText'], stationText:{ z:0, fontWeight:'normal', // 字体粗细 textPadding:[2, 6], // 字体边距 borderColor:'', // 字体边框颜色 - textBorderWidth:1 // 字体边框宽度 + textBorderWidth:1, // 字体边框宽度 + noneModeFlash: true, // 无控制权模式字体闪烁 + centerModeColor: '#1fdc1f', // 中控字体颜色 + localModeColor: '#fff'// 站控字体颜色 }, syncCentralizeStation: true, // 集中站和下辖车站控制权状态同步 kmPostShow: true, // 公里标显示 diff --git a/src/jmapNew/shape/Station/EStationText.js b/src/jmapNew/shape/Station/EStationText.js index e9f2377b2..19542d1e4 100644 --- a/src/jmapNew/shape/Station/EStationText.js +++ b/src/jmapNew/shape/Station/EStationText.js @@ -5,6 +5,7 @@ class EStationText extends Group { constructor(model) { super(); this.model = model; + this.style = model.style; this.create(); } @@ -64,7 +65,14 @@ class EStationText extends Group { setState() { } - + setAnimateStyle(noneBeforeMode) { + this.stopAnimate(); + const color = noneBeforeMode === 'Center' ? this.style.Station.stationText.centerModeColor : this.style.Station.stationText.localModeColor; + this.stationName.animateStyle(true).when(500, {textFill: '#000'}).when(1000, {textFill: color}).when(1500, {textFill: '#000'}).start(); + } + stopAnimate() { + this.stationName.stopAnimation(true); + } setColor(color) { const style = this.model.style; if (style.Station.StationControl.disPlayNone) { diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index b222d549d..ac8da8e23 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -26,6 +26,7 @@ export default class Station extends Group { this.z = 40; this.model = model; this.style = style; + this.noneBeforeMode = ''; this.isShowShape = true; this.create(); this.createTurnBack(); // 创建按图折返 @@ -351,6 +352,7 @@ export default class Station extends Group { } handleCenter() { // 中控 + this.noneBeforeMode = 'Center'; this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor); @@ -368,6 +370,7 @@ export default class Station extends Group { } handleLocal() { // 站控 + this.noneBeforeMode = 'Local'; this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor); this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.yellowColor); // 文字颜色 @@ -400,22 +403,14 @@ export default class Station extends Group { } handleNone() { // 空 - // if (this.style.Station.StationControl.disPlayNone) { // 没有控制时显示 黄色 - // this.stationText && this.stationText.setStyle('textFill', '#FFFF00'); - // if (this.model.subheadDisplay) { // 副标题 - // this.subheadText && this.subheadText.setStyle('textFill', '#FFFF00'); - // } - // } - this.stationText.setColor('#FFFF00'); + if (this.style.Station.stationText.noneModeColor) { + this.stationText.setColor(this.style.Station.stationText.noneModeColor); + } + if (this.style.Station.stationText.noneModeFlash) { + this.stationText.setAnimateStyle(this.noneBeforeMode); + } } - // /** 恢复初始状态*/ - // recover() { - // const currentTypeList = this.style.Station.elemnetType; - // currentTypeList.forEach(element => { - // this[element].recover(); - // }); - // } recover() { this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.emergencyControl && this.emergencyControl.setTextColor(this.style.Station.StationControl.text.fontColor); @@ -426,6 +421,7 @@ export default class Station extends Group { this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.stationText && this.stationText.stopAnimate(); } // 设置状态 @@ -433,9 +429,11 @@ export default class Station extends Group { if (!this.isShowShape) return; this.recover(); model.controlMode && this['handle' + model.controlMode](); - if (this.style.Station.syncCentralizeStation && model.controlMode) { + if (this.style.Station.syncCentralizeStation && model.controlMode && model.centralized) { model.chargeStationCodeList.forEach(item => { const device = store.getters['map/getDeviceByCode'](item); + device.controlMode = model.controlMode; + device && device.instance && device.instance.recover(); device && device.instance && device.instance['handle' + model.controlMode](); }); } From 5f3300e889cf0afd9c931aca04d9440f115f4e67 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 18 Jan 2021 15:41:28 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=89=80=E5=B1=9E=E8=BD=A6=E7=AB=99&=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMapdraft/mapoperate/checkboxDraft.vue | 95 ++++++++++++++++--- .../newMapdraft/mapoperate/signal/index.vue | 1 + 2 files changed, 81 insertions(+), 15 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue index b9ff2bb1e..d5f92089e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue @@ -1,7 +1,41 @@ @@ -47,6 +67,9 @@ export default { data() { return { stationCode: '', + belongStationCode: '', + activeName: 'first', + showList: [], modelList: [ { type: 'Section', @@ -63,6 +86,13 @@ export default { name: '信号机列表', list: [] } + ], + modelSignalList: [ + { + type: 'Signal', + name: '信号机列表', + list: [] + } ] }; }, @@ -86,8 +116,16 @@ export default { // this.$emit('setCenter', code); // this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); // }, + handleClick() { + if (this.activeName === 'first') { + this.showList = this.modelList; + } else { + this.showList = this.modelSignalList; + } + }, deviceSelect(selected) { if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) { + this.activeName = 'first'; this.clearModelList(); let count = 0; this.seclectDeviceList.forEach(item => { @@ -99,6 +137,7 @@ export default { this.modelList[1].list.push(item); } else if (item._type == 'Signal') { this.modelList[2].list.push(item); + this.modelSignalList[0].list.push(item); } if (item.stationCode == this.seclectDeviceList[0].stationCode) { count++; @@ -109,12 +148,16 @@ export default { } else { this.stationCode = ''; } + this.belongStationCode = this.stationList[0].code; + this.showList = this.modelList; } }, clearModelList() { + this.showList = []; this.modelList.forEach(item => { item.list = []; }); + this.modelSignalList[0].list = []; }, // 删除当前选中 delList(model, list) { @@ -152,9 +195,24 @@ export default { this.stationCode = ''; } }, + handleBelongStationCode() { + if (this.belongStationCode && this.modelSignalList[0].list.length) { + const models = []; + this.modelSignalList[0].list.forEach(item => { + const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item.code)); + Model.belongStationCode = this.belongStationCode; + models.push(Model); + }); + this.$emit('updateMapModel', models); + this.$message.success('设置所属车站成功!'); + this.belongStationCode = ''; + } + }, clearList() { // 清空数据 this.stationCode = ''; + this.belongStationCode = ''; this.$store.commit('map/setSeclectDeviceList', []); + this.showList = []; this.modelList = [ { type: 'Section', @@ -172,6 +230,13 @@ export default { list: [] } ]; + this.modelSignalList = [ + { + type: 'Signal', + name: '信号机列表', + list: [] + } + ]; }, mouseenter(model) { if (model._type == 'Section') { diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index 3470f9dfd..32ab899ba 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -147,6 +147,7 @@ export default { item: [ { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }, { prop: 'interlockStationCode', label: '所属联锁站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.ciStationList}, + { prop: 'belongStationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.stationList }, { prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' }, { prop: 'sectionCode', label: this.$t('map.belongsSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList, hover: this.hover, buttonType: 'signalSection', buttonShowType: this.signalSectionShow }, { prop: 'sectionOffset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') } From 7d61451fa989b7eb2b2cfdd16b628fdaa3bac70e Mon Sep 17 00:00:00 2001 From: lVAL Date: Mon, 18 Jan 2021 15:48:05 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=BA=94=E7=AD=94?= =?UTF-8?q?=E5=99=A8=20=E5=88=9B=E5=BB=BA=E7=9A=84=E5=87=A0=E4=B8=AA?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E5=8D=97=E4=BA=AC=E7=BA=BF=E8=B7=AF=E4=B8=AD=E5=BF=83=E5=B7=A6?= =?UTF-8?q?=E9=94=AE=E5=BC=B9=E7=AA=97=EF=BC=8C=E5=8F=B3=E9=94=AE=E4=B8=8D?= =?UTF-8?q?=E5=BC=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 1 + .env.production | 1 + .env.staging | 1 + src/jmapNew/shape/Responder/index.js | 46 ++++++++++--------- src/scripts/ConstDic.js | 28 +++++------ .../newMap/mapsystemNew/common/index.vue | 32 ++++--------- .../mapoperate/responder/responderBatch.vue | 32 +++++++++++-- .../mapoperate/responder/responderCreate.vue | 13 ++++-- .../mapoperate/responder/responderModel.vue | 8 ++-- .../newMapdraft/mapoperate/responder/utils.js | 8 ++-- vue.config.js | 2 +- 11 files changed, 92 insertions(+), 80 deletions(-) diff --git a/.env.development b/.env.development index b387ff05b..ddb549af1 100644 --- a/.env.development +++ b/.env.development @@ -19,3 +19,4 @@ VUE_APP_UPLOAD_API = 'https://upload.joylink.club' # Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js VUE_CLI_BABEL_TRANSPILE_MODULES = true +VUE_APP_SOURCE_MAP = true diff --git a/.env.production b/.env.production index 71363ca9f..4c64df13f 100644 --- a/.env.production +++ b/.env.production @@ -5,3 +5,4 @@ NODE_ENV = 'production' VUE_APP_BASE_API = 'https://api.joylink.club/jlcloud' VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink' VUE_APP_UPLOAD_API = 'https://upload.joylink.club' +VUE_APP_SOURCE_MAP = false diff --git a/.env.staging b/.env.staging index d1042b068..9277c1c33 100644 --- a/.env.staging +++ b/.env.staging @@ -5,3 +5,4 @@ NODE_ENV = 'test' VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud' VUE_APP_VOICE_API = 'https://oss.joylink.club/oss/joylink' VUE_APP_UPLOAD_API = 'https://upload.joylink.club' +VUE_APP_SOURCE_MAP = false diff --git a/src/jmapNew/shape/Responder/index.js b/src/jmapNew/shape/Responder/index.js index e9610921d..16d97da9e 100644 --- a/src/jmapNew/shape/Responder/index.js +++ b/src/jmapNew/shape/Responder/index.js @@ -40,16 +40,20 @@ export default class Responder extends Group { create() { const model = this.model; - const responderStyle = this.style.Responder || defaultStyle; - const distanceX = responderStyle.distance * Math.cos(model.rotate-90); - const distanceY = responderStyle.distance * Math.sin(model.rotate-90); + const responderStyle = this.style.Responder || defaultStyle; + const radian = -Math.PI / 180 * Number(model.rotate-90); + const distanceX = -responderStyle.distance * Math.cos(radian); + const distanceY = -responderStyle.distance * Math.sin(radian); const blockWidth = responderStyle.block.width || 5; const blockHeight = responderStyle.block.height || 12; const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#fff'}; const blockX = model.position.x - blockWidth / 2 - distanceX; - const blockY = model.position.y - blockHeight / 2 - distanceY; - const textX = blockX + model.textOffset.x; - const textY = blockY + model.textOffset.y; + const blockY = model.position.y - blockHeight / 2 - distanceY; + const textRadian = -Math.PI / 180 * Number(180-model.textRotate); + const textDistanceX = model.textOffset.y * Math.sin(textRadian) + model.textOffset.x * Math.cos(textRadian); + const textDistanceY = model.textOffset.y * Math.cos(textRadian) - model.textOffset.x * Math.sin(textRadian); + const textX = blockX + textDistanceX + blockWidth; + const textY = blockY + textDistanceY; const textName = `${model.type}-${model.name}`; const textFill = responderStyle.text.textFill; const origin = [model.position.x, model.position.y]; @@ -100,29 +104,29 @@ export default class Responder extends Group { } }); - this.text = new Text({ - zlevel: this.zlevel, - z: this.z + 1, - style: { - x: textX, - y: textY, - text: textName, - fontFamily: this.style.fontFamily, - fontSize: this.style.fontSize, - textFill: textFill, - textAlign: 'right' - } - }); + this.text = this.name = new Text({ + zlevel: this.zlevel, + z: this.z + 1, + style: { + x: textX, + y: textY, + text: textName, + fontFamily: this.style.fontFamily, + fontSize: this.style.fontSize, + textFill: textFill, + textAlign: 'left' + } + }); if (model.rotate) { - const rotation = -Math.PI / 180 * Number(model.rotate); + const rotation = -Math.PI / 180 * Number(model.rotate+180); [this.block, this.delta1, this.delta2].forEach(el => { this.transformRotation(el, origin, rotation); }); } if (model.textRotate) { - const rotation = -Math.PI / 180 * Number(model.textRotate); + const rotation = -Math.PI / 180 * Number(model.textRotate+180); this.transformRotation(this.text, origin, rotation); } diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js index 51c66ebd4..39a244814 100644 --- a/src/scripts/ConstDic.js +++ b/src/scripts/ConstDic.js @@ -1,12 +1,11 @@ -// /** -// * 真实设备类型 -// */ -// export const RealDeviceType = { -// Section: '区段', -// Switch: '道岔', -// Signal: '信号机', -// ScreenDoor: '屏蔽门' -// }; +/** + * 鼠标事件 + */ +export const MouseEvent = { + Left: 1, + Right: 2, + Wheel: 3 +} /** * 权限类型 */ @@ -60,14 +59,6 @@ export const OperateMode = { DIRECTIVE: '03' }; -// /** -// * 分发、转赠 -// */ -// export const OperatorModel = { -// DISTRIBUTE: '01', -// TRANSFER: '02' -// }; - /** * 菜单编号 */ @@ -128,6 +119,7 @@ export const IbpOperation = { XXYS: {operate: '09', event: 'XXYS', name: '下行钥匙'}, SXYS: {operate: '11', event: 'SXYS', name: '上行钥匙'} }; + /** * ibp状态显示条件 */ @@ -136,12 +128,14 @@ export const IbpShowCondition = { Show_Open_Screen_Door: {statusKey: 'screenDoorOpenStatus', statusValue:['02'], defaultStatus: 'close'}, Show_Close_Screen_Door: {statusKey: 'screenDoorOpenStatus', statusValue: ['01'], defaultStatus: 'open'} }; + /** 列车类型 */ export const TrainType = { PLAN: '计划车', HEAD: '头码车', MANUAL: '人工车' }; + /** 仿真成员类型 */ export const SimulationType = { DISPATCHER: '行调', diff --git a/src/views/newMap/mapsystemNew/common/index.vue b/src/views/newMap/mapsystemNew/common/index.vue index 15b76e1de..263c0d03e 100644 --- a/src/views/newMap/mapsystemNew/common/index.vue +++ b/src/views/newMap/mapsystemNew/common/index.vue @@ -8,7 +8,7 @@