xiaohaizhao 1 год назад
Родитель
Сommit
2cee10eae0

+ 28 - 20
control/components/prodnum-MT03/modules/division.vue

@@ -38,11 +38,11 @@
         </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">
-                            开始时间:
+                            开始时间:{{ endTime }}
                         </view>
                         <view class="value day-parting-row">{{ changeItem.showValue.begin || ' --' }}
                         </view>
@@ -81,26 +81,32 @@ export default {
     data() {
         return {
             list: [],
-            changeItem: {}
+            changeItem: {},
+            endTime: ""
         }
     },
     methods: {
-        loadData(newVal) {
+        loadData(newVal, Chinese = false) {
             let reg = /^时段\d{1,5}$/,
                 count = 0,
                 list = [];
             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}`],
                     keyList = [
-                        `时段${i}分钟开始`,//0
-                        `时段${i}分钟结束`,//1
-                        `时段${i}小时开始`,//2
-                        `时段${i}小时结束`,//3
-                        `时段${i}流量设定`,//4
-                        `时间段${i}置位`,//5
+                        `时段${name}分钟开始`,//0
+                        `时段${name}分钟结束`,//1
+                        `时段${name}小时开始`,//2
+                        `时段${name}小时结束`,//3
+                        `时段${name}流量设定`,//4
+                        `时间段${name}置位`,//5
                     ],
                     item = {
                         keyList,
@@ -118,7 +124,6 @@ export default {
                         },
                         params: {}
                     };
-
                 keyList.forEach(key => {
                     item.params[key] = newVal.params[key];
                 });
@@ -128,8 +133,8 @@ export default {
             this.list = list;
         },
         onClick(item) {
-            this.$refs.MyInput.openInput(item, true)
-            if (this.changeItem.funcname != item.funcname) this.changeItem = JSON.parse(JSON.stringify(item));
+            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}`);
@@ -137,6 +142,7 @@ export default {
             if (toBeUpdated.length) {
                 model.toBeUpdated = '待更新记录:' + toBeUpdated.join(",")
             }
+            this.$refs.MyInput.openInput(item, true)
         },
         timeChange(e) {
             const name = e.currentTarget.dataset.name;
@@ -148,20 +154,22 @@ export default {
                 w_functionid,
                 params,
                 index,
-                funcname
             } = this.changeItem,
                 MyInput = this.$refs.MyInput;
             if (!showValue.begin) return MyInput.submitBreak("还未填写开始时间")
             if (!showValue.end) return MyInput.submitBreak("还未填写结束时间")
             if ((showValue.value + '').length == 0) return MyInput.submitBreak("还未设定流量")
+            let Nzh = require("nzh");
+            let nzhcn = require("nzh/cn"); //直接使用简体中文
+            let funcname = '时段' + nzhcn.encodeS(index)
             showValue.value = (showValue.value - 0).toFixed(params[funcname + '流量设定'].num_scale)
             MyInput.submit(w_functionid, {
-                "时段1分钟开始": showValue.begin.split(":")[1],
-                "时段1小时开始": showValue.begin.split(":")[0],
-                "时段1分钟结束": showValue.end.split(":")[1],
-                "时段1小时结束": showValue.end.split(":")[0],
-                "时段1流量设定": showValue.value,
-                [`时间段${index}置位`]: params[`时间段${index}置位`].lastvalue
+                [funcname + "分钟开始"]: showValue.begin.split(":")[1],
+                [funcname + "小时开始"]: showValue.begin.split(":")[0],
+                [funcname + "分钟结束"]: showValue.end.split(":")[1],
+                [funcname + "小时结束"]: showValue.end.split(":")[0],
+                [funcname + "流量设定"]: showValue.value,
+                [`时间段${nzhcn.encodeS(index)}置位`]: params[`时间段${nzhcn.encodeS(index)}置位`].lastvalue
             })
         }
     }

+ 38 - 2
control/components/prodnum-MT03/modules/mpattern.vue

@@ -5,11 +5,33 @@
                 {{ ctrlModel.funcname }}
             </view>
             <view class="content" :style="{ color: fColor }">
-                {{ ctrlModel.showValue || '暂未设置' }}
+                <block v-if="ctrlModel.inputType == 'switch'">
+                    {{ switchRes(ctrlModel) }}
+                </block>
+                <block v-else>
+                    {{ ctrlModel.paramValue || ctrlModel.params.lastvalue || '暂未设置' }}
+                </block>
                 <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(ctrlModel)">{{
                     ctrlModel.isfeedback ? '待更新' : '更新' }}</view>
             </view>
         </view>
+
+        <view class="update-line" v-for="item in list" :key="item.paramName">
+            <view class="label" :style="{ color: fColor }">
+                {{ item.funcname }}
+            </view>
+            <view class="content" :style="{ color: fColor }">
+                <block v-if="item.inputType == 'switch'">
+                    {{ switchRes(item) }}
+                </block>
+                <block v-else>
+                    {{ item.paramValue || item.params.lastvalue || '暂未设置' }}
+                </block>
+                <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(item)">{{
+                    item.isfeedback ? '待更新' : '更新' }}</view>
+            </view>
+        </view>
+
         <My_input ref="MyInput" />
     </view>
 </template>
@@ -25,7 +47,21 @@ export default {
     },
     data() {
         return {
-            ctrlModel: {}
+            ctrlModel: {},
+            list: []
+        }
+    },
+    computed: {
+        switchRes: function () {
+            return item => {
+                try {
+                    if (item.showValue) return item.showValue;
+                    let value = item.paramValue || item.params.lastvalue,
+                        res = item.params.options.find(v => v.value == value);
+                    return res ? res.label : '暂未设置'
+                } catch (error) {
+                }
+            }
         }
     },
     methods: {

+ 0 - 1
control/components/prodnum-MT03/modules/pilotLamp.vue

@@ -46,7 +46,6 @@ export default {
                 position: absolute;
                 top: 3px;
                 left: 3px;
-                z-index: 9;
                 animation: lampBackground .5s infinite alternate ease-in-out;
             }
 

+ 19 - 4
control/components/prodnum-MT03/modules/tabs.vue

@@ -91,7 +91,8 @@ export default {
                     console.error("关断设置", error)
                 }
                 try {
-                    this.bjszList = this.__proto__.getControlItem(["失压警告", "失压警告设定", "失压报警", "失压报警设定", "超流量警告", "超流量警告设定", "超流量报警", "超流量报警设定"], newVal)
+                    this.bjszList = this.__proto__.getControlItem(["失压警告", "失压警告设定", "失压报警", "失压报警设定", "超流量警告", "超流量警告设定", "超流量报警", "超流量报警设定"], newVal, { 失压警告: "switch", 失压报警: "switch", 超流量警告: "switch", 超流量报警: "switch" })
+                    console.log(" this.bjszList", this.bjszList)
                 } catch (error) {
                     console.error("报警设置", error)
                 }
@@ -103,7 +104,13 @@ export default {
                 }
                 try {
                     this.plc = this.__proto__.getControlItem(['PLC时钟'], newVal, { Ctrl: "datatime" })[0];
-                    this.plclastvalue = this.plc.params.lastvalue;
+                    let date = { 年: null, 月: null, 日: null, 时: null, 分: null, 秒: null }
+                    for (const key in date) {
+                        let lastvalue = newVal.params[key].lastvalue
+                        date[key] = lastvalue > 10 ? lastvalue : "0" + lastvalue
+                    };
+                    this.plclastvalue = `${date.年}-${date.月}-${date.日} ${date.时}:${date.分}:${date.秒}`;
+                    this.plc.params.lastvalue = this.plclastvalue;
                 } catch (error) {
                     console.error("PLC时钟", error)
                 }
@@ -115,16 +122,24 @@ export default {
             this.showPage = e.name;
         },
         onClick(item) {
+            console.log(item)
             this.$refs.MyInput.openInput(item)
         },
         onCancel(e) {
             this.datetimeShow = false;
         },
         async onConfirm(e) {
-            let date = formatTime(new Date(e.value)),
+            let date = formatTime(new Date(e.value)).split(" "),
                 plc = this.plc;
+            date = date[0].split("-").concat(date[1].split(":"))
             let res = await this.$Http.setControlItem(plc.w_functionid, {
-                [`${plc.paramName}`]: date
+                "年": date[0],
+                "月": date[1],
+                "日": date[2],
+                "时": date[3],
+                "分": date[4],
+                "秒": date[5],
+                "同步时间": 0
             });
             this.datetimeShow = false;
         }

+ 12 - 3
control/components/prodnum-MT03/prodnum-MT03.vue

@@ -27,10 +27,10 @@ export default {
                 try {
                     this.$refs.pilotLamp.list = [{
                         name: "就地",
-                        value: getBoole('自动信号')
+                        value: getBoole('执行器就地_远程信号', 0)
                     }, {
                         name: "远程",
-                        value: getBoole('自动信号', 0)
+                        value: getBoole('执行器就地_远程信号')
                     }, {
                         name: "开到位",
                         value: getBoole('开到位')
@@ -64,6 +64,7 @@ export default {
                     }]
                     function getBoole(name, expect = 1) {
                         try {
+                            console.log(name, newVal.paramvalues[name])
                             return newVal.paramvalues[name] == expect
                         } catch (error) {
                             console.error("getBoole取值出错项", name)
@@ -76,12 +77,20 @@ export default {
                 }
                 try {
                     this.$refs.控制方式.ctrlModel = this.__proto__.getControlItem(['控制方式'], newVal, { Ctrl: "radio" })[0];
+                    if (this.$refs.控制方式.ctrlModel.showValue == '自动调节') {
+                        let arr = [this.__proto__.getControlItem(['自动控制'], newVal, { '自动控制': "switch" })[0]];
+                        if (arr[0].params.lastvalue == 0) arr.push(this.__proto__.getControlItem(['手动流量设置'], newVal)[0])
+                        this.$refs.控制方式.list = arr;
+                    } else {
+                        this.$refs.控制方式.list = [this.__proto__.getControlItem(['手动开度设置'], newVal)[0]]
+                    }
+                    console.log(this.$refs.控制方式.list)
                 } catch (error) {
                     console.error("MT03控制方式", error)
                 }
                 try {
                     let division = this.$refs.division;
-                    division && division.loadData(newVal)
+                    division && division.loadData(newVal, true)
                 } catch (error) {
                     console.error("MT03分时控制", error)
                 }

+ 3 - 7
control/modules/My_input.vue

@@ -193,7 +193,8 @@ export default {
                         this.switchTips = `查询到“${item.funcname}”有待更新记录,待更新值为“${params.options.find(v => v.value == item.paramValue).label}”;您可通过“${this.confirmText}”按钮取消待更新请求`
                     } else {
                         this.confirmText = '切换'
-                        this.switchTips = `是否将“${item.funcname}”${this.confirmText}为:“${params.options.find(v => v.value != item.paramValue).label}”`
+                        console.log("paramValue", item.paramValue)
+                        this.switchTips = `是否将“${item.funcname}”${this.confirmText}为:“${params.options.find(v => v.value != (String(item.paramValue).length ? item.paramValue : item.params.lastvalue)).label}”`
                     }
                 } else if (item.inputType == "dayParting") {
                     this.value = item.params[item.key + 'p'] || '';
@@ -280,12 +281,7 @@ 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") {
-                let paramValue = item.paramValue + "";
-                if (paramValue.length) {
-                    value = paramValue == 1 ? 0 : 1
-                } else {
-                    value = item.params.lastvalue == 1 ? 0 : 1
-                }
+                value = params.options.find(v => v.value != (String(item.paramValue).length ? item.paramValue : item.params.lastvalue)).value
             } else if (item.inputType == "dayParting") {
                 value = this.value - 0;
                 if (value == 0) return this.submitBreak("还未输入值")

+ 17 - 1
control/modules/controlItem.vue

@@ -4,7 +4,10 @@
             {{ item.funcname }}
         </view>
         <view class="row">
-            <view class="value u-line-1">{{ item.showValue || item.params.lastvalue || ' --' }}</view>
+            <view v-if="item.inputType == 'switch'" class="value u-line-1">
+                {{ switchRes(item) }}
+            </view>
+            <view v-else class="value u-line-1">{{ item.showValue || item.params.lastvalue || ' --' }}</view>
             <view class="unit u-line-1">{{ item.params.unit }}</view>
         </view>
         <view v-if="item.isfeedback" class="dot" />
@@ -16,6 +19,19 @@ export default {
     name: "ControlItem",
     props: {
         item: Object
+    },
+    computed: {
+        switchRes: function () {
+            return item => {
+                try {
+                    if (item.showValue) return item.showValue;
+                    let value = item.paramValue || item.params.lastvalue,
+                        res = item.params.options.find(v => v.value == value);
+                    return res ? res.label : '暂未设置'
+                } catch (error) {
+                }
+            }
+        }
     }
 }
 </script>

Разница между файлами не показана из-за своего большого размера
+ 4557 - 7
package-lock.json


+ 15 - 31
pages/facility/modules/uploadRecord.vue

@@ -6,20 +6,6 @@
                 {{ item.content }}
             </view>
         </view>
-
-        <u-modal :show="modleShow" confirmText="复制" cancelText="关闭" :showCancelButton="true" @cancel="onCancel"
-            @confirm="onConfirm">
-            <template slot="default">
-                <view>
-                    <view style="width: 100%;text-align: center;font-weight: bold;margin-bottom: 20px;">
-                        {{ modle.createdate }}
-                    </view>
-                    <view style="word-break: break-all;">
-                        {{ modle.content }}
-                    </view>
-                </view>
-            </template>
-        </u-modal>
     </view>
 </template>
 
@@ -39,8 +25,6 @@ export default {
                 "begindate": "",
                 "enddate": ""
             },
-            modle: {},
-            modleShow: false
         }
     },
     methods: {
@@ -70,22 +54,22 @@ export default {
             })
         },
         openModel(item) {
-            this.modle = item;
-            this.modleShow = true;
+            uni.showModal({
+                title: item.createdate,
+                content: item.content,
+                cancelText: '关闭',
+                confirmText: '复制',
+                confirmColor: '#2979ff',
+                success: (result) => {
+                    if (result.confirm) uni.setClipboardData({
+                        data: item.content,
+                        complete: (res) => {
+                            console.log("复制", res)
+                        },
+                    })
+                }
+            });
 
-        },
-        onCancel() {
-            this.modleShow = false;
-        },
-        onConfirm() {
-            let that = this;
-            uni.setClipboardData({
-                data: this.modle.content,
-                complete: (res) => {
-                    console.log("复制", res)
-                    this.onCancel();
-                },
-            })
         }
     },
 }

+ 1 - 1
uni_modules/uview-ui/components/u-number-box/u-number-box.vue

@@ -39,7 +39,7 @@
 			    @blur="onBlur"
 			    @focus="onFocus"
 			    @input="onInput"
-			    type="number"
+			    :type="decimalLength >= 1 ? 'digit' : 'number'"
 			    :style="[inputStyle]"
 			/>
 		</slot>

Некоторые файлы не были показаны из-за большого количества измененных файлов