From 25831490433a3778f5b87b31a1baba32c8429a0e Mon Sep 17 00:00:00 2001 From: whyczyk <525500596@qq.com> Date: 星期二, 27 七月 2021 12:00:20 +0800 Subject: [PATCH] 首页轮播图功能添加 --- src/pages/home/topoGraph.vue | 127 +++++++++++++++++++++++++----------------- 1 files changed, 75 insertions(+), 52 deletions(-) diff --git a/src/pages/home/topoGraph.vue b/src/pages/home/topoGraph.vue index 5515c37..04ea2d1 100644 --- a/src/pages/home/topoGraph.vue +++ b/src/pages/home/topoGraph.vue @@ -374,7 +374,8 @@ <mw-drawer :visible.sync="drawer"> <pre-option-list :bigPower="bigPower" :eleBoard="eleBoard" :AFEcabinet="AFEcabinet" :waterStation="waterStation" :oilStation="oilStation" :switch5000="switch5000" - :switch32001="switch32001" :switch32002="switch32002" :switch5200="switch5200" v-if="drawer"> + :switch32001="switch32001" :switch32002="switch32002" :switch5200="switch5200" v-if="drawer" + @change="changeLoad"> </pre-option-list> </mw-drawer> </div> @@ -534,7 +535,9 @@ if (res.data.code == 1) { this.bigPower = res.data.data.rectifierPowerState; if (this.bigPower == 0) { - diagramStates(diagram, 'bigPower'); + diagramStates(diagram, 'bigPower', true); + } else { + diagramStates(diagram, 'bigPower', false); } this.panel4 = res.data.data this.setDiagramByType() @@ -550,7 +553,9 @@ if (res.data.code == 1) { this.eleBoard = res.data.data.switchCloseBusScreen if (this.eleBoard == 0) { - diagramStates(diagram, 'eleBoard'); + diagramStates(diagram, 'eleBoard', true); + } else { + diagramStates(diagram, 'eleBoard', false); } this.panel5 = res.data.data this.setDiagramByType() @@ -566,7 +571,9 @@ if (res.data.code == 1) { this.AFEcabinet = res.data.data.inverterRun if (this.AFEcabinet == 0) { - diagramStates(diagram, 'AFEcabinet'); + diagramStates(diagram, 'AFEcabinet', true); + } else { + diagramStates(diagram, 'AFEcabinet', false); } this.panel7 = res.data.data this.setDiagramByType() @@ -582,7 +589,9 @@ if (res.data.code == 1) { this.waterStation = res.data.data.waterState if (this.waterStation == 0) { - diagramStates(diagram, 'waterStation'); + diagramStates(diagram, 'waterStation', true); + } else { + diagramStates(diagram, 'waterStation', false); } this.panel8 = res.data.data this.setDiagramByType() @@ -598,7 +607,9 @@ if (res.data.code == 1) { this.oilStation = res.data.data.oilState if (this.oilStation == 0) { - diagramStates(diagram, 'oilStation'); + diagramStates(diagram, 'oilStation', true); + } else { + diagramStates(diagram, 'oilStation', false); } this.panel9 = res.data.data this.setDiagramByType() @@ -614,7 +625,9 @@ if (res.data.code == 1) { this.switch5000 = res.data.data.switchClose; if (this.switch5000 == 1) { - diagramStates(diagram, 'switch5000'); + diagramStates(diagram, 'switch5000', true); + } else { + diagramStates(diagram, 'switch5000', false); } this.panel1 = res.data.data this.setDiagramByType() @@ -630,7 +643,9 @@ if (res.data.code == 1) { this.switch32001 = res.data.data.switchClose if (this.switch32001 == 1) { - diagramStates(diagram, 'switch32001'); + diagramStates(diagram, 'switch32001', true); + } else { + diagramStates(diagram, 'switch32001', false); } this.panel2 = res.data.data this.setDiagramByType() @@ -646,7 +661,9 @@ if (res.data.code == 1) { this.switch32002 = res.data.data.switchClose if (this.switch32002 == 1) { - diagramStates(diagram, 'switch32002'); + diagramStates(diagram, 'switch32002', true); + } else { + diagramStates(diagram, 'switch32002', false); } this.panel3 = res.data.data this.setDiagramByType() @@ -662,7 +679,9 @@ if (res.data.code == 1) { this.switch5200 = res.data.data.switchClose if (this.switch5200 == 1) { - diagramStates(diagram, 'switch5200'); + diagramStates(diagram, 'switch5200', true); + } else { + diagramStates(diagram, 'switch5200', false); } this.panel6 = res.data.data this.setDiagramByType() @@ -731,58 +750,24 @@ setDiagramByType() { this.run = ""; if (this.speedCabinet == 0) { - diagramStates(diagram, 'speedCabinet'); + diagramStates(diagram, 'speedCabinet', true); } if (this.electric == 0) { - diagramStates(diagram, 'electric'); + diagramStates(diagram, 'electric', true); } if (this.sensor == 0) { - diagramStates(diagram, 'sensor'); + diagramStates(diagram, 'sensor', true); } if (this.dynamometer == 0) { - diagramStates(diagram, 'dynamometer'); + diagramStates(diagram, 'dynamometer', true); } if (this.transformer == 0) { - diagramStates(diagram, 'transformer'); + diagramStates(diagram, 'transformer', true); } - if (this.switch5000 == 1) { - this.run = 'run1'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1) { - this.run = 'run2'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == 1) { - this.run = 'run3'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == 1 && this - .eleBoard == 1) { - this.run = 'run4'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == 1 && this - .eleBoard == 1 && this.speedCabinet == 1) { - this.run = 'run5'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == 1 && this - .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1) { - this.run = 'run6'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == 1 && this - .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1 && this.sensor == 1) { - this.run = 'run7'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == 1 && this - .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1 && this.sensor == 1 && this - .dynamometer == 1) { - this.run = 'run8'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == 1 && this - .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1 && this.sensor == 1 && this - .dynamometer == 1 && this.AFEcabinet == - 1) { - this.run = 'run9'; - } - if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == 1 && this + + if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == + 1 && this .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1 && this.sensor == 1 && this .dynamometer == 1 && this.AFEcabinet == 1 && this.transformer == 1) { this.run = 'run10'; @@ -791,8 +776,46 @@ this.axis2 = diagram.getZoomLineInfo('line11'); this.axis2[0][0] = this.axis2[0][0] - 15; }, 100); + } else if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == + 1 && this + .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1 && this.sensor == 1 && this + .dynamometer == 1) { + this.run = 'run8'; + } else if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == + 1 && this + .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1 && this.sensor == 1 && this + .dynamometer == 1 && this.AFEcabinet == + 1) { + this.run = 'run9'; + } else if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == + 1 && this + .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1 && this.sensor == 1) { + this.run = 'run7'; + } else if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == + 1 && this + .eleBoard == 1 && this.speedCabinet == 1 && this.electric == 1) { + this.run = 'run6'; + } else if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == + 1 && this + .eleBoard == 1 && this.speedCabinet == 1) { + this.run = 'run5'; + } else if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == + 1 && this + .eleBoard == 1) { + this.run = 'run4'; + } else if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1 && this.bigPower == + 1) { + this.run = 'run3'; + } else if (this.switch5000 == 1 && this.switch32001 == 1 && this.switch32002 == 1) { + this.run = 'run2'; + } else if (this.switch5000 == 1) { + this.run = 'run1'; } diagramStates(diagram, this.run); + }, + changeLoad() { + this.searchAll() + diagram._update() } }, mounted() { -- Gitblit v1.9.1