xiaohaizhao 1 år sedan
förälder
incheckning
83e0289f8c

+ 1 - 1
control/components/prodnum-06/modules/basics.vue

@@ -6,7 +6,7 @@
         <view class="current">
             <view class="item" v-for="item in preview" :key="item.paramname">
                 <view class="label">{{ item.paramname }}</view>
-                <view class="value">{{ item.lastvalue }}{{ item.unit || '' }}</view>
+                <view class="value">{{ item.lastvalue || '' }}{{ item.unit || '' }}</view>
             </view>
         </view>
         <view class="show-list">

+ 20 - 5
control/components/prodnum-06/modules/division.vue

@@ -9,7 +9,8 @@
             </view>
             <view class="content">
                 {{ timeControl.showValue }}
-                <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(timeControl)">更新</view>
+                <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(timeControl)">{{
+                    timeControl.isfeedback ? '待更新' : '更新' }}</view>
             </view>
         </view>
         <view class="row" hover-class="navigator-hover" v-for="item in list" :key="item.key" @click="onClick(item)">
@@ -26,6 +27,7 @@
                     <view class="unit">{{ item.params["T" + item.index + "_P"].unit || '' }}</view>
                 </view>
             </view>
+            <view v-if="item.isfeedback" class="dot" />
         </view>
         <My_input ref="MyInput" />
     </view>
@@ -42,7 +44,7 @@ export default {
         }
     },
     methods: {
-        loadData(funs, values, paramsList) {
+        loadData(funs, values, paramsList, isfeedback) {
             model = this.$refs.MyInput;
             let reg = /^T\d{1,5}_P$/,
                 count = 0,
@@ -52,7 +54,7 @@ export default {
             }
             for (let i = 1; i <= count; i++) {
                 let obj = funs[`T${i}`];
-                list.push(Object.assign(obj, {
+                let item = {
                     key: `T${i}_`,
                     index: i,
                     inputType: "dayParting",
@@ -64,10 +66,11 @@ export default {
                         [`T${i}_T`]: paramsList[`T${i}_T`],
                         [`T${i}_P`]: paramsList[`T${i}_P`],
                     }
-                }))
+                };
+                item.isfeedback = (isfeedback && (values[`T${i}_T`] || values[`T${i}_P`])) ? true : false;
+                list.push(Object.assign(obj, item))
             }
             this.list = list;
-            this.timeControl = this.__proto__.getControlItem(["TimeControl"], funs, values, paramsList)[0]
         },
         onClick(item) {
             if (!model) model = this.$refs.MyInput;
@@ -79,6 +82,7 @@ export default {
 
 <style lang="scss" scoped>
 .row {
+    position: relative;
     display: flex;
     padding: 4px 6px 0;
     height: 60px;
@@ -112,5 +116,16 @@ export default {
             }
         }
     }
+
+    .dot {
+        position: absolute;
+        right: 2px;
+        top: 2px;
+        width: 10px;
+        height: 10px;
+        background: #D9001B;
+        border-radius: 50%;
+    }
+
 }
 </style>

+ 18 - 5
control/components/prodnum-06/modules/mpattern.vue

@@ -9,13 +9,14 @@
             </view>
             <view class="content">
                 {{ ctrlModel.showValue }}
-                <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(ctrlModel)">更新</view>
+                <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(ctrlModel)">{{
+                    ctrlModel.isfeedback ? '待更新' : '更新' }}</view>
             </view>
         </view>
 
-        <view class="row" hover-class="navigator-hover" @click="onClick(preview.tar)">
+        <view class="row" v-if="preview" hover-class="navigator-hover" @click="onClick(preview.tar)">
             <view class="box">
-                <view class="label">{{ preview.now.paramname }}</view>
+                <view class="label">{{ preview.now.paramname || '' }}</view>
                 <view class="content">
                     <view class="value">{{ preview.now.lastvalue || '--' }}</view>
                 </view>
@@ -27,6 +28,7 @@
                     <view class="unit">{{ preview.tar.params.unit || '' }}</view>
                 </view>
             </view>
+            <view class="dot" v-if="preview.tar.isfeedback" />
         </view>
 
         <My_input ref="MyInput" />
@@ -37,11 +39,11 @@
 <script>
 let model = null;
 export default {
-    name: "pattern",
+    name: "mpattern",
     data() {
         return {
             ctrlModel: {},
-            preview: []
+            preview: null
         }
     },
     methods: {
@@ -55,6 +57,7 @@ export default {
 
 <style lang="scss" scoped>
 .row {
+    position: relative;
     display: flex;
     padding: 4px 6px 0;
     height: 60px;
@@ -88,5 +91,15 @@ export default {
             }
         }
     }
+
+    .dot {
+        position: absolute;
+        right: 2px;
+        top: 2px;
+        width: 10px;
+        height: 10px;
+        background: #D9001B;
+        border-radius: 50%;
+    }
 }
 </style>

+ 9 - 7
control/components/prodnum-06/prodnum-06.vue

@@ -24,7 +24,7 @@ export default {
             if (newVal) {
                 try {
                     let nameList = ['Flow control', 'pressure control', 'Config', 'Sleep time', 'Pilot valve', 'Minimum', 'MOP']
-                    this.$refs.basics.itemList = this.__proto__.getControlItem(nameList, newVal.function, newVal.paramcmdvalues, newVal.params)
+                    this.$refs.basics.itemList = this.__proto__.getControlItem(nameList, newVal)
                     this.$refs.basics.preview = ['Batt4', 'Batt12', 'BatFlow'].map(v => {
                         return newVal.params[v]
                     })
@@ -33,39 +33,41 @@ export default {
                 }
                 try {
                     let division = this.$refs.division;
-                    division && division.loadData(newVal.function, newVal.paramcmdvalues, newVal.params)
+                    division && division.loadData(newVal.function, newVal.paramcmdvalues, newVal.params, newVal.isfeedback)
+                    division.timeControl = this.__proto__.getControlItem(["TimeControl"], newVal)[0]
                 } catch (error) {
                     console.error("06分时控制", error)
                 }
                 try {
-                    let ctrlModel = this.__proto__.getControlItem(['Ctrl'], newVal.function, newVal.paramcmdvalues, newVal.params, { Ctrl: "radio" })[0]
+                    let ctrlModel = this.__proto__.getControlItem(['Ctrl'], newVal, { Ctrl: "radio" })[0]
                     let preview = [];
                     switch (ctrlModel.params.lastvalue - 0) {
                         case 0:
                             preview = {
                                 now: newVal.params['UpP'],
-                                tar: this.__proto__.getControlItem(['Upstream'], newVal.function, newVal.paramcmdvalues, newVal.params)[0]
+                                tar: this.__proto__.getControlItem(['Upstream'], newVal)[0]
                             }
                             break;
                         case 1:
                             preview = {
                                 now: newVal.params['DownP'],
-                                tar: this.__proto__.getControlItem(['Downstream'], newVal.function, newVal.paramcmdvalues, newVal.params)[0]
+                                tar: this.__proto__.getControlItem(['Downstream'], newVal)[0]
                             }
                             break;
                         case 2:
                             preview = {
                                 now: newVal.params['NowFlow'],
-                                tar: this.__proto__.getControlItem(['Constantflow'], newVal.function, newVal.paramcmdvalues, newVal.params)[0]
+                                tar: this.__proto__.getControlItem(['Constantflow'], newVal)[0]
                             }
                             break;
                         case 3:
                             preview = {
                                 now: newVal.params['MostBad'],
-                                tar: this.__proto__.getControlItem(['unfavorable'], newVal.function, newVal.paramcmdvalues, newVal.params)[0]
+                                tar: this.__proto__.getControlItem(['unfavorable'], newVal)[0]
                             }
                             break;
                     }
+
                     this.$refs.mpattern.ctrlModel = ctrlModel;
                     this.$refs.mpattern.preview = preview;
                 } catch (error) {

+ 6 - 6
control/modules/My_input.vue

@@ -15,7 +15,7 @@
                     <view class="tips" v-if="item.paramValue">
                         <u-icon name="info-circle-fill" color="#E2201A" />
                         <text style="margin-left: 4px;">
-                            有一条待更新记录,待更新值为:{{ item.paramValue }}{{ item.params.unit }}
+                            有一条待更新记录,待更新值为:{{ item.paramValue }}{{ item.params.unit || '' }}
                         </text>
                     </view>
                     <view class="tips" v-if="tips">
@@ -28,7 +28,7 @@
                 <!-- 布尔开关 -->
                 <block v-else-if="item.inputType == 'switch'">
                     <view class="title u-line-1">
-                        {{ item.funcname }}{{ item.params.unit || '' }}
+                        {{ item.funcname || '' }}{{ item.params.unit || '' }}
                     </view>
                     {{ tips }}
                 </block>
@@ -47,14 +47,14 @@
                                 <view class="label">
                                     时间:
                                 </view>
-                                {{ item.params[item.key + 'T'].lastvalue }}
+                                {{ item.params[item.key + 'T'].lastvalue || '请选择时间' }}
                             </view>
                         </picker>
 
                         <view class="row" style="margin-top: 20px">
                             <view class="label">压力:</view>
                             <u--input :focus="dayPartingFocus" v-model="value" type="digit"
-                                :placeholder="item.params[item.key + 'P'].lastvalue" border="surround" />
+                                :placeholder="item.params[item.key + 'P'].lastvalue || '请输入'" border="surround" />
                         </view>
                         <view class="tips" v-if="toBeUpdated">
                             <u-icon name="info-circle-fill" color="#E2201A" />
@@ -73,7 +73,7 @@
                 <!-- 选择 -->
                 <block v-else-if="item.inputType == 'radio'">
                     <view class="title u-line-1">
-                        {{ item.funcname }}{{ item.params[item.key + 'P'].unit || '' }}
+                        {{ item.funcname }}{{ item.params.unit || '' }}
                     </view>
                     <view class="select-box">
                         <view class="item" @click="onSelected(op, item.inputType)"
@@ -225,7 +225,7 @@ export default {
             if (res) {
                 this.show = false;
                 setTimeout(() => {
-                    this.item = null;
+                    // this.item = null;
                 }, 200);
             } else {
                 this.$refs.uModal.loading = false;

+ 2 - 2
control/modules/controlItem.vue

@@ -40,8 +40,8 @@ export default {
         position: absolute;
         right: 2px;
         top: 2px;
-        width: 12px;
-        height: 12px;
+        width: 10px;
+        height: 10px;
         background: #D9001B;
         border-radius: 50%;
     }

+ 1 - 1
pages/facility/modules/control.vue

@@ -60,7 +60,7 @@ export default {
                 this.$Http.devicevaluecheck({
                     "w_deviceid": this.detail.w_deviceid,
                 }).then(res => {
-                    if (res) {
+                    if (res == true) {
                         uni.showModal({
                             title: "通知",
                             content: '设备控制参数已更新',