ソースを参照

清空操作队列

xiaohaizhao 1 年間 前
コミット
4b4cd35e19

+ 1 - 1
pages/facility/detail.vue

@@ -30,7 +30,7 @@
                 <tabs :tabs="tabs" @changeTab="changeTab" />
             </view>
             <control ref="设备控制" :detail="detail" @onUpdate="getDetail" />
-            <daily-record ref="设备日志" :w_deviceid="w_deviceid" />
+            <daily-record ref="设备日志" :isfeedback="detail.isfeedback" :w_deviceid="w_deviceid" />
             <preview ref="详情信息" :detail="detail" />
             <alerts ref="告警记录" :w_deviceid="w_deviceid" />
             <view style="height: 30px;" />

+ 5 - 4
pages/facility/modules/dailyRecord.vue

@@ -7,11 +7,9 @@
             <time-horizon @onConfirm="dateRange" />
         </view>
         <record ref="操作记录" :w_deviceid="w_deviceid" />
-        <queue ref="操作队列" :w_deviceid="w_deviceid" />
+        <queue ref="操作队列" :isfeedback="isfeedback" :w_deviceid="w_deviceid" />
         <upload-record ref="上传记录" :w_deviceid="w_deviceid" />
         <up-line-record ref="上线记录" :w_deviceid="w_deviceid" />
-
-
         <u-action-sheet :actions="actions" cancelText="取消" :show="actionShow" @select="selectClick"
             :closeOnClickOverlay="true" :closeOnClickAction="false" @close="actionClose" />
     </view>
@@ -28,7 +26,10 @@ export default {
     components: { record, queue, uploadRecord, upLineRecord },
     name: "dailyRecord",
     props: {
-        w_deviceid: String
+        w_deviceid: String,
+        isfeedback: {
+            type: [String, Number]
+        }
     },
     data() {
         return {

+ 38 - 5
pages/facility/modules/queue.vue

@@ -1,5 +1,11 @@
 <template>
     <view v-show="show">
+        <view v-if="isfeedback && total" class="clear" @click="clearList">
+            <view class="total">共 {{ total }} 条</view>
+            <view class="clear-but" hover-class="navigator-hover">
+                清空队列
+            </view>
+        </view>
         <operate-list :list="list" />
     </view>
 </template>
@@ -11,10 +17,14 @@ export default {
     components: { operateList },
     name: "queue",
     props: {
-        w_deviceid: String
+        w_deviceid: String,
+        isfeedback: {
+            type: [String, Number]
+        }
     },
     data() {
         return {
+            total: 0,
             show: false,
             uninitialized: true,
             list: [],
@@ -47,17 +57,40 @@ export default {
                     paging.pageNumber = res.pageNumber + 1;
                     paging.pageTotal = res.pageTotal;
                     this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data)
+                    this.total = res.total;
                 })
             })
+        },
+        clearList() {
+            let that = this;
+            uni.showModal({
+                title: '提示',
+                content: '是否确定清空操作队列',
+                success: function (res) {
+                    if (res.confirm) that.$Http.basic({
+                        "id": 20231128145402,
+                        "content": {
+                            w_deviceid: that.w_deviceid
+                        }
+                    }).then(res => {
+                        if (that.cutoff(res.msg, '已清空队列')) return;
+                        that.getList(true)
+                    })
+                }
+            });
         }
     },
 }
 </script>
 
 <style lang="scss" scoped>
-.search {
-    position: sticky;
-    top: 34px;
-    z-index: 998;
+.clear {
+    display: flex;
+    justify-content: space-between;
+    color: #fff;
+    width: 100vw;
+    padding: 0 18px 10px;
+    box-sizing: border-box;
+    font-size: 12px;
 }
 </style>