cxmo 9 месяцев назад
Родитель
Сommit
5906709d7f

+ 3 - 4
src/views/dataEntry_manage/addChart.vue

@@ -784,8 +784,8 @@ export default {
 			this.$refs.diaForm.validate((valid) => {
 				if(valid) {
 					// 季节图只允许添加一个指标
-					if(this.chartInfo.ChartType === 2 && this.tableData.length > 1)
-						return this.$message.warning(/* '您选择的图表样式为季节性图表,只支持单指标画图' */this.$t('Chart.OptMsg.season_one_msg'));
+					if(this.chartInfo.ChartType === 2 && this.tableData.length > 1){}
+						//return this.$message.warning(/* '您选择的图表样式为季节性图表,只支持单指标画图' */this.$t('Chart.OptMsg.season_one_msg'));
 
 					else if([7,11].includes(this.chartInfo.ChartType)  && !this.$refs.BarOptRef.dateList.length)  
 						return this.$message.warning(/*'请添加日期'*/this.$t('ToolBox.CommodityPriceChart.tips_msg06'));
@@ -913,8 +913,7 @@ export default {
 							MaxMinLimits:MaxMinLimits.IsAdd?MaxMinLimits:{},
 							SamePeriodAverage:SamePeriodAverage.IsAdd?SamePeriodAverage:{},
 							SamePeriodStandardDeviation:SamePeriodStandardDeviation.IsAdd?SamePeriodStandardDeviation:{},
-							//RightAxis:SeasonRightConfig.IsAdd?tempConfig:{}//右轴的具体配置
-							RightAxis:{}
+							RightAxis:SeasonRightConfig.IsAdd?tempConfig:{}//右轴的具体配置
 						}
 					}
 					dataBaseInterface.chartAdd(params).then(res => {

+ 21 - 2
src/views/dataEntry_manage/editChart.vue

@@ -910,8 +910,8 @@ export default {
 			this.$refs.diaForm.validate((valid) => {
 				if(valid) {
 					// 季节图只允许添加一个指标
-					if(this.chartInfo.ChartType === 2 && this.tableData.length > 1)  
-						return this.$message.warning(/* '您选择的图表样式为季节性图表,只支持单指标画图' */this.$t('Chart.OptMsg.season_one_msg'));
+					if(this.chartInfo.ChartType === 2 && this.tableData.length > 1) {} 
+						//return this.$message.warning(/* '您选择的图表样式为季节性图表,只支持单指标画图' */this.$t('Chart.OptMsg.season_one_msg'));
 
 					if(this.chartInfo.ChartType === 7 && !this.$refs.BarOptRef.dateList.length)  
 						return this.$message.warning(/*'请添加日期'*/this.$t('ToolBox.CommodityPriceChart.tips_msg06'));
@@ -1029,6 +1029,25 @@ export default {
 							MinMaxSave:Number(hasLimitChange)
 						}
 					}
+					//如果是季节性图,在这里加上同期/右轴的参数
+					if(this.chartInfo.ChartType===2){
+						//const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = this.chartInfo.SeasonAverageConfig||{}
+						const {SeasonRightConfig={}} = this.chartInfo
+						const tempData = _.cloneDeep(this.chartInfo.SeasonAverageConfig||{})
+						delete tempData.MaxMinLimits.List
+						delete tempData.SamePeriodAverage.List
+						delete tempData.SamePeriodStandardDeviation.List
+						const tempConfig = _.cloneDeep(SeasonRightConfig)
+						delete tempConfig.EdbInfoList
+						const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = tempData||{}
+						params.SeasonExtraConfig = {
+							...this.SeasonExtraConfig,
+							MaxMinLimits:MaxMinLimits.IsAdd?MaxMinLimits:{},
+							SamePeriodAverage:SamePeriodAverage.IsAdd?SamePeriodAverage:{},
+							SamePeriodStandardDeviation:SamePeriodStandardDeviation.IsAdd?SamePeriodStandardDeviation:{},
+							RightAxis:SeasonRightConfig.IsAdd?tempConfig:{}//右轴的具体配置
+						}
+					}
 					dataBaseInterface.chartEdit(params).then(res => {
 						if(res.Ret !== 200) return;
 						

+ 8 - 2
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -3065,8 +3065,14 @@ export const chartSetMixin = {
             //季节性图-右轴为左轴同比,单独处理
             if(this.chartInfo.ChartType===2){
                 if(this.chartInfo.SeasonRightConfig&&this.chartInfo.SeasonRightConfig.IsShow){
-                    this.chartLimit.rightMin = this.chartInfo.SeasonRightConfig.EdbInfoList[0].MinData||0
-                    this.chartLimit.rightMax = this.chartInfo.SeasonRightConfig.EdbInfoList[0].MaxData||0
+                    if(this.chartInfo.SeasonRightConfig.IndicatorType===1){
+                        this.chartLimit.rightMin = this.chartInfo.SeasonRightConfig.EdbInfoList[0].MinData||0
+                        this.chartLimit.rightMax = this.chartInfo.SeasonRightConfig.EdbInfoList[0].MaxData||0
+                    }else{
+                        this.chartLimit.rightMin = this.tableData[1].MinData||0
+                        this.chartLimit.rightMax = this.tableData[1].MaxData||0
+                    }
+                    
                 }
             }
             console.table([{