From f1106541aea9dd6605ae1301495b22d6f92843c7 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 12 Oct 2020 16:21:24 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=95=85=E9=9A=9C=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4&=E6=96=B9=E5=90=91?= =?UTF-8?q?=E6=9D=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 10 +++++++- .../theme/haerbin_01/menus/menuButton.vue | 25 ++++++++++++++++++- .../newMap/displayNew/demon/faultChoose.vue | 10 ++++---- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index e0819251a..e413b49b8 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -54,7 +54,7 @@ class Jlmap { this.previewOrMapDraw = opts.showConfig.previewOrMapDraw; this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config)); - this.$zr.dom.setAttribute('tabIndex', -1); + this.$zr.dom.setAttribute('tabIndex', -1); this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放 this.$painter = new Painter(this); @@ -501,6 +501,14 @@ class Jlmap { psdDevice.fault = elem.fault; this.$painter.update(psdDevice); } + } else if (elem.deviceType === 'DIRECTION_ROD') { + store.state.map.directionRodList.forEach(item => { + if (elem.uniqueCode && elem.uniqueCode === `${item.startStationCode}-${item.endStationCode}-${item.right}`) { + this.$painter.update(elem); + } else if (!elem.uniqueCode) { + this.$painter.update(elem); + } + }); } const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); if (elem.dispose) { diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index eef67ab7c..cd2770dee 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -103,7 +103,8 @@ export default { signalParamList: [], stationParamList: [], standParamList: [], - routeParamList: [] + routeParamList: [], + directionRodParamList: [] }; }, computed: { @@ -153,6 +154,9 @@ export default { case 'StationStand': this.handleStandMenu(); break; + case 'DirectionRod': + this.handleDirectionRodMenu(); + break; } } }).catch((error) => { @@ -368,6 +372,21 @@ export default { speedLimitValue: '5' }; }, + handleDirectionRodMenu() { + this.clearAllMenuShow(); + this.deviceHighLight(this.oldDevice, false); + this.deviceHighLight(this.selectedObj, true); + this.oldDevice = this.selectedObj; + this.centralizedStationList = new Array(15).fill({}); + this.directionRodParamList.forEach((directionRod, index) => { + this.centralizedStationList[index] = directionRod; + }); + this.tempData = []; + this.tempData.push(this.selectedObj); + this.param = { + directionRodCode: `${this.selectedObj.startStationCode}-${this.selectedObj.endStationCode}-${this.selectedObj.right}` + }; + }, handleBasicMenu() { this.deviceHighLight(this.oldDevice, false); if (this.oldClickObj) { @@ -557,6 +576,10 @@ export default { { name: '越站', cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, operate: OperationEvent.StationStand.setJumpStop.menuButton, show: false, securityCommand: true }, { name: '取消越站', cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, operate: OperationEvent.StationStand.cancelJumpStop.menuButton, show: false, securityCommand: true } ]; + this.directionRodParamList = [ + { name: '切换左向', cmdType: CMD.DirectionRod.CMD_DIRECTION_CHANGE, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false }, + { name: '切换右向', cmdType: CMD.DirectionRod.CMD_DIRECTION_CHANGE, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false } + ]; }, initRouteMenus() { this.routeParamList = []; diff --git a/src/views/newMap/displayNew/demon/faultChoose.vue b/src/views/newMap/displayNew/demon/faultChoose.vue index 24e6d8956..381e6a15b 100644 --- a/src/views/newMap/displayNew/demon/faultChoose.vue +++ b/src/views/newMap/displayNew/demon/faultChoose.vue @@ -103,7 +103,7 @@ Date: Mon, 12 Oct 2020 16:33:59 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=95=85=E9=9A=9C=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/DirectionRod/index.js | 3 +++ src/views/newMap/displayNew/demon/faultChoose.vue | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/jmapNew/shape/DirectionRod/index.js b/src/jmapNew/shape/DirectionRod/index.js index 57aedc681..11ea752fa 100644 --- a/src/jmapNew/shape/DirectionRod/index.js +++ b/src/jmapNew/shape/DirectionRod/index.js @@ -97,6 +97,9 @@ export default class DirectionRod extends Group { } else { this.hideMode(); } + } + drawSelected() { + } setShowStation(stationCode) { if (!stationCode || this.model.stationCode === stationCode) { diff --git a/src/views/newMap/displayNew/demon/faultChoose.vue b/src/views/newMap/displayNew/demon/faultChoose.vue index 381e6a15b..561d08c32 100644 --- a/src/views/newMap/displayNew/demon/faultChoose.vue +++ b/src/views/newMap/displayNew/demon/faultChoose.vue @@ -23,7 +23,7 @@ @@ -155,7 +155,7 @@ export default { triggerDeviceStatus:'', triggerDeviceType :'', type:'DEVICE', - triggerTime: '', + triggerTime: '', triggerAssociatedDeviceCode: '' } }, @@ -232,6 +232,9 @@ export default { return name; }, formatTriggerStatus(condition) { + if (!condition.triggerDeviceType) { + return ''; + } const faultStatus = FaultStatusEnum[condition.triggerDeviceType]; return faultStatus[condition.triggerDeviceStatus]; }, @@ -332,7 +335,7 @@ export default { triggerDeviceStatus:'', triggerDeviceType :'', type:'DEVICE', - triggerTime: '', + triggerTime: '', triggerAssociatedDeviceCode: '' } }; @@ -408,7 +411,7 @@ export default { triggerDeviceStatus:this.faultRule.condition.triggerDeviceStatus || null, triggerDeviceType :this.faultRule.condition.triggerDeviceType || null, type:this.faultRule.condition.type, - triggerTime: this.faultRule.condition.triggerTime || null, + triggerTime: this.faultRule.condition.triggerTime || null, triggerAssociatedDeviceCode: this.faultRule.condition.triggerAssociatedDeviceCode || null } }; From e336410a58450475e26e6bd445eba382c0d4e6ac Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 12 Oct 2020 16:45:24 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{sdfcn73785.png => exhaustFan-left.png} | Bin .../{vdyte35.png => exhaustFan-right.png} | Bin .../{矩形线段.png => iscs-MD-rect.png} | Bin .../{sdxcfg879.png => iscs-RAF-EAF_gray.png} | Bin .../{vzxcv6.png => iscs-RAF-EAF_green.png} | Bin .../{zc313543.png => iscs-SEF.png} | Bin .../{sdfbbbmn2272019.png => iscs-value.png} | Bin .../{szcvvv92630.png => iscs_MD.png} | Bin src/iscs/shape/arrow.js | 1 + src/iscs/shape/picture.js | 86 +++--- src/iscs/shape/stateTable.js | 282 +++++++++--------- .../iscs/iscsDraw/icscComponents/arrow.vue | 9 +- .../iscs/iscsDraw/icscComponents/picture.vue | 96 +++--- .../iscsDraw/icscComponents/stateTable.vue | 139 +++++---- .../iscs/iscsDraw/iscsEnvironment/index.vue | 29 +- 15 files changed, 347 insertions(+), 295 deletions(-) rename src/assets/iscs_picture/{sdfcn73785.png => exhaustFan-left.png} (100%) rename src/assets/iscs_picture/{vdyte35.png => exhaustFan-right.png} (100%) rename src/assets/iscs_picture/{矩形线段.png => iscs-MD-rect.png} (100%) rename src/assets/iscs_picture/{sdxcfg879.png => iscs-RAF-EAF_gray.png} (100%) rename src/assets/iscs_picture/{vzxcv6.png => iscs-RAF-EAF_green.png} (100%) rename src/assets/iscs_picture/{zc313543.png => iscs-SEF.png} (100%) rename src/assets/iscs_picture/{sdfbbbmn2272019.png => iscs-value.png} (100%) rename src/assets/iscs_picture/{szcvvv92630.png => iscs_MD.png} (100%) diff --git a/src/assets/iscs_picture/sdfcn73785.png b/src/assets/iscs_picture/exhaustFan-left.png similarity index 100% rename from src/assets/iscs_picture/sdfcn73785.png rename to src/assets/iscs_picture/exhaustFan-left.png diff --git a/src/assets/iscs_picture/vdyte35.png b/src/assets/iscs_picture/exhaustFan-right.png similarity index 100% rename from src/assets/iscs_picture/vdyte35.png rename to src/assets/iscs_picture/exhaustFan-right.png diff --git a/src/assets/iscs_picture/矩形线段.png b/src/assets/iscs_picture/iscs-MD-rect.png similarity index 100% rename from src/assets/iscs_picture/矩形线段.png rename to src/assets/iscs_picture/iscs-MD-rect.png diff --git a/src/assets/iscs_picture/sdxcfg879.png b/src/assets/iscs_picture/iscs-RAF-EAF_gray.png similarity index 100% rename from src/assets/iscs_picture/sdxcfg879.png rename to src/assets/iscs_picture/iscs-RAF-EAF_gray.png diff --git a/src/assets/iscs_picture/vzxcv6.png b/src/assets/iscs_picture/iscs-RAF-EAF_green.png similarity index 100% rename from src/assets/iscs_picture/vzxcv6.png rename to src/assets/iscs_picture/iscs-RAF-EAF_green.png diff --git a/src/assets/iscs_picture/zc313543.png b/src/assets/iscs_picture/iscs-SEF.png similarity index 100% rename from src/assets/iscs_picture/zc313543.png rename to src/assets/iscs_picture/iscs-SEF.png diff --git a/src/assets/iscs_picture/sdfbbbmn2272019.png b/src/assets/iscs_picture/iscs-value.png similarity index 100% rename from src/assets/iscs_picture/sdfbbbmn2272019.png rename to src/assets/iscs_picture/iscs-value.png diff --git a/src/assets/iscs_picture/szcvvv92630.png b/src/assets/iscs_picture/iscs_MD.png similarity index 100% rename from src/assets/iscs_picture/szcvvv92630.png rename to src/assets/iscs_picture/iscs_MD.png diff --git a/src/iscs/shape/arrow.js b/src/iscs/shape/arrow.js index 380c5e0e6..47dc5588f 100644 --- a/src/iscs/shape/arrow.js +++ b/src/iscs/shape/arrow.js @@ -41,6 +41,7 @@ export default class Tick extends Group { this.iscsRect = new Polygon({ zlevel: model.zlevel, z: model.z, + z2: model.z2 || 0, shape: { points: points }, diff --git a/src/iscs/shape/picture.js b/src/iscs/shape/picture.js index ac480e11e..aad23c7bd 100644 --- a/src/iscs/shape/picture.js +++ b/src/iscs/shape/picture.js @@ -20,8 +20,8 @@ import blowerRedRight from '@/assets/iscs_picture/gufengji-red-r.png'; import blowerGrayRight from '@/assets/iscs_picture/gufengji-gray-r.png'; import iscsAPF from '@/assets/iscs_picture/iscs_APF.png'; import drum from '@/assets/iscs_picture/drum.png'; -import exhaustFanGray from '@/assets/iscs_picture/exhaustFan-gray.png' -import exhaustFanGreen from '@/assets/iscs_picture/exhaustFan-green.png' +import exhaustFanGray from '@/assets/iscs_picture/exhaustFan-gray.png'; +import exhaustFanGreen from '@/assets/iscs_picture/exhaustFan-green.png'; import waterCooler from '@/assets/iscs_picture/ZSDF533.png'; import textBgBluePoint from '@/assets/iscs_picture/textBgBluePoint.png'; import kongzhixiang from '@/assets/iscs_picture/iscs_kongzhixiang.png'; @@ -30,9 +30,17 @@ import escalator from '@/assets/iscs_picture/escalator.png'; import toUp from '@/assets/iscs_picture/to-up.png'; import toDown from '@/assets/iscs_picture/to-down.png'; import lift from '@/assets/iscs_picture/lift.png'; -import dewateringBlue from '@/assets/iscs_picture/dewatering-blue.png' -import dewateringGray from '@/assets/iscs_picture/dewatering-gray.png' -import dewateringPurple from '@/assets/iscs_picture/dewatering-purple.png' +import dewateringBlue from '@/assets/iscs_picture/dewatering-blue.png'; +import dewateringGray from '@/assets/iscs_picture/dewatering-gray.png'; +import dewateringPurple from '@/assets/iscs_picture/dewatering-purple.png'; +import exhaustFanLeft from '@/assets/iscs_picture/exhaustFan-left.png'; +import exhaustFanRight from '@/assets/iscs_picture/exhaustFan-right.png'; +import iscsMD from '@/assets/iscs_picture/iscs_MD.png'; +import iscsMDRect from '@/assets/iscs_picture/iscs-MD-rect.png'; +import iscsRAFEAFGreen from '@/assets/iscs_picture/iscs-RAF-EAF_green.png'; +import iscsRAFEAFGray from '@/assets/iscs_picture/iscs-RAF-EAF_gray.png'; +import iscsSEF from '@/assets/iscs_picture/iscs-SEF.png'; +import iscsValue from '@/assets/iscs_picture/iscs-value.png'; const pictureObj = { 'psdLeft': psdLeft, @@ -41,32 +49,40 @@ const pictureObj = { 'APF': iscsAPF, 'envPersonDoor': envPersonDoor, 's': fireBlue, - 'a': fireRed, - hand, - fmBlue, - fmGray, - fmGreen, - airCond, - airCondMul, - setting, - blowerRedLeft, - blowerGrayLeft, - blowerRedRight, - blowerGrayRight, - drum, - exhaustFanGray, - exhaustFanGreen, - waterCooler, - textBgBluePoint, - ventilationFan, - escalator, - toUp, - toDown, - lift, - dewateringBlue, - dewateringGray, - dewateringPurple, - kongzhixiang + 'a': fireRed, + hand, + fmBlue, + fmGray, + fmGreen, + airCond, + airCondMul, + setting, + blowerRedLeft, + blowerGrayLeft, + blowerRedRight, + blowerGrayRight, + drum, + exhaustFanGray, + exhaustFanGreen, + waterCooler, + textBgBluePoint, + ventilationFan, + escalator, + toUp, + toDown, + lift, + dewateringBlue, + dewateringGray, + dewateringPurple, + kongzhixiang, + exhaustFanLeft, + exhaustFanRight, + iscsMD, + iscsMDRect, + iscsRAFEAFGreen, + iscsRAFEAFGray, + iscsSEF, + iscsValue }; export default class Picture extends Group { constructor(device) { @@ -87,10 +103,10 @@ export default class Picture extends Group { }); this.imageButton = new Image({ zlevel: model.zlevel, - z: model.z, - z2: model.z2||0, - origin: [model.width/2, model.height/2], - rotation: (model.rotation||0)*Math.PI/180, + z: model.z, + z2: model.z2 || 0, + origin: [model.width / 2, model.height / 2], + rotation: (model.rotation || 0) * Math.PI / 180, style: { x: 0, y: 0, diff --git a/src/iscs/shape/stateTable.js b/src/iscs/shape/stateTable.js index 463f89742..f924cb94b 100644 --- a/src/iscs/shape/stateTable.js +++ b/src/iscs/shape/stateTable.js @@ -1,9 +1,9 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; -import Line from 'zrender/src/graphic/shape/Line'; +// import Line from 'zrender/src/graphic/shape/Line'; import Text from 'zrender/src/graphic/Text'; import Circle from 'zrender/src/graphic/shape/Circle'; -import { merge } from 'lodash'; +// import { merge } from 'lodash'; const stateMap = { slidingDoorEmergencyDoorOpenMalfunction : '滑动门&应急门开门故障', slidingDoorEmergencyDoorCloseMalfunction: '滑动门&应急门关门故障', @@ -167,75 +167,75 @@ export default class StateTable extends Group { this.create(); } create() { - const model = this.model; - const sumWidth = model.columnWidthList.reduce((a,b) => {return a+b;}) + const model = this.model; + const sumWidth = model.columnWidthList.reduce((a, b) => { return a + b; }); - this.rectsArr = []; - this.contextsArr = []; + this.rectsArr = []; + this.contextsArr = []; this.grouper = new Group({ id: model.code, position: [model.point.x, model.point.y] - }); + }); - let rowNum = model.rowNum; - let contentIndex = 2; + // let rowNum = model.rowNum; + // let contentIndex = 2; if (model.headerType === 'none') { - rowNum = model.rowNum - 1; - contentIndex = 1; - } + // rowNum = model.rowNum - 1; + // contentIndex = 1; + } - if (model.rowHeight||!model.rowHeightList) { - model.rowHeightList = new Array(model.rowNum).fill(model.rowHeight); - } + if (model.rowHeight || !model.rowHeightList) { + model.rowHeightList = new Array(model.rowNum).fill(model.rowHeight); + } - let sumRowSize = 0; - model.rowHeightList.forEach((height,i) => { - const rects = []; - let sumColumnSize = 0; - let isMegerHeader = model.headerType === 'merge' && i == 0; + let sumRowSize = 0; + model.rowHeightList.forEach((height, i) => { + const rects = []; + let sumColumnSize = 0; + const isMegerHeader = model.headerType === 'merge' && i == 0; - if (model.headerType === 'none' && i == 0) { - return; - } + if (model.headerType === 'none' && i == 0) { + return; + } - model.columnWidthList.forEach((width,j) => { - const defBg = model.bgColor||'rgba(0,0,0,0)' - const rect = new Rect({ - zlevel: this.zlevel, - z: this.z, - shape: { - x: isMegerHeader? 0: sumColumnSize, - y: sumRowSize, - width: isMegerHeader? sumWidth: width, - height - }, - style: { - stroke: model.borderColor || '#FFF', - lineWidth: 1, - fill: model.tableData[i-1]? model.tableData[i-1]['bg'+(j+1)]||defBg : defBg - } - }); - - rects.push(rect); - this.grouper.add(rect); - sumColumnSize += width; - }); - - this.rectsArr.push(rects); - sumRowSize += height; - }) + model.columnWidthList.forEach((width, j) => { + const defBg = model.bgColor || 'rgba(0,0,0,0)'; + const rect = new Rect({ + zlevel: this.zlevel, + z: this.z, + z2: model.z2 || 0, + shape: { + x: isMegerHeader ? 0 : sumColumnSize, + y: sumRowSize, + width: isMegerHeader ? sumWidth : width, + height + }, + style: { + stroke: model.borderColor || '#FFF', + lineWidth: 1, + fill: model.tableData[i - 1] ? model.tableData[i - 1]['bg' + (j + 1)] || defBg : defBg + } + }); + rects.push(rect); + this.grouper.add(rect); + sumColumnSize += width; + }); + this.rectsArr.push(rects); + sumRowSize += height; + }); this.header = []; if (model.headerType === 'merge') { const header = new Text({ zlevel: model.zlevel, z: model.z + 1, + z2: model.z2 || 0, style: { x: sumWidth / 2, y: model.rowHeightList[0] / 2, - fontWeight: model.headerFontWeight||'normal', + fontWeight: model.headerFontWeight || 'normal', fontSize: model.headerFontSize, fontFamily: 'consolas', text: model.headerContextList[0], @@ -254,10 +254,11 @@ export default class StateTable extends Group { const header = new Text({ zlevel: model.zlevel, z: model.z + 1, + z2: model.z2 || 0, style: { x: item / 2 + width, y: model.rowHeightList[0] / 2, - fontWeight: model.headerFontWeight||'normal', + fontWeight: model.headerFontWeight || 'normal', fontSize: model.headerFontSize, fontFamily: 'consolas', text: model.headerContextList[i], @@ -272,100 +273,103 @@ export default class StateTable extends Group { this.grouper.add(header); this.header.push(header); }); - } + } model.tableData.forEach((item, i)=> { - const index = model.headerType === 'none'? i: i+1; - const rects = this.rectsArr[index]; - const contexts = []; + const index = model.headerType === 'none' ? i : i + 1; + const rects = this.rectsArr[index]; + const contexts = []; model.columnWidthList.forEach((elem, j) => { - const rect = rects[j]; - if (rect) { - if (stateMap[item['column' + (j + 1)]] && + const rect = rects[j]; + if (rect) { + if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].type === 'Circle') { - const contextColor = stateMap[item['column' + (j + 1)]].color||item['color'+(j + 1)]||'#4CCDE4'; - const circle = new Circle({ - zlevel: model.zlevel, - z: model.z + 1, - _subType: stateMap[item['column' + (j + 1)]], - shape: { - cx: rect.shape.x + rect.shape.width / 2, - cy: rect.shape.y + rect.shape.height / 2, - r: model.rowHeightList[index] / 3 - }, - style: { - fill: contextColor - } - }); - this.grouper.add(circle); - contexts.push(circle); - } else { - const bg = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].background : null; - const textPadding = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].textPadding : 0; - const context = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)]; - const contextColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : item['color'+(j + 1)]||(this.model.textColor ? this.model.textColor : '#4CCDE4'); - const contextWeight = stateMap[item['column' + (j + 1)]] ? 'normal': item['weight'+(j + 1)]||this.model.fontWeight||'normal'; - const unit = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unit : ''; - const unitColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : item['color'+(j + 1)]||(this.model.textColor ? this.model.textColor : '#4CCDE4') + const contextColor = stateMap[item['column' + (j + 1)]].color || item['color' + (j + 1)] || '#4CCDE4'; + const circle = new Circle({ + zlevel: model.zlevel, + z: model.z + 1, + z2: model.z2 || 0, + _subType: stateMap[item['column' + (j + 1)]], + shape: { + cx: rect.shape.x + rect.shape.width / 2, + cy: rect.shape.y + rect.shape.height / 2, + r: model.rowHeightList[index] / 3 + }, + style: { + fill: contextColor + } + }); + this.grouper.add(circle); + contexts.push(circle); + } else { + const bg = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].background : null; + const textPadding = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].textPadding : 0; + const context = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)]; + const contextColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : item['color' + (j + 1)] || (this.model.textColor ? this.model.textColor : '#4CCDE4'); + const contextWeight = stateMap[item['column' + (j + 1)]] ? 'normal' : item['weight' + (j + 1)] || this.model.fontWeight || 'normal'; + const unit = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unit : ''; + const unitColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : item['color' + (j + 1)] || (this.model.textColor ? this.model.textColor : '#4CCDE4'); - let text = null; - if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].unit) { - text = new Text({ - zlevel: model.zlevel, - z: model.z + 1, - _subType: stateMap[item['column' + (j + 1)]], - style:{ - x: rect.shape.x + rect.shape.width / 2, - y: rect.shape.y + rect.shape.height / 2, - fontWeight: contextWeight, - fontFamily: 'consolas', - fontSize: model.fontSize, - text: `{context|${context}} {unit|${unit}}`, - rich: { - context: { - textFill: contextColor, - }, - unit: { - textFill: unitColor, - } - }, - textBackgroundColor: bg, - textLineHeight: model.fontSize, - textAlign: 'center', - textPosition: 'inside', - textVerticalAlign: 'center', - textPadding - } - }); - } else { - text = new Text({ - zlevel: model.zlevel, - z: model.z + 1, - _subType: stateMap[item['column' + (j + 1)]], - style:{ - x: rect.shape.x + rect.shape.width / 2, - y: rect.shape.y + rect.shape.height / 2, - fontWeight: contextWeight, - fontFamily: 'consolas', - fontSize: model.fontSize, - text: context, - textFill: contextColor, - textBackgroundColor: bg, - textLineHeight: model.fontSize, - textAlign: 'center', - textPosition: 'inside', - textVerticalAlign: 'center', - textPadding - } - }); - } - this.grouper.add(text); - contexts.push(text); - } - } + let text = null; + if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].unit) { + text = new Text({ + zlevel: model.zlevel, + z: model.z + 1, + z2: model.z2 || 0, + _subType: stateMap[item['column' + (j + 1)]], + style:{ + x: rect.shape.x + rect.shape.width / 2, + y: rect.shape.y + rect.shape.height / 2, + fontWeight: contextWeight, + fontFamily: 'consolas', + fontSize: model.fontSize, + text: `{context|${context}} {unit|${unit}}`, + rich: { + context: { + textFill: contextColor + }, + unit: { + textFill: unitColor + } + }, + textBackgroundColor: bg, + textLineHeight: model.fontSize, + textAlign: 'center', + textPosition: 'inside', + textVerticalAlign: 'center', + textPadding + } + }); + } else { + text = new Text({ + zlevel: model.zlevel, + z: model.z + 1, + z2: model.z2 || 0, + _subType: stateMap[item['column' + (j + 1)]], + style:{ + x: rect.shape.x + rect.shape.width / 2, + y: rect.shape.y + rect.shape.height / 2, + fontWeight: contextWeight, + fontFamily: 'consolas', + fontSize: model.fontSize, + text: context, + textFill: contextColor, + textBackgroundColor: bg, + textLineHeight: model.fontSize, + textAlign: 'center', + textPosition: 'inside', + textVerticalAlign: 'center', + textPadding + } + }); + } + this.grouper.add(text); + contexts.push(text); + } + } }); - this.contextsArr.push(contexts) - }); + this.contextsArr.push(contexts); + }); this.add(this.grouper); } setModel(dx, dy) { diff --git a/src/views/iscs/iscsDraw/icscComponents/arrow.vue b/src/views/iscs/iscsDraw/icscComponents/arrow.vue index faf56f67f..315ed173b 100644 --- a/src/views/iscs/iscsDraw/icscComponents/arrow.vue +++ b/src/views/iscs/iscsDraw/icscComponents/arrow.vue @@ -1,6 +1,9 @@