From 36883d9587d56b7ca02469ebfe5994408f788600 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Sun, 28 Jun 2020 15:27:10 +0800 Subject: [PATCH] =?UTF-8?q?iscs=20=E8=BD=AC=E6=8D=A2=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4=20ibp=E7=9B=98=E7=BB=98?= =?UTF-8?q?=E5=88=B6=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/iscs/utils/parser.js | 52 ++-------------------- src/views/ibp/ibpDraw/ibpOperate/index.vue | 50 +++++++++++++-------- 2 files changed, 36 insertions(+), 66 deletions(-) diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index b1db2296a..f11c30280 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -207,53 +207,9 @@ function updateIscsListByDevice(state, name, device) { } export function updateIscsData(state, device) { - // const state = store.state; - switch (device._type) { - case deviceType.Vidicon : updateIscsListByDevice(state, 'vidiconList', device); break; - case deviceType.VidiconCloud : updateIscsListByDevice(state, 'vidiconCloudList', device); break; - case deviceType.ManualAlarmButton : updateIscsListByDevice(state, 'manualAlarmButtonList', device); break; - case deviceType.FireHydranAlarmButton: updateIscsListByDevice(state, 'fireHydranAlarmButtonList', device); break; - case deviceType.GasFireControl: updateIscsListByDevice(state, 'gasFireControlList', device); break; - case deviceType.SmokeDetector: updateIscsListByDevice(state, 'smokeDetectorList', device); break; - case deviceType.TemperatureDetector: updateIscsListByDevice(state, 'temperatureDetectorList', device); break; - case deviceType.PlatformScreenDoor: updateIscsListByDevice(state, 'platformScreenDoorList', device); break; - case deviceType.FrozenPump : updateIscsListByDevice(state, 'frozenPumpList', device); break; - case deviceType.Ventilator : updateIscsListByDevice(state, 'ventilatorList', device); break; - case deviceType.Chiller : updateIscsListByDevice(state, 'chillerList', device); break; - case deviceType.CoolTower : updateIscsListByDevice(state, 'coolTowerList', device); break; - case deviceType.EndDoor: updateIscsListByDevice(state, 'endDoorList', device); break; - case deviceType.BorderRadius: updateIscsListByDevice(state, 'borderRadiusList', device); break; - case deviceType.BrakeMachine: updateIscsListByDevice(state, 'brakeMachineList', device); break; - case deviceType.EntranceGuard: updateIscsListByDevice(state, 'entranceGuardList', device); break; - case deviceType.TicketMachine: updateIscsListByDevice(state, 'ticketMachineList', device); break; - case deviceType.SemiAutomaticTicketMachine: updateIscsListByDevice(state, 'semiAutomaticTicketMachineList', device); break; - case deviceType.AirConditioner: updateIscsListByDevice(state, 'airConditionerList', device); break; - case deviceType.OrbitalVentilator: updateIscsListByDevice(state, 'orbitalVentilatorList', device); break; - case deviceType.JetFan: updateIscsListByDevice(state, 'jetFanList', device); break; - case deviceType.TunnelFan: updateIscsListByDevice(state, 'tunnelFanList', device); break; - case deviceType.FireDamper: updateIscsListByDevice(state, 'fireDamperList', device); break; - case deviceType.SmookExhaustFd: updateIscsListByDevice(state, 'smookExhaustFdList', device); break; - case deviceType.SmookProofFd: updateIscsListByDevice(state, 'smookProofFdList', device); break; - case deviceType.VolumeControlDamper: updateIscsListByDevice(state, 'volumeControlDamperList', device); break; - case deviceType.IscsRect: updateIscsListByDevice(state, 'iscsRectList', device); break; - case deviceType.IscsText: updateIscsListByDevice(state, 'iscsTextList', device); break; - case deviceType.IscsLine: updateIscsListByDevice(state, 'iscsLineList', device); break; - case deviceType.Escalator: updateIscsListByDevice(state, 'escalatorList', device); break; - case deviceType.StairControl: updateIscsListByDevice(state, 'stairControlList', device); break; - case deviceType.FasBrakeMachine: updateIscsListByDevice(state, 'fasBrakeMachineList', device); break; - case deviceType.Staircase: updateIscsListByDevice(state, 'staircaseList', device); break; - case deviceType.SingleStaircase: updateIscsListByDevice(state, 'singleStaircaseList', device); break; - case deviceType.ArcStatus: updateIscsListByDevice(state, 'arcStatusList', device); break; - case deviceType.IscsButton: updateIscsListByDevice(state, 'iscsButtonList', device); break; - case deviceType.StateTable: updateIscsListByDevice(state, 'stateTableList', device); break; - case deviceType.LightingGroup: updateIscsListByDevice(state, 'lightingGroupList', device); break; - case deviceType.BalancedElectric: updateIscsListByDevice(state, 'balancedElectricList', device); break; - case deviceType.ElectricButterflyValve: updateIscsListByDevice(state, 'electricButterflyValveList', device); break; - case deviceType.Cistern: updateIscsListByDevice(state, 'cisternList', device); break; - case deviceType.Electrically: updateIscsListByDevice(state, 'electricallyList', device); break; - case deviceType.Stairs: updateIscsListByDevice(state, 'stairsList', device); break; - case deviceType.Elevator: updateIscsListByDevice(state, 'elevatorList', device); break; - case deviceType.Draught: updateIscsListByDevice(state, 'draughtList', device); break; - case deviceType.IscsImage: updateIscsListByDevice(state, 'iscsImageList', device); break; + let type = device._type; + if (type) { + type = type.replace(type[0], type[0].toLowerCase()) + 'List'; + updateIscsListByDevice(state, type, device); } } diff --git a/src/views/ibp/ibpDraw/ibpOperate/index.vue b/src/views/ibp/ibpDraw/ibpOperate/index.vue index f649fc083..03915eec1 100644 --- a/src/views/ibp/ibpDraw/ibpOperate/index.vue +++ b/src/views/ibp/ibpDraw/ibpOperate/index.vue @@ -174,6 +174,7 @@ import IbpKey from './ibpKey'; import IbpClock from './ibpClock'; import IbpRotateTip from './ibpRotateTip'; import { putIbpDrawData, getIbpInfo } from '@/api/ibp'; +import {getStationList} from '@/api/runplan'; export default { name: 'IbpOperate', @@ -200,28 +201,34 @@ export default { return { enabledTab: 'Background', data: '', - stationOptions:[ - { - value: 'Station_203_0.07533', - // label: '通化门站' - label: '车站一' - }, - { - value: 'Station_207_0.62282', - // label: '枣园站' - label: '车站二' - }, - { - value: 'Station_209_0.95175', - label: '车站三' - // label: '后卫寨站' - } - ], + stationOptions:[], + // stationOptions:[ + // { + // value: 'Station_203_0.07533', + // // label: '通化门站' + // label: '车站一' + // }, + // { + // value: 'Station_207_0.62282', + // // label: '枣园站' + // label: '车站二' + // }, + // { + // value: 'Station_209_0.95175', + // label: '车站三' + // // label: '后卫寨站' + // } + // ], // drawData: {}, - stationCode: '', + // stationCode: '', height: this.$store.state.app.height - 190 }; }, + computed:{ + stationCode() { + return this.$route.query.stationCode; + } + }, watch: { '$store.state.ibp.rightClickCount': function (val) { const model = this.$store.getters['ibp/updateDeviceData']; @@ -230,6 +237,7 @@ export default { }, async created() { try { + const resp = await getStationList(this.$route.query.mapId); const res = await getIbpInfo(this.$route.query.ibpId); if (res.data.data) { const drawData = JSON.parse(res.data.data).drawData; @@ -237,6 +245,12 @@ export default { } else { this.setEmptyShow(); } + if (resp.data && resp.data.length > 0) { + const stationList = resp.data; + stationList.forEach(station=>{ + this.stationOptions.push({label:station.name, value:station.code}); + }); + } } catch (error) { console.log('error', error); }