浏览代码

[update] 首页tab列表数据延迟更新,仅待办tab定时刷新

cfort 2 年之前
父节点
当前提交
fd08eb1188
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11 3
      src/views/system/dashboard/components/new-home.vue

+ 11 - 3
src/views/system/dashboard/components/new-home.vue

@@ -199,7 +199,7 @@
             :pro-inst-id="activeTab === 'save' ? proInstId : null"
             :title="['wait', 'save'].includes(activeTab) ? FlowName : null"
             :processName="processName"
-            @callback="getData(activeTab)"
+            @callback="updateList"
             @close="visible => (dialogFormVisible = visible)"
         />
     </div>
@@ -356,8 +356,10 @@
             }
             // 轮询刷新公告数据和任务数据
             this.timer = setInterval(() => {
-                // this.getMessage()
-                this.getData(this.activeTab)
+                // 仅待办事宜自动更新数据
+                if (this.activeTab === 'wait') {
+                    this.getData(this.activeTab)
+                }
             }, 30 * 1000)
         },
         beforeDestroy() {
@@ -478,6 +480,12 @@
                     this.loading = false
                 })
             },
+            // 延迟更新列表数据
+            updateList () {
+                setTimeout(() => {
+                    this.getData(this.activeTab)
+                }, 750)
+            },
             // 查询
             search() {
                 this.dataList = []