Jelajahi Sumber

设备修改

xiaohaizhao 1 tahun lalu
induk
melakukan
1355ca5d2a

+ 11 - 7
control/components/prodnum-MT02/modules/division.vue

@@ -48,7 +48,7 @@
         </view>
         <My_input ref="MyInput" @customMethod="customMethod">
             <view class="change-item" v-if="changeItem.funcname">
-                <picker mode="time" :value="changeItem.showValue.begin" :end="changeItem.showValue.end" data-name="begin"
+                <picker mode="time" :value="changeItem.showValue.begin" :end="endTime" data-name="begin"
                     @change="timeChange">
                     <view class="row">
                         <view class="label">
@@ -92,7 +92,8 @@ export default {
         return {
             list: [],
             changeItem: {},
-            timeControl: {}
+            timeControl: {},
+            endTime: null
         }
     },
     methods: {
@@ -137,10 +138,13 @@ export default {
             }
             this.list = list;
             this.timeControl = this.__proto__.getControlItem(["TimeCon"], newVal)[0]
+            this.timeControl.changeItem = ['TimeConOFF', 'TimeConON']
         },
         onClick(item) {
-            this.$refs.MyInput.openInput(item, true)
+            console.log("分时控制", item)
+            this.$refs.MyInput.openInput(item, item.inputType != "switch")
             if (this.changeItem.funcname != item.funcname) this.changeItem = JSON.parse(JSON.stringify(item));
+            this.endTime = this.changeItem.showValue.end == '0:0' ? "" : this.changeItem.showValue.end;
             let toBeUpdated = [];
             if (item.paramValue.begin) toBeUpdated.push(`开始时间:${item.paramValue.begin}`);
             if (item.paramValue.end) toBeUpdated.push(`结束时间:${item.paramValue.begin}`);
@@ -166,10 +170,10 @@ export default {
             if ((showValue.value + '').length == 0) return MyInput.submitBreak("还未设定压力")
             showValue.value = (showValue.value - 0).toFixed(params[`T${index}_P`].num_scale)
             MyInput.submit(w_functionid, {
-                [`T${index}H`]: showValue.begin.split(":")[1],
-                [`T${index}M`]: showValue.begin.split(":")[0],
-                [`T${index}H1`]: showValue.end.split(":")[1],
-                [`T${index}M1`]: showValue.end.split(":")[0],
+                [`T${index}H`]: showValue.begin.split(":")[0],
+                [`T${index}M`]: showValue.begin.split(":")[1],
+                [`T${index}H1`]: showValue.end.split(":")[0],
+                [`T${index}M1`]: showValue.end.split(":")[1],
                 [`T${index}_P`]: showValue.value,
             })
         }

+ 7 - 6
control/components/prodnum-MT02/prodnum-MT02.vue

@@ -23,14 +23,15 @@ export default {
                     this.$refs.basics.list = ["MostBad", "FaWei", "NowFlow", "CumFlow"].map(v => newVal.params[v])
                     try {
                         const replenish = {
-                            TimeConOFF: 0,
-                            TimeConON: 0,
+                            TimeConOFF: 1,
+                            TimeConON: 0
                         };
-                        let lastvalue = this.__proto__.getControlItem(["TimeCon"], JSON.parse(JSON.stringify(newVal)))[0].params.options.lastvalue
-                        if (lastvalue == 1) {
-                            replenish.TimeConON = 1;
+                        const TimeConON = this.__proto__.getControlItem(["TimeCon"], JSON.parse(JSON.stringify(newVal)))[0].paramName.TimeConON;
+                        if (TimeConON == 1) {
+                            this.$refs.basics.ctrlModel.showValue = '分时控制模式'
+                            // replenish.TimeConON = 1;
                         } else {
-                            replenish.TimeConOFF = 1;
+                            // replenish.TimeConOFF = 1;
                         }
                         this.$refs.basics.replenish = replenish;
                     } catch (error) {

+ 2 - 4
control/components/prodnum-MT03/modules/division.vue

@@ -42,7 +42,7 @@
                     @change="timeChange">
                     <view class="row">
                         <view class="label">
-                            开始时间:{{ endTime }}
+                            开始时间:
                         </view>
                         <view class="value day-parting-row">{{ changeItem.showValue.begin || ' --' }}
                         </view>
@@ -93,10 +93,8 @@ export default {
             for (const key in newVal.function) {
                 if (reg.test(key)) count++
             }
-
             let Nzh = require("nzh");
             let nzhcn = require("nzh/cn"); //直接使用简体中文
-
             for (let i = 1; i <= count; i++) {
                 let name = Chinese ? nzhcn.encodeS(i) : i;
                 let obj = newVal.function[`时段${i}`],
@@ -143,7 +141,7 @@ export default {
             if (toBeUpdated.length) {
                 model.toBeUpdated = '待更新记录:' + toBeUpdated.join(",")
             }
-            this.$refs.MyInput.openInput(item, true)
+            this.$refs.MyInput.openInput(item, item.inputType != "switch")
             console.log("时段设置", item)
         },
         timeChange(e) {

+ 16 - 1
control/modules/My_input.vue

@@ -283,7 +283,22 @@ export default {
                 if (params.num_minvalue && value < params.num_minvalue) return this.submitBreak("输入值小于最低范围")
                 if (params.num_maxvalue && value > params.num_maxvalue) return this.submitBreak("输入值大于最大范围")
             } else if (item.inputType == "switch") {
-                value = params.options.find(v => v.value != (String(item.paramValue).length ? item.paramValue : item.params.lastvalue)).value
+                let value = item.paramName;
+                try {
+                    if (item.changeItem.length) { }
+                } catch (error) {
+                    item.changeItem = []
+                }
+                if (item.changeItem.length) {
+                    item.changeItem.forEach(key => value[key] = value[key] == 1 ? 0 : 1)
+                } else {
+                    for (const key in value) {
+                        value[key] = value[key] == 1 ? 0 : 1
+                    }
+                }
+                console.log(value)
+                // value = params.options.find(v => v.value != (String(item.paramValue).length ? item.paramValue : item.params.lastvalue)).value
+                return this.submit(item.w_functionid, value)
             } else if (item.inputType == "dayParting") {
                 value = this.value - 0;
                 if (value == 0) return this.submitBreak("还未输入值")

+ 1 - 0
utils/tool.js

@@ -173,6 +173,7 @@ function mount() {
                         };
                     }
                 } else if (list[key].params.datatype == "boolean") {
+                    list[key].paramName = original;
                     list[key].inputType = 'switch';
                     list[key].showValue = "";
                     if (list[key].params.lastvalue + '') list[key].showValue = list[key].params.options.find(v => v.value == list[key].params.lastvalue).label || ""