Explorar el Código

yk01添加功能

xiaohaizhao hace 1 año
padre
commit
ca2d5a1a69
Se han modificado 2 ficheros con 13 adiciones y 11 borrados
  1. 7 4
      control/components/prodnum-YK01/prodnum-YK01.vue
  2. 6 7
      utils/tool.js

+ 7 - 4
control/components/prodnum-YK01/prodnum-YK01.vue

@@ -33,7 +33,7 @@ export default {
                 console.log('YK01', newVal)
                 //设备状态
                 try {
-                    let list = this.__proto__.getControlItem(["open", "close", 'suspend'], newVal);
+                    let list = this.__proto__.getControlItem(["open", "close", 'stop'], 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);
@@ -41,12 +41,12 @@ export default {
                     console.error("YK01设备状态", error);
                 }
                 try {
-                    this.$refs.preview.list = ["oilpressure", "pipeflow", "position", "closepressure", "closetime", "kv", "flowresistance"].map(v => newVal.params[v])
+                    this.$refs.preview.list = ["oilpressure", "pipeflow", "position", "closepressure", "closetime", "kv", "flowresistance", 'FMKQS120S'].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);
+                    this.$refs.mpattern.itemList = this.__proto__.getControlItem(['open valve', 'Quick Close', 'Slow closing', 'hydraulic', 'pressure', 'XTYYLC', 'YXYWLC', 'YXWDSXLC', 'YXWDXXLC'], newVal);
                 } catch (error) {
                     console.error("YK01控制面板", error)
                 }
@@ -81,6 +81,9 @@ export default {
                     }, {
                         name: "4号电磁阀",
                         value: getBoole('solenoid4')
+                    }, {
+                        name: "5号电磁阀",
+                        value: getBoole('solenoid5')
                     }]
                     function getBoole(name, expect = 1) {
                         try {
@@ -94,7 +97,7 @@ export default {
                     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 => {
+                    this.$refs.alarms.list = ['oiloverload', 'blockage', 'sopenfault', 'sofffault', 'openfault', 'shutdownfault', 'losspressure', 'hightemp', 'lowlevel', 'accumulator', 'gearpump', 'hydraulic', 'motor', 'servo', 'YWGBJQZTC', 'YWDBJQZTC'].map(key => {
                         let data = newVal.params[key];
                         return {
                             name: data.paramname,

+ 6 - 7
utils/tool.js

@@ -99,14 +99,9 @@ function mount() {
                                 }
                             })
                         }
-
-
                     }
                 })
             }
-
-
-
         })
     };
     Vue.prototype.cutoff = (msg, title = "", mask = false, exitTime = 0, icon = 'none', duration = 2000, ) => {
@@ -134,7 +129,10 @@ function mount() {
         })
     };
     Vue.prototype.getControlItem = (nameList, detail, specialType = {}) => {
-        let list = nameList.map(v => detail.function[v])
+        let list = nameList.map(v => detail.function[v]).filter((v, i) => {
+            if (!v) console.log("未查找到项:", nameList[i])
+            return v
+        })
         for (const key in list) {
             try {
                 let original = list[key].params,
@@ -170,7 +168,8 @@ function mount() {
                     list[key].inputType = list[key].params.num_step ? 'step' : 'int';
                 }
             } catch (error) {
-                console.log("出错项", list[key].funcname, list[key])
+                console.log("出错项", key, list[key])
+                console.log("出错项funcname", list[key].funcname)
             }
         }
         return list