|
@@ -5,8 +5,8 @@
|
|
|
</header>
|
|
|
|
|
|
<section class="mainbox">
|
|
|
- <button @click="changewebstate1">查看</button>
|
|
|
- <button @click="changewebstate2">查看</button>
|
|
|
+ <button @click="changeWebState(1)">查看</button>
|
|
|
+ <button @click="changeWebState(2)">查看</button>
|
|
|
<div class="motor1">
|
|
|
<h3>电机1:</h3>
|
|
|
<section>
|
|
@@ -147,34 +147,18 @@
|
|
|
</div>
|
|
|
<div class="tank1">
|
|
|
<div>
|
|
|
- 水温:
|
|
|
- <p>
|
|
|
- {{ tank.temperature1 }}
|
|
|
- </p>
|
|
|
- ℃
|
|
|
+ 水温:{{ tank.temperature1 }}℃
|
|
|
</div>
|
|
|
<div>
|
|
|
- 水位:
|
|
|
- <p>
|
|
|
- {{ tank.dept1 }}
|
|
|
- </p>
|
|
|
- m
|
|
|
+ 水位:{{ tank.dept1 }}m
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="tank2">
|
|
|
<div>
|
|
|
- 水温:
|
|
|
- <p>
|
|
|
- {{ tank.temperature2 }}
|
|
|
- </p>
|
|
|
- ℃
|
|
|
+ 水温:{{ tank.temperature2 }}℃
|
|
|
</div>
|
|
|
<div>
|
|
|
- 水位:
|
|
|
- <p>
|
|
|
- {{ tank.dept2 }}
|
|
|
- </p>
|
|
|
- m
|
|
|
+ 水位:{{ tank.dept2 }}m
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="pumps">
|
|
@@ -194,183 +178,128 @@
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve1(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[0] == 'true'"
|
|
|
+ v-if="valvestate[0] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve1(clsoe).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[0] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve2(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[1] == 'true'"
|
|
|
+ v-if="valvestate[1] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve2(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[1] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="valveitem2">
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve3(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[2] == 'true'"
|
|
|
+ v-if="valvestate[2] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve3(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[2] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve3(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[3] == 'true'"
|
|
|
+ v-if="valvestate[3] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve3(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[3] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve3(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[4] == 'true'"
|
|
|
+ v-if="valvestate[4] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve3(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[4] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve3(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[5] == 'true'"
|
|
|
+ v-if="valvestate[5] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve3(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[5] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="valveitem4">
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve4(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[6] == 'true'"
|
|
|
+ v-if="valvestate[6] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve4(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[6] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve5(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[7] == 'true'"
|
|
|
+ v-if="valvestate[7] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve5(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[7] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="valveitem5">
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve6(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[8] == 'true'"
|
|
|
+ v-if="valvestate[8] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve6(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[8] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve7(open).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[9] == 'true'"
|
|
|
+ v-if="valvestate[9] == 'true'"
|
|
|
/>
|
|
|
<img
|
|
|
:src="require('@/assets/img/gas/valve7(close).png')"
|
|
|
alt=""
|
|
|
- v-show="valvestate[9] == 'false'"
|
|
|
+ v-else
|
|
|
/>
|
|
|
</div>
|
|
|
</section>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-(function flexible(window, document) {
|
|
|
- var docEl = document.documentElement;
|
|
|
- var dpr = window.devicePixelRatio || 1;
|
|
|
-
|
|
|
- // adjust body font size
|
|
|
- function setBodyFontSize() {
|
|
|
- if (document.body) {
|
|
|
- document.body.style.fontSize = 12 * dpr + "px";
|
|
|
- } else {
|
|
|
- document.addEventListener("DOMContentLoaded", setBodyFontSize);
|
|
|
- }
|
|
|
- }
|
|
|
- setBodyFontSize();
|
|
|
-
|
|
|
- // set 1rem = viewWidth / 10
|
|
|
- function setRemUnit() {
|
|
|
- var rem = docEl.clientWidth / 24;
|
|
|
- docEl.style.fontSize = rem + "px";
|
|
|
- }
|
|
|
-
|
|
|
- setRemUnit();
|
|
|
-
|
|
|
- // reset rem unit on page resize
|
|
|
- window.addEventListener("resize", setRemUnit);
|
|
|
- window.addEventListener("pageshow", function (e) {
|
|
|
- if (e.persisted) {
|
|
|
- setRemUnit();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // detect 0.5px supports
|
|
|
- if (dpr >= 2) {
|
|
|
- var fakeBody = document.createElement("body");
|
|
|
- var testElement = document.createElement("div");
|
|
|
- testElement.style.border = ".5px solid transparent";
|
|
|
- fakeBody.appendChild(testElement);
|
|
|
- docEl.appendChild(fakeBody);
|
|
|
- if (testElement.offsetHeight === 1) {
|
|
|
- docEl.classList.add("hairlines");
|
|
|
- }
|
|
|
- docEl.removeChild(fakeBody);
|
|
|
- }
|
|
|
-})(window, document);
|
|
|
export default {
|
|
|
- inject: ["getint", "getres"],
|
|
|
- computed: {
|
|
|
- int() {
|
|
|
- return this.getint();
|
|
|
- },
|
|
|
- res() {
|
|
|
- return this.getres();
|
|
|
- },
|
|
|
- },
|
|
|
- emits: ["statechange"],
|
|
|
data() {
|
|
|
return {
|
|
|
- webstate: 0,
|
|
|
- // valvestate:[true,false,true,false,true,false,true,false,true,false],
|
|
|
valvestate: [
|
|
|
"true",
|
|
|
- "false",
|
|
|
"true",
|
|
|
- "false",
|
|
|
"true",
|
|
|
- "false",
|
|
|
"true",
|
|
|
- "false",
|
|
|
"true",
|
|
|
- "false",
|
|
|
+ "true",
|
|
|
+ "true",
|
|
|
+ "true",
|
|
|
+ "true",
|
|
|
+ "true",
|
|
|
],
|
|
|
buttonstate: ["true", "false"],
|
|
|
tank: {
|
|
@@ -414,161 +343,10 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- mounted() {
|
|
|
- // this.a();
|
|
|
- this.changestate();
|
|
|
- },
|
|
|
|
|
|
methods: {
|
|
|
- changestate() {
|
|
|
- setInterval(() => {
|
|
|
- this.setvalue();
|
|
|
- }, 1000);
|
|
|
- },
|
|
|
- setvalue() {
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 0,
|
|
|
- this.getres()[this.getint()].PipeValves.Pump1Enabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 1,
|
|
|
- this.getres()[this.getint()].PipeValves.Pump2Enabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 2,
|
|
|
- this.getres()[this.getint()].PipeValves.Pump3Enabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 3,
|
|
|
- this.getres()[this.getint()].PipeValves.Pump4Enabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 4,
|
|
|
- this.getres()[this.getint()].PipeValves.Pump5Enabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 5,
|
|
|
- this.getres()[this.getint()].PipeValves.Pump6Enabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 6,
|
|
|
- this.getres()[this.getint()].GasPump1.InletValveEnabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 7,
|
|
|
- this.getres()[this.getint()].GasPump1.InletValveEnabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 8,
|
|
|
- this.getres()[this.getint()].GasPump2.OutletValveEnabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.valvestate,
|
|
|
- 9,
|
|
|
- this.getres()[this.getint()].GasPump2.OutletValveEnabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.buttonstate,
|
|
|
- 0,
|
|
|
- this.getres()[this.getint()].GasPump1.PumpEnabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.buttonstate,
|
|
|
- 1,
|
|
|
- this.getres()[this.getint()].GasPump2.PumpEnabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.waterpumpstate,
|
|
|
- 0,
|
|
|
- this.getres()[this.getint()].CoolantPump1.PumpEnabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.waterpumpstate,
|
|
|
- 1,
|
|
|
- this.getres()[this.getint()].CoolantPump2.PumpEnabled
|
|
|
- ),
|
|
|
- this.$set(
|
|
|
- this.tower,
|
|
|
- "state",
|
|
|
- this.getres()[this.getint()].CoolingTower.TowerEnabled
|
|
|
- ),
|
|
|
- (this.tank.temperature1 =
|
|
|
- this.getres()[this.getint()].HighPool.Temperature),
|
|
|
- (this.tank.dept1 = this.getres()[this.getint()].HighPool.WaterLevel),
|
|
|
- (this.tank.temperature2 =
|
|
|
- this.getres()[this.getint()].LowPool.Temperature),
|
|
|
- (this.tank.dept2 = this.getres()[this.getint()].LowPool.WaterLevel),
|
|
|
- (this.pipe.perssure =
|
|
|
- this.getres()[this.getint()].Pipe.PipeNegativePressure),
|
|
|
- (this.pipe.temperature =
|
|
|
- this.getres()[this.getint()].Pipe.PumpingTemperature),
|
|
|
- (this.pipe.gasconcentration =
|
|
|
- this.getres()[this.getint()].Pipe.GasConcentration),
|
|
|
- (this.pipe.rateoflow = this.getres()[this.getint()].Pipe.Flow),
|
|
|
- (this.motor1.current =
|
|
|
- this.getres()[this.getint()].GasPump1.MotorCurrent),
|
|
|
- (this.motor1.voltage =
|
|
|
- this.getres()[this.getint()].GasPump1.MotorVoltage),
|
|
|
- (this.motor1.motortemperature =
|
|
|
- this.getres()[this.getint()].GasPump1.PumpTemperature),
|
|
|
- (this.motor1.phasetemperatuA =
|
|
|
- this.getres()[this.getint()].GasPump1.MotorPhaseTemperatureA),
|
|
|
- (this.motor1.phasetemperatuB =
|
|
|
- this.getres()[this.getint()].GasPump1.MotorPhaseTemperatureB),
|
|
|
- (this.motor1.phasetemperatuC =
|
|
|
- this.getres()[this.getint()].GasPump1.MotorPhaseTemperatureC),
|
|
|
- (this.motor1.epipodiumtem =
|
|
|
- this.getres()[this.getint()].GasPump1.MotorFrontShaftTemperature),
|
|
|
- (this.motor1.backshafttem =
|
|
|
- this.getres()[this.getint()].GasPump1.MotorRearShaftTemperature),
|
|
|
- (this.motor1.reducertem =
|
|
|
- this.getres()[this.getint()].GasPump1.ReducerShaftTemperature);
|
|
|
- if (this.getres()[this.getint()].GasPump1.PumpWaterSupply == "true") {
|
|
|
- this.motor1.oilpressure = 1;
|
|
|
- } else {
|
|
|
- this.motor1.oilpressure = 0;
|
|
|
- }
|
|
|
- (this.motor2.current =
|
|
|
- this.getres()[this.getint()].GasPump2.MotorCurrent),
|
|
|
- (this.motor2.voltage =
|
|
|
- this.getres()[this.getint()].GasPump2.MotorVoltage),
|
|
|
- (this.motor2.motortemperature =
|
|
|
- this.getres()[this.getint()].GasPump2.PumpTemperature),
|
|
|
- (this.motor2.phasetemperatuA =
|
|
|
- this.getres()[this.getint()].GasPump2.MotorPhaseTemperatureA),
|
|
|
- (this.motor2.phasetemperatuB =
|
|
|
- this.getres()[this.getint()].GasPump2.MotorPhaseTemperatureB),
|
|
|
- (this.motor2.phasetemperatuC =
|
|
|
- this.getres()[this.getint()].GasPump2.MotorPhaseTemperatureC),
|
|
|
- (this.motor2.epipodiumtem =
|
|
|
- this.getres()[this.getint()].GasPump2.MotorFrontShaftTemperature),
|
|
|
- (this.motor2.backshafttem =
|
|
|
- this.getres()[this.getint()].GasPump2.MotorRearShaftTemperature),
|
|
|
- (this.motor2.reducertem =
|
|
|
- this.getres()[this.getint()].GasPump2.ReducerShaftTemperature);
|
|
|
- if (this.getres()[this.getint()].GasPump2.PumpWaterSupply == "true") {
|
|
|
- this.motor2.oilpressure = 1;
|
|
|
- } else {
|
|
|
- this.motor2.oilpressure = 0;
|
|
|
- }
|
|
|
- },
|
|
|
- changewebstate1() {
|
|
|
- this.webstate = "1";
|
|
|
-
|
|
|
- this.$emit("statechange", this.webstate);
|
|
|
- },
|
|
|
- changewebstate2() {
|
|
|
- this.webstate = "2";
|
|
|
- this.$emit("statechange", this.webstate);
|
|
|
+ changeWebState(state) {
|
|
|
+ this.$emit("statechange", state);
|
|
|
},
|
|
|
},
|
|
|
};
|