소스 검색

fix: 图表刷新后更新tableData所有信息

Karsa 3 달 전
부모
커밋
67e0b2ef31
3개의 변경된 파일14개의 추가작업 그리고 49개의 파일을 삭제
  1. 4 38
      src/views/dataEntry_manage/chartSetting.vue
  2. 2 0
      src/views/dataEntry_manage/databaseList.vue
  3. 8 11
      src/views/mychart_manage/components/chartDetailDia.vue

+ 4 - 38
src/views/dataEntry_manage/chartSetting.vue

@@ -1878,16 +1878,9 @@ export default {
       }
 
       const { EdbInfoList } = res.Data;
-
-      this.tableData.forEach((item) => {
-        let edbData = EdbInfoList.find(_ => _.EdbInfoId===item.EdbInfoId);
-        item.DataList = edbData.DataList;
-        //更新起始时间和最近更新时间
-        item.StartDate = edbData.StartDate;
-        item.ModifyTime = edbData.ModifyTime;
-
-        if(edbData.EdbInfoCategoryType===1) item.MoveLatestDate = edbData.MoveLatestDate;
-      });
+      
+      //更新表格数据
+      this.tableData = _.cloneDeep(EdbInfoList);
     },
 
     /* 搜索 */
@@ -2160,34 +2153,7 @@ export default {
         })
         .catch(() => {});
     },
-    /* 图表未保存时更新图表数据 */
-    refreshTarget() {
-      for (let i in this.tableData) {
-        let params = {
-          EdbInfoId: this.tableData[i].EdbInfoId,
-          DateType: this.year_select,
-          StartDate:
-            this.year_select === 5 || this.year_select === 6
-              ? this.select_date[0]
-              : '',
-          EndDate: this.year_select === 5 ? this.select_date[1] : '',
-          EdbInfoType: this.tableData[i].EdbInfoType,
-          LeadValue: this.tableData[i].EdbInfoType
-            ? 0
-            : this.tableData[i].LeadValue,
-          LeadUnit: this.tableData[i].EdbInfoType
-            ? ''
-            : this.tableData[i].LeadUnit,
-        };
-        dataBaseInterface.edbinfoDetail(params).then((res) => {
-          if (res.Ret === 200) {
-            let newData = res.Data.EdbInfo;
-            this.tableData[i].DataList = newData.DataList;
-            if(newData.EdbInfoCategoryType===1) this.tableData[i].MoveLatestDate = newData.MoveLatestDate;
-          }
-        });
-      }
-    },
+
     /* 年份改变 重新刷新图表接口  保存当前的图表配置和上下限 只改变图表 */
     changeYear(item) {
       this.year_select = item.value;

+ 2 - 0
src/views/dataEntry_manage/databaseList.vue

@@ -1460,6 +1460,8 @@ export default {
 
 						this.page_no = 1;
 						this.getDataList('refresh')
+						
+						this.$refs.createChart && this.$refs.createChart.getDataByPath()
 					}else{
 						this.loading.close();
 					}

+ 8 - 11
src/views/mychart_manage/components/chartDetailDia.vue

@@ -100,8 +100,12 @@
                 />
                 <!-- 复制到 -->{{$t('Chart.chart_copyto_btn')}}
               </span>
-              <span v-permission="permissionBtn.myETAPermission.myChart_refresh"
-                  class="span-item" @click="refreshHandle" style="margin-left: 7px;">
+              <span 
+                v-permission="permissionBtn.myETAPermission.myChart_refresh"
+                class="span-item" 
+                @click="refreshHandle" 
+                style="margin-left: 7px;"
+              >
                 <span><i class="el-icon-refresh" style="font-size: 15px;"/>&nbsp;<!-- 刷新 -->{{$t('Edb.detail_refresh_btn')}} </span>
               </span>
               <span
@@ -811,15 +815,8 @@ export default {
       }
       const { EdbInfoList } = res.Data;
 
-      this.tableData.forEach((item) => {
-        let edbData = EdbInfoList.find(_ => _.EdbInfoId===item.EdbInfoId);
-        item.DataList = edbData.DataList;
-        //更新起始时间和最近更新时间
-        item.StartDate = edbData.StartDate;
-        item.ModifyTime = edbData.ModifyTime;
-        
-        if(edbData.EdbInfoCategoryType===1) item.MoveLatestDate = edbData.MoveLatestDate;
-      });
+      //更新表格数据
+      this.tableData = _.cloneDeep(EdbInfoList);
     },
 
     /* 打开时间段弹窗 */