|
@@ -0,0 +1,116 @@
|
|
|
+<template>
|
|
|
+ <view>
|
|
|
+ <state ref="state" />
|
|
|
+ <view class="control-title">设备参数</view>
|
|
|
+ <preview ref="preview" />
|
|
|
+ <control-panel ref="mpattern" />
|
|
|
+ <view class="control-title">设备监控</view>
|
|
|
+ <pilotLamp ref="pilotLamp" />
|
|
|
+ <view v-if="showAlarms" class="control-title">异常告警</view>
|
|
|
+ <pilotLamp id="pilotLamp" ref="alarms" />
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import controlPanel from "./modules/controlPanel.vue";
|
|
|
+import preview from "./modules/preview.vue";
|
|
|
+import state from "./modules/state.vue";
|
|
|
+import pilotLamp from "../prodnum-MT03/modules/pilotLamp.vue";
|
|
|
+export default {
|
|
|
+ name: 'prodnum-YK01',
|
|
|
+ components: { controlPanel, pilotLamp, preview, state },
|
|
|
+ props: {
|
|
|
+ control: Object
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ showAlarms: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ control: function (newVal) {
|
|
|
+ if (newVal) {
|
|
|
+ console.log('YK01', newVal)
|
|
|
+ //设备状态
|
|
|
+ try {
|
|
|
+ let list = this.__proto__.getControlItem(["open", "close", 'suspend'], newVal);
|
|
|
+ this.$refs.state.list = list.map(v => v.funcname)
|
|
|
+ this.$refs.state.options = list;
|
|
|
+ this.$refs.state.current = list.findIndex(v => v.params.lastvalue);
|
|
|
+ } catch (error) {
|
|
|
+ console.error("YK01设备状态", error);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ this.$refs.preview.list = ["oilpressure", "pipeflow", "position", "closepressure", "closetime", "kv", "flowresistance"].map(v => newVal.params[v])
|
|
|
+ } catch (error) {
|
|
|
+ console.error("YK01设备参数", error)
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ this.$refs.mpattern.itemList = this.__proto__.getControlItem(['open valve', 'Quick Close', 'Slow closing', 'hydraulic', 'pressure'], newVal);
|
|
|
+ } catch (error) {
|
|
|
+ console.error("YK01控制面板", error)
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ this.$refs.pilotLamp.list = [{
|
|
|
+ name: "就地",
|
|
|
+ value: getBoole('local')
|
|
|
+ }, {
|
|
|
+ name: "远程",
|
|
|
+ value: getBoole('remote')
|
|
|
+ }, {
|
|
|
+ name: "全开",
|
|
|
+ value: getBoole('vfopen')
|
|
|
+ }, {
|
|
|
+ name: "全关",
|
|
|
+ value: getBoole('vfclose')
|
|
|
+ }, {
|
|
|
+ name: "无线",
|
|
|
+ value: getBoole('wire')
|
|
|
+ }, {
|
|
|
+ name: "伺服阀",
|
|
|
+ value: getBoole('sopen')
|
|
|
+ }, {
|
|
|
+ name: "1号电磁阀",
|
|
|
+ value: getBoole('solenoid1')
|
|
|
+ }, {
|
|
|
+ name: "2号电磁阀",
|
|
|
+ value: getBoole('solenoid2')
|
|
|
+ }, {
|
|
|
+ name: "3号电磁阀",
|
|
|
+ value: getBoole('solenoid3')
|
|
|
+ }, {
|
|
|
+ name: "4号电磁阀",
|
|
|
+ value: getBoole('solenoid4')
|
|
|
+ }]
|
|
|
+ function getBoole(name, expect = 1) {
|
|
|
+ try {
|
|
|
+ return newVal.paramvalues[name] == expect
|
|
|
+ } catch (error) {
|
|
|
+ console.log("getBoole取值出错项", name)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("YK01指示灯", error)
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ this.$refs.alarms.list = ['oiloverload', 'blockage', 'sopenfault', 'sofffault', 'openfault', 'shutdownfault', 'losspressure', 'hightemp', 'lowlevel', 'accumulator', 'gearpump', 'hydraulic', 'motor', 'servo'].map(key => {
|
|
|
+ let data = newVal.params[key];
|
|
|
+ return {
|
|
|
+ name: data.paramname,
|
|
|
+ value: data.lastvalue,
|
|
|
+ }
|
|
|
+ }).filter(v => v.value);
|
|
|
+ this.showAlarms = this.$refs.alarms.list.length != 0;
|
|
|
+ } catch (error) {
|
|
|
+ console.error("YK01异常告警", error)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style></style>
|