Explorar o código

右轴preview

cxmo hai 9 meses
pai
achega
ac1780e1fd

+ 1 - 1
src/views/dataEntry_manage/chartSetting.vue

@@ -1844,7 +1844,7 @@ export default {
         }))
       }
       //季节性图 更改SeasonExtraConfig
-      //如果是季节性图,存储额外参数(同期/右轴)
+      //如果是季节性图,带上额外参数(同期/右轴)
       if(this.chartInfo.ChartType===2){
         const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = this.chartInfo.SeasonAverageConfig||{}
         const {SeasonRightConfig={}} = this.chartInfo

+ 2 - 0
src/views/dataEntry_manage/components/markersSection.vue

@@ -272,6 +272,8 @@ const baseRightForm = {
     LineColor:'#075EEE',//线条颜色
     LineWidth:3,//线条粗细
     LineStyle:'Solid',//线条线型
+    IsShow:false,
+    IsAdd:false
 }
 export default {
   components: { addMarkerDialog,mDialog, addAverageDialog, addRightEdbDialog },

+ 24 - 6
src/views/dataEntry_manage/mixins/addOreditMixin.js

@@ -220,7 +220,8 @@ export default {
 				EndDate: this.year_select === 5 ? dateArray[1] : '',
 				IsConvert:Number(IsConvert),
 				ConvertType,ConvertValue:Number(ConvertValue),
-				ConvertUnit,ConvertEnUnit
+				ConvertUnit,ConvertEnUnit,
+				IsAxis:this.tableData[index].IsAxis
 			}).then(res=>{
 				if(res.Ret!==200) return 
 				const {EdbInfoList=[]} = res.Data||{}
@@ -510,7 +511,20 @@ export default {
 						ConvertEnUnit:IsConvert?ConvertEnUnit:''
 					}
 				})
-		}
+			}
+			//季节性图 更改SeasonExtraConfig
+			//如果是季节性图,存储额外参数(同期/右轴)
+			if(this.chartInfo.ChartType===2){
+				const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = this.chartInfo.SeasonAverageConfig||{}
+				const {SeasonRightConfig={}} = this.chartInfo
+				params.SeasonExtraConfig = {
+					...this.SeasonExtraConfig,
+					MaxMinLimits:MaxMinLimits.IsAdd?SeasonAverageConfig.MaxMinLimits:{},
+					SamePeriodAverage:SamePeriodAverage.IsAdd?SamePeriodAverage:{},
+					SamePeriodStandardDeviation:SamePeriodStandardDeviation.IsAdd?SamePeriodStandardDeviation:{},
+					RightAxis:SeasonRightConfig.IsAdd?SeasonRightConfig:{}
+				}
+			}
 
       const res = await dataBaseInterface.getSplinePreviewData(params)
 
@@ -1174,11 +1188,15 @@ export default {
 			if(rightConfig.IsAdd){
 				//若为指标/预测指标
 				if(rightConfig.IndicatorType!==1){
-					this.tableData.push(tableData)
 					const tempItem = this.formatUpdateData(tableData)
-					this.updateData.push(tempItem) //只有一个指标,不需要去计算上下限,直接取max minvalue
-					this.chartLimit.rightMin = tableData.MinData
-					this.chartLimit.rightMax = tableData.MaxData
+					if(rightConfig.IndicatorType!==1){
+						if(this.tableData.length>1){
+							this.tableData[1] = tableData
+						}else{
+							this.tableData.push(tableData)
+							this.updateData.push(tempItem)
+						}
+					}
 				}
 				//若为左轴同比,啥也不做
 			}else{