浏览代码

优化: 弃用eta图库根据id和筛选项刷数据再刷指标数据,新增一个预览接口替代

Karsa 1 年之前
父节点
当前提交
95d47b62e9

+ 38 - 0
src/api/modules/chartApi.js

@@ -810,8 +810,46 @@ const dataBaseInterface = {
 	 */
 	getEDBInfoCalculateMap:params=>{
 		return http.get('/datamanage/edb_info/calculate/mapping',params)
+	},
+
+	/* eta图库 图表预览  启用之前根据传参刷数据的详情接口 
+		{
+			ChartType:1,
+			"ChartEdbInfoList": [
+					{
+							"EdbInfoId": 102767,
+							"EdbInfoType": 1,
+							"LeadUnit": "",
+							"LeadValue": 0,
+					},
+					{
+							"EdbInfoId": 102769,
+							"EdbInfoType": 1,
+							"LeadUnit": "",
+							"LeadValue": 0,
+					}
+			],
+			"DateType": 3,
+			"StartDate": "",
+			"EndDate": "",
+			Calendar
+			SeasonStartDate
+			SeasonEndDate
 	}
+	*/
+	getSplinePreviewData: params => {
+		return http.post('/datamanage/chart_info/detail/preview',params)
+	},
 
+	/**
+	 * 获取图表信息 在eta图库内替换上面的图表详情接口
+	 * @param {*} params ChartInfoId
+	 * @returns 
+	 */
+	getChartInfoById: params => {
+		return http.get('/datamanage/chart_info/detail/v2',params)
+	},
+	
 }
 
 /* 我的图库 */

+ 5 - 5
src/views/dataEntry_manage/addChart.vue

@@ -150,7 +150,7 @@
                   <el-radio
                     v-model="item.EdbInfoType"
                     :label="1"
-                    @change="refreshTarget"
+                    @change="getPreviewSplineInfo"
                     >标准指标</el-radio
                   >
                   <div style="margin-top: 15px">
@@ -158,7 +158,7 @@
                       v-model="item.EdbInfoType"
                       :label="0"
                       style="margin-right: 10px"
-                      @change="refreshTarget"
+                      @change="getPreviewSplineInfo"
                       >领先指标</el-radio
                     >
                     <template v-if="item.EdbInfoType === 0">
@@ -169,7 +169,7 @@
                         type="number"
 												min="0"
                         v-model="item.LeadValue"
-                        @change="refreshTarget"
+                        @change="getPreviewSplineInfo"
                         @keyup.native="filterCode(item)"
                       ></el-input>
                       <el-select
@@ -177,7 +177,7 @@
                         placeholder=""
                         style="width: 60px"
                         size="mini"
-                        @change="refreshTarget"
+                        @change="getPreviewSplineInfo"
                       >
                         <el-option
                           v-for="item in fre_options"
@@ -411,7 +411,7 @@
 							v-model="calendar_type"
 							class="calendar-cont"
 							v-if="chartInfo.ChartType === 2"
-							@change="refreshChart"
+							@change="getPreviewSplineInfo"
 						>
 							<el-radio-button label="公历" />
 							<el-radio-button label="农历" />

+ 174 - 98
src/views/dataEntry_manage/chartSetting.vue

@@ -199,7 +199,7 @@
                   <el-radio
                     v-model="item.EdbInfoType"
                     :label="1"
-                    @change="refreshTarget"
+                    @change="getPreviewChartInfo"
                     >标准指标</el-radio
                   >
                   <div style="margin-top: 15px">
@@ -207,7 +207,7 @@
                       v-model="item.EdbInfoType"
                       :label="0"
                       style="margin-right: 10px"
-                      @change="refreshTarget"
+                      @change="getPreviewChartInfo"
                       >领先指标</el-radio
                     >
                     <template v-if="item.EdbInfoType === 0">
@@ -218,7 +218,7 @@
                         type="number"
                         min="0"
                         v-model="item.LeadValue"
-                        @change="refreshTarget"
+                        @change="getPreviewChartInfo"
                         @keyup.native="filterCode(item)"
                       ></el-input>
                       <el-select
@@ -226,7 +226,7 @@
                         placeholder=""
                         style="width: 60px"
                         size="mini"
-                        @change="refreshTarget"
+                        @change="getPreviewChartInfo"
                       >
                         <el-option
                           v-for="item in fre_options"
@@ -466,7 +466,7 @@
                     v-model="calendar_type"
                     class="calendar-cont"
                     v-if="chartInfo.ChartType === 2"
-                    @change="getChartInfo"
+                    @change="getPreviewChartInfo"
                   >
                     <el-radio-button label="公历" />
                     <el-radio-button label="农历" />
@@ -849,7 +849,7 @@ export default {
     },
     selected_chartid(newval) {
       if (!newval) {
-        // this.year_select = 3;
+
         this.year_select = this.yearSelector[0].value;
         this.calendar_type = '公历';
         this.season_year = '';
@@ -858,7 +858,7 @@ export default {
       } else {
         sessionStorage.removeItem('beforeOptions');
         
-        newval && this.getChartInfo();
+        newval && this.getChartDetail();
         this.formItemArray=[]
       }
     },
@@ -1233,8 +1233,7 @@ export default {
     sucessCallback(type) {
       this.isOpenDialog = false;
       this.getTreeData();
-      // type && this.getDataList();
-      this.selected_chartid && this.getChartInfo();
+
       if (type === 'add') {
         //新增分类完成之后,展开父节点显示刚新增的分类,若已展开节点则不做处理
         let code = sessionStorage.getItem('expandCode');
@@ -1525,87 +1524,164 @@ export default {
 			}
 		},
 
+    /* 获取图表详情 回显参数 */
+    async getChartDetail() {
+      const res = await dataBaseInterface.getChartInfoById({
+          ChartInfoId: this.selected_chartid
+        })
+        
+      if (res.Ret !== 200) return;
+      this.chartInfo = res.Data.ChartInfo;
+      
+
+      this.tableData = res.Data.EdbInfoList;
+      this.setDefaultDateSelect(); //设置默认的日期选中
+
+      sessionStorage.setItem('defaultArr',JSON.stringify(res.Data.EdbInfoList));
+
+      const chartTypeMap = {
+        7: this.initBarData, //柱形图
+        10: this.initSectionScatterData //截面散点
+      }
+      chartTypeMap[this.chartInfo.ChartType] && chartTypeMap[this.chartInfo.ChartType](res.Data);
+
+      //将指标添加进标签列表中
+      const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo
+      this.addLabel({code:UniqueCode,id:ChartInfoId,classifyId:ChartClassifyId,EdbName:ChartName,EdbNameEn:ChartNameEn,chartData:res.Data.ChartInfo})
+      this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId)
+      this.changeTreeNode()
+    },
+
+    /* 设置默认时间选中项 */
+    setDefaultDateSelect() {
+      this.year_select = this.chartInfo.DateType;
+      this.select_date = [this.chartInfo.StartDate, this.chartInfo.EndDate];
+      this.calendar_type = this.chartInfo.Calendar; //日历类型
+      this.season_year = [
+        this.chartInfo.SeasonStartDate,
+        this.chartInfo.SeasonEndDate,
+      ];
+      this.dateTip =
+        this.chartInfo.DateType === 5
+          ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
+          : this.chartInfo.DateType === 6
+          ? `${this.chartInfo.StartDate}~至今`
+          : '请选择时间段';
+    },
+
     /* 获取图表详情信息  type为refresh刷新指标不存储时间 */
-    getChartInfo(type) {
-      // 判断图标类型 设置参数
-      let params =
-        this.sameOptionType.includes(this.selected_chartType)
-          ? {
-              ChartInfoId: this.selected_chartid,
-              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] : '',
-            }
-          : {
-              ChartInfoId: this.selected_chartid,
-              Calendar: this.calendar_type,
-              SeasonStartDate: this.season_year ? this.season_year[0] : '',
-              SeasonEndDate: this.season_year ? this.season_year[1] : '',
-            };
-      dataBaseInterface.chartInfo(params).then((res) => {
-        if (res.Ret === 200) {
-          this.chartInfo = res.Data.ChartInfo;
-          let beforeOptions = sessionStorage.getItem('beforeOptions')
-            ? JSON.parse(sessionStorage.getItem('beforeOptions'))
-            : '';
-          //合并缓存配置和新的数据
-          let newarr = res.Data.EdbInfoList.map((item, index) => {
-            if (beforeOptions && type === 'refresh') {
-              const DataList = item.DataList;
-              return {
-                ...beforeOptions[index],
-                DataList,
-              };
-            } else {
-              return item;
-            }
-          });
-          this.tableData = newarr;
-          //  刷新最新的指标数据 防止领先配置已保存 指标数据确实原数据的情况 针对正常图
-          if (
-            type === 'refresh' &&
-            beforeOptions &&
-            (this.sameOptionType.includes(this.chartInfo.ChartType) && this.chartInfo.ChartType!==5)
-          )
-            this.refreshTarget();
-          sessionStorage.setItem(
-            'defaultArr',
-            JSON.stringify(res.Data.EdbInfoList)
-          );
-          if (!type) {
-            this.year_select = this.chartInfo.DateType;
-            this.select_date = [
-              this.chartInfo.StartDate,
-              this.chartInfo.EndDate,
-            ];
-            this.calendar_type = this.chartInfo.Calendar; //日历类型
-            // this.season_year = [ this.chartInfo.SeasonStartDate, this.chartInfo.SeasonEndDate ];
-            this.dateTip =
-              this.chartInfo.DateType === 5
-                ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
-                : this.chartInfo.DateType === 6
-                ? `${this.chartInfo.StartDate}~至今`
-                : '请选择时间段';
-
-            //新图表类型 依赖数据不同单独init 数据
-            const typeInitMap = {
-              7: this.initBarData,
-              10: this.initSectionScatterData
-            }
-            typeInitMap[this.chartInfo.ChartType] && typeInitMap[this.chartInfo.ChartType](res.Data);
+    async getPreviewChartInfo(type) {
+      let params = {
+        ChartType: this.chartInfo.ChartType,
+        DateType: this.year_select,
+        StartDate: [5, 6].includes(this.year_select)
+          ? this.select_date[0]
+          : '',
+        EndDate: this.year_select === 5 ? this.select_date[1] : '',
+        Calendar: this.calendar_type,
+        SeasonStartDate: this.season_year ? this.season_year[0] : '',
+        SeasonEndDate: this.season_year ? this.season_year[1] : '',
+        ChartEdbInfoList: this.tableData.map(_ => ({
+          EdbInfoId: _.EdbInfoId,
+          EdbInfoType: _.EdbInfoType,
+          LeadValue: _.EdbInfoType ? 0 : Number(_.LeadValue),
+          LeadUnit: _.EdbInfoType ? '' : _.LeadUnit,
+        }))
+      }
+
+      const res = await dataBaseInterface.getSplinePreviewData(params)
+
+      if(res.Ret !== 200) return
+
+      const { EdbInfoList } = res.Data;
+
+      this.tableData.forEach((item) => {
+        let edbData = EdbInfoList.find(_ => _.EdbInfoId===item.EdbInfoId);
+        item.DataList = edbData.DataList;
+        if(edbData.EdbInfoCategoryType===1) item.MoveLatestDate = edbData.MoveLatestDate;
+      });
+
+
+
+      // // 判断图标类型 设置参数
+      // let params =
+      //   this.sameOptionType.includes(this.selected_chartType)
+      //     ? {
+      //         ChartInfoId: this.selected_chartid,
+      //         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] : '',
+      //       }
+      //     : {
+      //         ChartInfoId: this.selected_chartid,
+      //         Calendar: this.calendar_type,
+      //         SeasonStartDate: this.season_year ? this.season_year[0] : '',
+      //         SeasonEndDate: this.season_year ? this.season_year[1] : '',
+      //       };
+      // dataBaseInterface.chartInfo(params).then((res) => {
+      //   if (res.Ret === 200) {
+      //     this.chartInfo = res.Data.ChartInfo;
+      //     let beforeOptions = sessionStorage.getItem('beforeOptions')
+      //       ? JSON.parse(sessionStorage.getItem('beforeOptions'))
+      //       : '';
+      //     //合并缓存配置和新的数据
+      //     let newarr = res.Data.EdbInfoList.map((item, index) => {
+      //       if (beforeOptions && type === 'refresh') {
+      //         const DataList = item.DataList;
+      //         return {
+      //           ...beforeOptions[index],
+      //           DataList,
+      //         };
+      //       } else {
+      //         return item;
+      //       }
+      //     });
+      //     this.tableData = newarr;
+      //     //  刷新最新的指标数据 防止领先配置已保存 指标数据确实原数据的情况 针对正常图
+      //     if (
+      //       type === 'refresh' &&
+      //       beforeOptions &&
+      //       (this.sameOptionType.includes(this.chartInfo.ChartType) && this.chartInfo.ChartType!==5)
+      //     )
+      //       this.refreshTarget();
+      //     sessionStorage.setItem(
+      //       'defaultArr',
+      //       JSON.stringify(res.Data.EdbInfoList)
+      //     );
+      //     if (!type) {
+      //       this.year_select = this.chartInfo.DateType;
+      //       this.select_date = [
+      //         this.chartInfo.StartDate,
+      //         this.chartInfo.EndDate,
+      //       ];
+      //       this.calendar_type = this.chartInfo.Calendar; //日历类型
+      //       // this.season_year = [ this.chartInfo.SeasonStartDate, this.chartInfo.SeasonEndDate ];
+      //       this.dateTip =
+      //         this.chartInfo.DateType === 5
+      //           ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
+      //           : this.chartInfo.DateType === 6
+      //           ? `${this.chartInfo.StartDate}~至今`
+      //           : '请选择时间段';
+
+      //       //新图表类型 依赖数据不同单独init 数据
+      //       const typeInitMap = {
+      //         7: this.initBarData,
+      //         10: this.initSectionScatterData
+      //       }
+      //       typeInitMap[this.chartInfo.ChartType] && typeInitMap[this.chartInfo.ChartType](res.Data);
             
-          }
-          //将指标添加进标签列表中
-            const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo
-            this.addLabel({code:UniqueCode,id:ChartInfoId,classifyId:ChartClassifyId,EdbName:ChartName,EdbNameEn:ChartNameEn,chartData:res.Data.ChartInfo})
-            this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId)
-            this.changeTreeNode()
-        }
+      //     }
+      //     //将指标添加进标签列表中
+      //       const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo
+      //       this.addLabel({code:UniqueCode,id:ChartInfoId,classifyId:ChartClassifyId,EdbName:ChartName,EdbNameEn:ChartNameEn,chartData:res.Data.ChartInfo})
+      //       this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId)
+      //       this.changeTreeNode()
+      //   }
         
-      });
+      // });
     },
 
     /* 搜索 */
@@ -1893,7 +1969,7 @@ export default {
       //保存表格配置和上下限 曲线图需要保存表格配置 季节图就不用了
       this.saveNowOptions();
       // 图表已存在
-      this.selected_chartid && this.getChartInfo('refresh');
+      this.selected_chartid && this.getPreviewChartInfo();
     },
     /* 打开时间段弹窗 */
     openDateDia() {
@@ -1919,7 +1995,7 @@ export default {
         this.dateTip = `${data.start_date}~至今`;
       }
       this.saveNowOptions();
-      this.getChartInfo('refresh');
+      this.getPreviewChartInfo();
     },
 
     /* 编辑图表 跳转 */
@@ -2057,18 +2133,18 @@ export default {
     },
     /* 保存图表当前配置项 上下限 */
     saveNowOptions() {
-      const dataArr = _.cloneDeep(this.tableData);
-      dataArr.forEach((item) => {
-        item.MaxData = Number(item.MaxData);
-        item.MinData = Number(item.MinData);
-        delete item.DataList;
-      });
-      sessionStorage.setItem('beforeOptions', JSON.stringify(dataArr));
+      // const dataArr = _.cloneDeep(this.tableData);
+      // dataArr.forEach((item) => {
+      //   item.MaxData = Number(item.MaxData);
+      //   item.MinData = Number(item.MinData);
+      //   delete item.DataList;
+      // });
+      // sessionStorage.setItem('beforeOptions', JSON.stringify(dataArr));
     },
     /* 季节图切换年份  保持当前配置 */
     seasonYearChange() {
       this.saveNowOptions();
-      this.getChartInfo('refresh');
+      this.getPreviewChartInfo();
     },
     /* 一键刷新 超长等待..*/
     refreshHandle() {
@@ -2086,7 +2162,7 @@ export default {
         .then((res) => {
           this.refreshLoading.close();
           if (res.Ret === 200) {
-            this.getChartInfo('refresh');
+            this.getPreviewChartInfo();
             this.$message.success(res.Msg);
           }
         });

+ 5 - 5
src/views/dataEntry_manage/editChart.vue

@@ -155,7 +155,7 @@
                   <el-radio
                     v-model="item.EdbInfoType"
                     :label="1"
-                    @change="refreshTarget"
+                    @change="getPreviewSplineInfo"
                     >标准指标</el-radio
                   >
                   <div style="margin-top: 15px">
@@ -163,7 +163,7 @@
                       v-model="item.EdbInfoType"
                       :label="0"
                       style="margin-right: 10px"
-                      @change="refreshTarget"
+                      @change="getPreviewSplineInfo"
                       >领先指标</el-radio
                     >
                     <template v-if="item.EdbInfoType === 0">
@@ -174,7 +174,7 @@
                         type="number"
 												min="0"
                         v-model="item.LeadValue"
-                        @change="refreshTarget"
+                        @change="getPreviewSplineInfo"
                         @keyup.native="filterCode(item)"
                       ></el-input>
                       <el-select
@@ -182,7 +182,7 @@
                         placeholder=""
                         style="width: 60px"
                         size="mini"
-                        @change="refreshTarget"
+                        @change="getPreviewSplineInfo"
                       >
                         <el-option
                           v-for="item in fre_options"
@@ -408,7 +408,7 @@
 							v-model="calendar_type"
 							class="calendar-cont"
 							v-if="chartInfo.ChartType === 2"
-							@change="refreshChart"
+							@change="getPreviewSplineInfo"
 						>
 							<el-radio-button label="公历" />
 							<el-radio-button label="农历" />

+ 34 - 65
src/views/dataEntry_manage/mixins/addOreditMixin.js

@@ -229,68 +229,37 @@ export default {
 			})
 		},
 
-		/* 刷数据接口 图表未添加请求数据 */
-		refreshChart() {
-			let params =  this.sameOptionType.includes(this.chartInfo.ChartType) ? {
-				EdbInfoId: this.tableData.map(item => item.EdbInfoId).join(','),
-				ChartType: this.chartInfo.ChartType,
-				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] : '',
-			} : {
-				EdbInfoId: this.tableData[0].EdbInfoId,
-				ChartType: this.chartInfo.ChartType,
-				Calendar: this.calendar_type,
-				SeasonStartDate: this.season_year ? this.season_year[0] : '',
-				SeasonEndDate: this.season_year ? this.season_year[1] : '',
-			};
-			dataBaseInterface.chartInfo(params).then((res) => {
-				if(res.Ret !== 200) return;
-
-				//只替换新数据
-				res.Data.EdbInfoList.forEach((item, index) => {
-					const newData = item.DataList;
-					this.tableData[index].DataList = newData;
-					
-				});
-
-				/* 防止领先指标配置数据未更新 除掉散点图 */
-				(this.sameOptionType.includes(this.chartInfo.ChartType) && this.chartInfo.ChartType!==5) && this.refreshTarget();
-
-			})
-		},
-
-		/* 刷指标数据 用于领先指标  */
-		refreshTarget() {
-			this.tableData.forEach((item, index) => {
-				let params = {
-					EdbInfoId: item.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: item.EdbInfoType,
-					LeadValue: item.EdbInfoType
-						? 0
-						: item.LeadValue,
-					LeadUnit: item.EdbInfoType
-						? ''
-						: item.LeadUnit,
-				};
-				dataBaseInterface.edbinfoDetail(params).then((res) => {
-					if (res.Ret === 200) {
-						let newData = res.Data.EdbInfo;
-						item.DataList = newData.DataList;
-						if(newData.EdbInfoCategoryType===1) item.MoveLatestDate = newData.MoveLatestDate;
-					}
-				});
-
-			})
+		/* 曲线图切换筛选项时请求数据 */
+		async getPreviewSplineInfo() {
+			let params = {
+        ChartType: this.chartInfo.ChartType,
+        DateType: this.year_select,
+        StartDate: [5, 6].includes(this.year_select)
+          ? this.select_date[0]
+          : '',
+        EndDate: this.year_select === 5 ? this.select_date[1] : '',
+        Calendar: this.calendar_type,
+        SeasonStartDate: this.season_year ? this.season_year[0] : '',
+        SeasonEndDate: this.season_year ? this.season_year[1] : '',
+        ChartEdbInfoList: this.tableData.map(_ => ({
+          EdbInfoId: _.EdbInfoId,
+          EdbInfoType: _.EdbInfoType,
+          LeadValue: _.EdbInfoType ? 0 : Number(_.LeadValue),
+          LeadUnit: _.EdbInfoType ? '' : _.LeadUnit,
+        }))
+      }
+
+      const res = await dataBaseInterface.getSplinePreviewData(params)
+
+      if(res.Ret !== 200) return
+
+      const { EdbInfoList } = res.Data;
+
+      this.tableData.forEach((item) => {
+        let edbData = EdbInfoList.find(_ => _.EdbInfoId===item.EdbInfoId);
+        item.DataList = edbData.DataList;
+        if(edbData.EdbInfoCategoryType===1) item.MoveLatestDate = edbData.MoveLatestDate;
+      });
 		},
 
 		/* 年份改变 重新刷新图表接口  保存当前的图表配置和上下限 只改变图表 */
@@ -299,7 +268,7 @@ export default {
 			this.select_date = '';
 			this.dateTip = '请选择时间段';
 
-			this.refreshChart();
+			this.getPreviewSplineInfo();
 		},
 
 		/* 打开时间段弹窗 */
@@ -325,12 +294,12 @@ export default {
 			} else {
 				this.dateTip = `${data.start_date}~至今`;
 			}
-			this.refreshChart();
+			this.getPreviewSplineInfo();
 		},
 
 			/* 季节图切换年份  保持当前配置 */
 		seasonYearChange() {
-			this.refreshChart();
+			this.getPreviewSplineInfo();
 		},
 
 		/* 切换图重置状态 */

+ 45 - 102
src/views/mychart_manage/components/chartDetailDia.vue

@@ -307,7 +307,7 @@
               v-if="chartInfo.ChartType === 2 && !chartInfo.WarnMsg"
               v-model="calendar_type"
               class="calendar-cont"
-              @change="reloadChartInfo"
+              @change="getPreviewChartInfo"
             >
               <el-radio-button label="公历" />
               <el-radio-button label="农历" />
@@ -347,7 +347,7 @@
                     <el-radio
                       v-model="props.row.EdbInfoType"
                       :label="1"
-                      @change="refreshTarget"
+                      @change="getPreviewChartInfo"
                       >标准指标</el-radio
                     >
                     <div style="margin-top: 22px">
@@ -355,7 +355,7 @@
                         v-model="props.row.EdbInfoType"
                         :label="0"
                         style="margin-right: 10px"
-                        @change="refreshTarget"
+                        @change="getPreviewChartInfo"
                         >领先指标</el-radio
                       >
                       <template v-if="props.row.EdbInfoType === 0">
@@ -366,7 +366,7 @@
                           type="number"
                           min="0"
                           v-model="props.row.LeadValue"
-                          @change="refreshTarget"
+                          @change="getPreviewChartInfo"
                           @keyup.native="filterCode(props.row)"
                         ></el-input>
                         <el-select
@@ -374,7 +374,7 @@
                           placeholder=""
                           style="width: 60px"
                           size="mini"
-                          @change="refreshTarget"
+                          @change="getPreviewChartInfo"
                         >
                           <el-option
                             v-for="item in fre_options"
@@ -649,7 +649,7 @@ export default {
     getChartInfo(){
       this.getChartDetail(this.chartInfo.UniqueCode)
     },
-    /* 获取指标所有数据 */
+    /* 获取详情 */
     getChartDetail(code = '') {
       this.refreshLoading = true;
       dataBaseInterface
@@ -726,97 +726,40 @@ export default {
           : '请选择时间段';
     },
 
-    /* 选项发生变化时 非配置项 获取新的图表数据 */
-    reloadChartInfo(type = '') {
-      let params =
-        this.sameOptionType.includes(this.chartInfo.ChartType)
-          ? {
-              ChartInfoId: this.chartInfo.ChartInfoId,
-              DateType: this.year_select,
-              StartDate: [5, 6].includes(this.year_select)
-                ? this.select_date[0]
-                : '',
-              EndDate: this.year_select === 5 ? this.select_date[1] : '',
-            }
-          : {
-              ChartInfoId: this.chartInfo.ChartInfoId,
-              Calendar: this.calendar_type,
-              SeasonStartDate: this.season_year ? this.season_year[0] : '',
-              SeasonEndDate: this.season_year ? this.season_year[1] : '',
-            };
-      dataBaseInterface.chartInfo(params).then((res) => {
-        if (res.Ret !== 200) return;
+    /* 曲线图筛选项发生变化时 非配置项 获取新的图表数据 */
+   async getPreviewChartInfo() {
+
+      let params = {
+        ChartType: this.chartInfo.ChartType,
+        DateType: this.year_select,
+        StartDate: [5, 6].includes(this.year_select)
+          ? this.select_date[0]
+          : '',
+        EndDate: this.year_select === 5 ? this.select_date[1] : '',
+        Calendar: this.calendar_type,
+        SeasonStartDate: this.season_year ? this.season_year[0] : '',
+        SeasonEndDate: this.season_year ? this.season_year[1] : '',
+        ChartEdbInfoList: this.tableData.map(_ => ({
+          EdbInfoId: _.EdbInfoId,
+          EdbInfoType: _.EdbInfoType,
+          LeadValue: _.EdbInfoType ? 0 : Number(_.LeadValue),
+          LeadUnit: _.EdbInfoType ? '' : _.LeadUnit,
+        }))
+      }
 
-        this.chartInfo = res.Data.ChartInfo;
-        let beforeOptions = sessionStorage.getItem('myChartbeforeOptions')
-          ? JSON.parse(sessionStorage.getItem('myChartbeforeOptions'))
-          : '';
-        //合并缓存配置和新的数据
-        let newarr = res.Data.EdbInfoList.map((item, index) => {
-          if (beforeOptions) {
-            const DataList = item.DataList;
-            return {
-              ...beforeOptions[index],
-              DataList,
-            };
-          } else {
-            return item;
-          }
-        });
-        this.tableData = newarr;
-
-        /* 防止上次配置领先指标 刷新后数据回到配置前 */
-        if (
-          type === 'refresh' &&
-          beforeOptions &&
-          (this.sameOptionType.includes(this.chartInfo.ChartType) && this.chartInfo.ChartType!==5)
-        ) {
-          this.refreshTarget();
-        }
-      });
-    },
+      const res = await dataBaseInterface.getSplinePreviewData(params)
+
+      if(res.Ret !== 200) return
+
+      const { EdbInfoList } = res.Data;
 
-    /* 刷新指标数据 领先值获取数据 */
-    refreshTarget() {
       this.tableData.forEach((item) => {
-        let params = {
-          EdbInfoId: item.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: item.EdbInfoType,
-          LeadValue: item.EdbInfoType ? 0 : item.LeadValue,
-          LeadUnit: item.EdbInfoType ? '' : item.LeadUnit,
-        };
-        dataBaseInterface.edbinfoDetail(params).then((res) => {
-          if (res.Ret !== 200) return;
-          let newData = res.Data.EdbInfo;
-          item.DataList = newData.DataList;
-          if(newData.EdbInfoCategoryType===1) item.MoveLatestDate = newData.MoveLatestDate;
-        });
+        let edbData = EdbInfoList.find(_ => _.EdbInfoId===item.EdbInfoId);
+        item.DataList = edbData.DataList;
+        if(edbData.EdbInfoCategoryType===1) item.MoveLatestDate = edbData.MoveLatestDate;
       });
     },
 
-    /* 设置默认时间选中项 */
-    setDefaultDateSelect() {
-      this.year_select = this.chartInfo.DateType;
-      this.select_date = [this.chartInfo.StartDate, this.chartInfo.EndDate];
-      this.calendar_type = this.chartInfo.Calendar; //日历类型
-      this.season_year = [
-        this.chartInfo.SeasonStartDate,
-        this.chartInfo.SeasonEndDate,
-      ];
-      this.dateTip =
-        this.chartInfo.DateType === 5
-          ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
-          : this.chartInfo.DateType === 6
-          ? `${this.chartInfo.StartDate}~至今`
-          : '请选择时间段';
-    },
-
     /* 打开时间段弹窗 */
     openDateDia() {
       // 自定义时间段回显
@@ -843,13 +786,13 @@ export default {
           : `${data.start_date}~至今`;
 
       this.saveNowOptions();
-      this.reloadChartInfo('refresh');
+      this.getPreviewChartInfo();
     },
 
     /* 季节图切换年份  保持当前配置 */
     seasonYearChange() {
       this.saveNowOptions();
-      this.reloadChartInfo('refresh');
+      this.getPreviewChartInfo();
     },
 
     /* 年份改变 重新刷新图表接口  保存当前的图表配置和上下限 只改变图表 */
@@ -860,18 +803,18 @@ export default {
   
       //保存表格配置和上下限 曲线图需要保存表格配置
       this.saveNowOptions();
-      this.reloadChartInfo('refresh');
+      this.getPreviewChartInfo();
     },
 
     /* 保存图表当前配置项 上下限 */
     saveNowOptions() {
-      const dataArr = _.cloneDeep(this.tableData);
-      dataArr.forEach((item) => {
-        item.MaxData = Number(item.MaxData);
-        item.MinData = Number(item.MinData);
-        delete item.DataList;
-      });
-      sessionStorage.setItem('myChartbeforeOptions', JSON.stringify(dataArr));
+      // const dataArr = _.cloneDeep(this.tableData);
+      // dataArr.forEach((item) => {
+      //   item.MaxData = Number(item.MaxData);
+      //   item.MinData = Number(item.MinData);
+      //   delete item.DataList;
+      // });
+      // sessionStorage.setItem('myChartbeforeOptions', JSON.stringify(dataArr));
     },
 
     /* 一键刷新 超长等待..*/
@@ -896,7 +839,7 @@ export default {
         this.refreshLoading = false;
         if (res.Ret !== 200) return
         this.$message.success(res.Msg);
-        Source === 1 ? this.reloadChartInfo('refresh') : this.getChartDetail(UniqueCode);
+        Source === 1 ? this.getPreviewChartInfo() : this.getChartDetail(UniqueCode);
     },
     // 英文面板时候的判断
     copyChartConfirm(type){