Procházet zdrojové kódy

06设备紧急关闭按钮

xiaohaizhao před 1 rokem
rodič
revize
0eeaea662d

+ 24 - 0
control/components/prodnum-06/prodnum-06.vue

@@ -64,6 +64,30 @@ export default {
                     setTimeout(this.$Http.openNetwork(newVal.params.RSSI.lastvalue), 100)
                     console.error("06信号强度", error)
                 };
+
+                try {
+                    this.$Http.slideshowSetData({
+                        ctrlItem: getCease(this)
+                    })
+                } catch (error) {
+                    setTimeout({
+                        ctrlItem: getCease(this)
+                    }, 100)
+                    console.error("控制按钮", error)
+                };
+
+                function getCease(that) {
+                    let cease = that.__proto__.getControlItem(['cease'], newVal)[0];
+                    if (cease.params.lastvalue == 0) {
+                        cease.showValue = '正常工作中'
+                        cease.background = '#004A92'
+                    } else {
+                        cease.showValue = '紧急关阀中'
+                        cease.background = '#FF7875'
+                    }
+                    return cease
+                }
+
             } else {
 
             }

+ 2 - 1
pages/facility/detail.vue

@@ -80,8 +80,9 @@ export default {
         this.getDetail(true)
         try {
             this.$Http.openNetwork = this.$refs.轮播图.openNetwork;
+            this.$Http.slideshowSetData = this.$refs.轮播图.setData;
         } catch (error) {
-            setTimeout(() => { this.$Http.openNetwork = this.$refs.轮播图.openNetwork; }, 100)
+            setTimeout(() => { this.$Http.openNetwork = this.$refs.轮播图.openNetwork; this.$Http.slideshowSetData = this.$refs.轮播图.setData }, 100)
         };
     },
     methods: {

+ 25 - 1
pages/facility/modules/previewImage.vue

@@ -1,12 +1,17 @@
 <template>
     <view class="container">
         <network v-if="network.show" :num="network.num" :tips="network.tips" />
+        <view v-if="ctrlItem" class="ctrl-but" :style="{ background: ctrlItem.background }" hover-class="navigator-hover"
+            @click.stop="changeItem(ctrlItem)">
+            {{ ctrlItem.showValue }}
+        </view>
         <swiper v-if="list.length" class="swiper" :indicator-dots="list.length > 1" :circular="true" indicator-color="#999"
             indicator-active-color="#fff">
             <swiper-item v-for="(item, index) in list" @click="preview(index)" :key="item.url">
                 <image class="image" :src="item.url" mode="aspectFit" lazy-load="true" />
             </swiper-item>
         </swiper>
+        <My_input ref="MyInput" />
     </view>
 </template>
 <script>
@@ -24,7 +29,8 @@ export default {
                 show: false,
                 num: 0,
                 tips: ""
-            }
+            },
+            ctrlItem: null
         }
     },
     watch: {
@@ -56,6 +62,14 @@ export default {
                 num,
                 tips
             }
+        },
+        setData(params) {
+            for (const key in params) {
+                this[key] = params[key]
+            }
+        },
+        changeItem(item) {
+            this.$refs.MyInput.openInput(item)
         }
     },
 }
@@ -76,5 +90,15 @@ export default {
         }
     }
 
+    .ctrl-but {
+        position: absolute;
+        top: 10px;
+        right: 14px;
+        font-size: 12px;
+        color: #fff;
+        padding: 4px 6px;
+        border-radius: 4px;
+        z-index: 1;
+    }
 }
 </style>