فهرست منبع

修改分析列表刷新

liujiejie 1 ماه پیش
والد
کامیت
d628ec8522
1فایلهای تغییر یافته به همراه28 افزوده شده و 3 حذف شده
  1. 28 3
      src/views/performance/assetssMag.vue

+ 28 - 3
src/views/performance/assetssMag.vue

@@ -466,6 +466,7 @@ export default {
   },
   data() {
     return {
+      firstLoad: false, // 是否是第一次加载
       fieldCodeList: [],
       addDialogVisible: false,
       dialogWidth: "80%",
@@ -527,8 +528,9 @@ export default {
     };
   },
   created() {
-    this.fetchData();
+    this.firstLoad = true;
     window.addEventListener("message", this.handleMessage); //江
+    this.fetchData();
   },
   methods: {
     async handleDownLoadChart() {
@@ -749,6 +751,7 @@ export default {
       if (fieldName !== undefined) {
         this.formInline.fieldName = fieldName;
       }
+
       if (analysisState !== undefined) {
         this.formInline.analysisState = analysisState;
       }
@@ -756,8 +759,20 @@ export default {
         this.formInline.errState = errState;
       }
       if (!this.loading) {
-        this.getTableList();
-        // this.startPolling();
+        console.log(
+          "handleMessage",
+          this.firstLoad,
+          analysisState,
+          errState,
+          fieldName
+        );
+        if (this.firstLoad && (analysisState || errState || fieldName)) {
+          // this.getTableList();
+          this.startPolling();
+          this.fetchData();
+        }
+
+        //
       }
     },
     rowStyle() {
@@ -774,12 +789,22 @@ export default {
     },
     // fetchData 方法在轮询中调用
     async fetchData() {
+      if (
+        this.formInline.fieldName ||
+        this.formInline.analysisState ||
+        this.formInline.errState
+      ) {
+        this.firstLoad = false;
+      }
+      console.log("this.formInline");
       try {
         const result = await analysisResultList({
           ...this.formInline,
           totalSize: undefined,
         });
+        console.log(result, "result");
         this.tableData = result.data.list;
+        console.log(this.tableData, "this.tableData");
         this.formInline.totalSize = result.data.totalSize;
       } catch (error) {
         this.$message({