From d524dc9d4d0edebb84f95c7215abd18051205d90 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 8 May 2020 17:20:43 +0800 Subject: [PATCH] =?UTF-8?q?iscs=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs/constant/deviceRender.js | 6 + src/iscs/constant/deviceType.js | 3 +- src/iscs/shape/factory.js | 2 + src/iscs/shape/stateTable.js | 164 ++++++++++- src/iscs/utils/parser.js | 6 + src/views/iscs/iscsDraw/iscsOperate/index.vue | 103 +++++-- .../iscs/iscsDraw/iscsOperate/stateTable.vue | 264 ++++++++++++++++++ .../iscs/iscsSystem/config/deviceControl.vue | 62 +++- .../iscsSystem/config/pis/infoBroadcast.vue | 16 +- 9 files changed, 586 insertions(+), 40 deletions(-) create mode 100644 src/views/iscs/iscsDraw/iscsOperate/stateTable.vue diff --git a/src/iscs/constant/deviceRender.js b/src/iscs/constant/deviceRender.js index f8d5a8806..4d150f416 100644 --- a/src/iscs/constant/deviceRender.js +++ b/src/iscs/constant/deviceRender.js @@ -236,5 +236,11 @@ deviceRender[deviceType.IscsButton] = { zlevel: 1, z: 4 }; +/** 状态表 */ +deviceRender[deviceType.StateTable] = { + _type: deviceType.StateTable, + zlevel: 1, + z: 5 +}; export default deviceRender; diff --git a/src/iscs/constant/deviceType.js b/src/iscs/constant/deviceType.js index e4a24cde0..944af5947 100644 --- a/src/iscs/constant/deviceType.js +++ b/src/iscs/constant/deviceType.js @@ -35,7 +35,8 @@ const deviceType = { Staircase:'Staircase', SingleStaircase: 'SingleStaircase', ArcStatus: 'ArcStatus', - IscsButton: 'IscsButton' + IscsButton: 'IscsButton', + StateTable: 'StateTable' }; export default deviceType; diff --git a/src/iscs/shape/factory.js b/src/iscs/shape/factory.js index a1d97cf04..2fa9f348f 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -36,6 +36,7 @@ import SingleStaircase from './singleStaircase'; import ArcStatus from './ArcStatus'; import IscsButton from './button'; import SmookExhaustFd from './bas/smookExhaustFd'; +import StateTable from './stateTable'; const iscsShape = {}; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; @@ -76,6 +77,7 @@ iscsShape[deviceType.Staircase] = Staircase; iscsShape[deviceType.SingleStaircase] = SingleStaircase; iscsShape[deviceType.ArcStatus] = ArcStatus; iscsShape[deviceType.IscsButton] = IscsButton; +iscsShape[deviceType.StateTable] = StateTable; function shapefactory(device, iscs) { const type = device.model._type; diff --git a/src/iscs/shape/stateTable.js b/src/iscs/shape/stateTable.js index b2f138301..0c34ea050 100644 --- a/src/iscs/shape/stateTable.js +++ b/src/iscs/shape/stateTable.js @@ -1,5 +1,8 @@ import Group from 'zrender/src/container/Group'; -const mean = { +import Rect from 'zrender/src/graphic/shape/Rect'; +import Line from 'zrender/src/graphic/shape/Line'; +import Text from 'zrender/src/graphic/Text'; +const stateMap = { slidingDoorEmergencyDoorOpenMalfunction : '滑动门&应急门开门故障', slidingDoorEmergencyDoorCloseMalfunction: '滑动门&应急门关门故障', slidingDoorsInterlockAllClear: '滑动门互锁解除报警', @@ -16,7 +19,26 @@ const mean = { systemDrivePowerFailure: '系统驱动电源故障', systemControlPowerFailure: '系统控制电源故障', monitorPowerFailure: '监视电源故障', - fieldBusFault:'现场总线故障' + fieldBusFault:'现场总线故障', + fasSystemFailure: { default: '正常'}, // 火灾系统故障 + facpAutoMode: { default: '手动' }, // FACP自动状态 + gesControlStatus: { default: '手动'}, // 气灭控制系统状态 + hydrantStartupStatus: { default: '停止'}, // 消火栓泵启动状态 + tscFireCondition: { default: '正常'}, // 感温电缆火警状态 + aEquipmentAreaFireDetector: { default: '正常'}, // 站厅A端设备区点型火灾探测器 + bEquipmentAreaFireDetector: { default: '正常'}, // 站厅B端设备区点型火灾探测器 + pcaFireDetector: { default: '正常' }, // 站台公共区点型火灾探测器 + scaFireDetector: { default: '正常'}, // 站厅公共区点型火灾探测器 + elevatorCutFirePowerSupply: { default: '正常'}, // 站内垂直电梯切非站台B消 + otherCutFirePowerSupply: { default: '正常'}, // 其他切非回路站台B消 + inDownLeftManualAlarm: { default: '正常' }, // 站内下行左线手动报警按钮 + inUpRightManualAlarm: { default: '正常'}, // 站内上行右线手动报警按钮 + outDownLeftManualAlarm: { default: '正常'}, // 站间下行左线手动报警按钮 + outUpRightManualAlarm: { default: '正常'}, // 站间上行右线手动报警按钮 + inDownLeftHydrant: { default: '正常'}, // 站内下行左线消火栓按钮 + inUpRightHydrant: { default: '正常'}, // 站内上行右线消火栓按钮 + outDownLeftHydrant: { default: '正常'}, // 站间下行左线消火栓按钮 + outUpRightHydrant: { default: '正常'} // 站间上行右线消火栓按钮 }; export default class StateTable extends Group { @@ -29,8 +51,142 @@ export default class StateTable extends Group { this._code = device.model.code; this.create(); } - cerate() { - // this.header = + create() { + const model = this.model; + this.grouper = new Group({ + id: model.code, + position: [model.point.x, model.point.y] + }); + this.lines = []; + let columnWidth = 0; + model.columnWidthList.forEach(item => { + columnWidth += item; + const line = new Line({ + zlevel: this.zlevel, + z: this.z, + shape: { + x1: columnWidth, + y1: model.headerType === 'merge' ? model.rowHeight : 0, + x2: columnWidth, + y2: model.rowNum * model.rowHeight + }, + style: { + stroke: '#FFF', + lineWidth: 2 + } + }); + this.grouper.add(line); + this.lines.push(line); + }); + this.tabelBorder = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: 0, + y: 0, + width: columnWidth, + height: model.rowNum * model.rowHeight + }, + style: { + stroke: '#aFFF', + fill: 'rgba(255, 255, 255, 0)', + lineWidth: 2 + } + }); + this.grouper.add(this.tabelBorder); + for (let i = 0; i < model.rowNum; i++) { + const line = new Line({ + zlevel: this.zlevel, + z: this.z, + shape: { + x1: 0, + y1: i * model.rowHeight, + x2: columnWidth, + y2: i * model.rowHeight + }, + style: { + stroke: '#FFF', + lineWidth: 2 + } + }); + this.grouper.add(line); + this.lines.push(line); + } + this.header = []; + if (model.headerType === 'merge') { + const header = new Text({ + zlevel: model.zlevel, + z: model.z + 1, + style: { + x: columnWidth / 2, + y: model.rowHeight, + fontWeight: 'normal', + fontSize: model.headerFontSize, + fontFamily: 'consolas', + text: model.headerContextList[0], + textFill: '#FFF', + textAlign: 'center', + textPosition: 'inside', + textVerticalAlign: 'bottom', + textLineHeight: model.rowHeight + } + }); + this.grouper.add(header); + this.header.push(header); + } else if (model.headerType === 'normal') { + let width = 0; + model.columnWidthList.forEach((item, i) => { + const header = new Text({ + zlevel: model.zlevel, + z: model.z + 1, + style: { + x: item / 2 + width, + y: model.rowHeight, + fontWeight: 'normal', + fontSize: model.headerFontSize, + fontFamily: 'consolas', + text: model.headerContextList[i], + textFill: '#FFF', + textAlign: 'center', + textPosition: 'inside', + textVerticalAlign: 'bottom', + textLineHeight: model.rowHeight + } + }); + width += item; + this.grouper.add(header); + this.header.push(header); + }); + } + this.tabelContent = []; + model.tableData.forEach((item, i)=> { + let width = 0; + model.columnWidthList.forEach((elem, j) => { + const text = new Text({ + zlevel: model.zlevel, + z: model.z + 1, + _subType: stateMap[item['column' + (j + 1)]], + style:{ + x: elem / 2 + width, + y: model.rowHeight * (i + 2), + fontWeight: 'normal', + fontSize: model.fontSize, + fontFamily: 'consolas', + text: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)], + textFill: stateMap[item['column' + (j + 1)]] ? '#4CCDE4' : '#38984F', + textAlign: 'center', + textPosition: 'inside', + textVerticalAlign: 'bottom', + textLineHeight: model.rowHeight + } + }); + this.grouper.add(text); + this.tabelContent.push(text); + width += item; + }); + }); + this.add(this.grouper); + console.log(this.model, this); } setModel(dx, dy) { this.model.point.x += dx; diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index bc2dd896f..cdd99ac54 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -154,6 +154,9 @@ export function parser(data) { zrUtil.each(data.iscsButtonList || [], elem=> { iscsDevice[elem.code] = deviceFactory(deviceType.IscsButton, elem); }); + zrUtil.each(data.stateTableList || [], elem=> { + iscsDevice[elem.code] = deviceFactory(deviceType.StateTable, elem); + }); } return iscsDevice; @@ -287,6 +290,9 @@ export function updateIscsData(state, device) { case deviceType.IscsButton: updateIscsListByDevice(state, 'iscsButtonList', device); break; + case deviceType.StateTable: + updateIscsListByDevice(state, 'stateTableList', device); + break; } // store.dispatch('iscs/setIscsData', state.iscs); } diff --git a/src/views/iscs/iscsDraw/iscsOperate/index.vue b/src/views/iscs/iscsDraw/iscsOperate/index.vue index a61a3ca31..a81e068c3 100644 --- a/src/views/iscs/iscsDraw/iscsOperate/index.vue +++ b/src/views/iscs/iscsDraw/iscsOperate/index.vue @@ -13,7 +13,7 @@ @@ -21,7 +21,7 @@ @@ -29,7 +29,7 @@ @@ -37,7 +37,7 @@ @@ -45,7 +45,7 @@ @@ -53,7 +53,7 @@ @@ -61,7 +61,7 @@ @@ -69,7 +69,7 @@ @@ -77,7 +77,15 @@ + + + @@ -85,7 +93,7 @@ @@ -93,7 +101,7 @@ @@ -101,7 +109,7 @@ @@ -109,7 +117,7 @@ @@ -134,6 +142,7 @@ import IscsLine from '../iscsCommonElem/line'; import IscsText from '../iscsCommonElem/text'; import IscsRect from '../iscsCommonElem/rect'; import IscsButton from '../iscsCommonElem/button'; +import StateTable from './stateTable'; export default { name: 'IscsOperate', @@ -150,7 +159,8 @@ export default { IscsText, IscsRect, IscsLine, - IscsButton + IscsButton, + StateTable }, mixins: [ ], @@ -193,9 +203,66 @@ export default { diff --git a/src/views/iscs/iscsDraw/iscsOperate/stateTable.vue b/src/views/iscs/iscsDraw/iscsOperate/stateTable.vue new file mode 100644 index 000000000..d89005daf --- /dev/null +++ b/src/views/iscs/iscsDraw/iscsOperate/stateTable.vue @@ -0,0 +1,264 @@ + + + + + diff --git a/src/views/iscs/iscsSystem/config/deviceControl.vue b/src/views/iscs/iscsSystem/config/deviceControl.vue index b5f41d7c3..9227ecc3c 100644 --- a/src/views/iscs/iscsSystem/config/deviceControl.vue +++ b/src/views/iscs/iscsSystem/config/deviceControl.vue @@ -13,15 +13,15 @@
设备名称
-
{{ modeName }}
+
{{ modeName }}
{{ stationName }}
{{ deviceType }}
状态
-
运行
+
运行
- +
当前运行状况
@@ -35,17 +35,45 @@
+ +
+
+ + 读卡器非法尝试 + 子控制器电池电量 + + + 玻璃破碎 + 子控制器防拆开关 + + +   + 子控制器状态 + +
+
+
控制 - 标记 - 详情 + 标记 + 详情 锁闭详情 指派趋势 - 取消 + 取消 - - 取消 - 执行 + + 取消 + 执行 + + + 人工状态 + 报警停用 + 故障设备 + 挂牌检修 + 取消 + + + 确定
@@ -161,7 +189,10 @@ export default { white-space: nowrap; cursor: pointer; background: #CACACA; - border: 1px solid #777675; + border-top: 1px solid #3D3B39; + border-left: 1px solid #3D3B39; + border-bottom: 1px solid #847B77; + border-right: 1px solid #847B77; color: #000; -webkit-appearance: none; text-align: center; @@ -177,6 +208,17 @@ export default { height: 30px; width: 70px; border-radius: 0; + position: relative; + } + .iscs_device_control_dialog .el-dialog .el-button :before { + content: ''; + width: 70px; + height: 30px; + border-top: 1px solid #FFF; + border-left: 1px solid #FFF; + position: absolute; + top: -2px; + left: -2px; } .iscs_device_control_dialog .el-dialog .el-button:hover { background-image: linear-gradient(#E2E4E5,#D5D6D8,#E2E4E5); diff --git a/src/views/iscs/iscsSystem/config/pis/infoBroadcast.vue b/src/views/iscs/iscsSystem/config/pis/infoBroadcast.vue index d1e7eb1c0..329c88161 100644 --- a/src/views/iscs/iscsSystem/config/pis/infoBroadcast.vue +++ b/src/views/iscs/iscsSystem/config/pis/infoBroadcast.vue @@ -89,7 +89,7 @@
导入描述
- + @@ -98,7 +98,7 @@ - + - + - + - + - +