浏览代码

季节性图同期添加编辑回显

cxmo 9 月之前
父节点
当前提交
a0cfc6e636

+ 14 - 1
src/views/dataEntry_manage/addChart.vue

@@ -899,7 +899,20 @@ export default {
 					}
 					//如果是季节性图,在这里加上同期/右轴的参数
 					if(this.chartInfo.ChartType===2){
-
+						//const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = this.chartInfo.SeasonAverageConfig||{}
+						const {SeasonRightEdbConfig={}} = this.chartInfo
+						const tempData = _.cloneDeep(this.chartInfo.SeasonAverageConfig||{})
+						delete tempData.MaxMinLimits.List
+						delete tempData.SamePeriodAverage.List
+						delete tempData.SamePeriodStandardDeviation.List
+						const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = tempData||{}
+						params.SeasonExtraConfig = {
+							...this.SeasonExtraConfig,
+							MaxMinLimits:MaxMinLimits.IsAdd?MaxMinLimits:{},
+							SamePeriodAverage:SamePeriodAverage.IsAdd?SamePeriodAverage:{},
+							SamePeriodStandardDeviation:SamePeriodStandardDeviation.IsAdd?SamePeriodStandardDeviation:{},
+							RightAxis:SeasonRightEdbConfig.IsAdd?SeasonRightEdbConfig:{}//右轴的具体配置
+						}
 					}
 					dataBaseInterface.chartAdd(params).then(res => {
 						if(res.Ret !== 200) return;

+ 5 - 0
src/views/dataEntry_manage/chartSetting.vue

@@ -1698,6 +1698,11 @@ export default {
       }
       if (res.Ret !== 200) return;
       this.chartInfo = res.Data.ChartInfo;
+      //如果是季节性图,存储额外参数(同期/右轴)
+      if(this.chartInfo.ChartType===2){
+        const {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation,} = res.Data.DataResp
+        this.chartInfo.SeasonAverageConfig = {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation}
+      }
       this.tableData = res.Data.EdbInfoList;
 
       // //将指标添加进标签列表中

+ 43 - 36
src/views/dataEntry_manage/components/addMarkerDialog.vue

@@ -188,9 +188,9 @@
                 <el-form-item label="起始时间">
                     <div class="form-item-content">
                         <div class="fixed-time">
-                            <el-radio v-model="fixedTime" label="固定" style="margin-right: 20px;"></el-radio>
+                            <el-radio v-model="markerExtraConfig.startTimeInfo.timeType" :label="1" style="margin-right: 20px;">固定</el-radio>
                             <el-date-picker
-                                v-model="markerForm.fixedTime"
+                                v-model="markerExtraConfig.startTimeInfo.date"
                                 type="date"
                                 style="width: 100px;"
                                 placeholder="请输入固定时间"
@@ -200,7 +200,7 @@
                             ></el-date-picker>
                         </div>
                         <div class="custom-time">
-                            <el-radio v-model="fixedTime" label="动态" style="margin-left:20px;margin-right:5px"></el-radio>
+                            <el-radio v-model="markerExtraConfig.startTimeInfo.timeType" :label="2" style="margin-left:20px;margin-right:5px">动态</el-radio>
                             <el-tooltip effect="dark" content="说明说明" placement="top">
                                 <i class="el-icon-question" style="font-size: 16px;"></i>
                             </el-tooltip>
@@ -209,49 +209,49 @@
                     
                 </el-form-item>
                 <!-- 起始时间为动态 -->
-                <div class="start-time-custom-wrap">
+                <div class="start-time-custom-wrap" v-if="markerExtraConfig.startTimeInfo.timeType===2">
                     <!-- 基准日期 -->
                     <el-form-item label="基准日期">
-                        <el-radio v-model="startTimeSetting" label="系统日期"></el-radio>
-                        <div class="edb-new-date">
-                            <el-radio v-model="startTimeSetting" label="指标最新日期"></el-radio>
-                            <p>期数前移<el-input style="width:80px"></el-input>期</p>
+                        <div class="form-item-content">
+                            <div class="edb-sys-date">
+                                <el-radio v-model="markerExtraConfig.startTimeInfo.baseTimeType" :label="1">系统日期</el-radio>
+                            </div>
+                            <div class="edb-new-date">
+                                <el-radio v-model="markerExtraConfig.startTimeInfo.baseTimeType" :label="2">指标最新日期</el-radio>
+                                <p>期数前移<el-input style="width:60px"></el-input>期</p>
+                            </div>
                         </div>
+                        
                     </el-form-item>
                     <!-- 日期变换 -->
-                    <el-form-item label="日期变换">
-                        <div class="select-box">
-                            <el-select v-model="selectDate">
-                                <el-option label="指定频率"></el-option>
-                                <el-option label="日期位移"></el-option>
-                            </el-select>
-                            <el-button>添加</el-button>
-                        </div>
-                        <div class="select-list">
-                            <!-- 日期位移 [] 天 [] 月 [] 年 -->
-                        </div>
-                    </el-form-item>
+                    <dateMoveWaySec></dateMoveWaySec>
+                   
                 </div>
                 
                 <!-- 结束时间 -->
                 <el-form-item label="结束时间">
-                    <el-radio v-model="fixedTime" label="至今"></el-radio>
-                    <div class="fixed-time">
-                        <el-radio v-model="fixedTime" label="固定"></el-radio>
-                        <el-date-picker
-                            v-model="markerForm.fixedTime"
-                            type="date"
-                            style="width: 200px;"
-                            placeholder="请输入固定时间"
-                            :clearable="false"
-                            format="yyyy-MM-dd"
-                            value-format="yyyy-MM-dd"
-                        ></el-date-picker>
-                    </div>
-                    <div class="custom-time">
-                        <el-radio v-model="fixedTime" label="动态"></el-radio>
-                        <p>说明说明</p>
+                    <div class="form-item-content">
+                        <div class="now-time">
+                            <el-radio v-model="fixedTime" label="至今"></el-radio>
+                        </div>
+                        <div class="fixed-time">
+                            <el-radio v-model="fixedTime" label="固定"></el-radio>
+                            <el-date-picker
+                                v-model="markerForm.fixedTime"
+                                type="date"
+                                style="width: 200px;"
+                                placeholder="请输入固定时间"
+                                :clearable="false"
+                                format="yyyy-MM-dd"
+                                value-format="yyyy-MM-dd"
+                            ></el-date-picker>
+                        </div>
+                        <div class="custom-time">
+                            <el-radio v-model="fixedTime" label="动态"></el-radio>
+                            <p>说明说明</p>
+                        </div>
                     </div>
+                    
                 </el-form-item>
                 <!-- 结束时间为动态 -->
                 <div class="end-time-custom-wrap">
@@ -557,6 +557,13 @@ export default {
   .form-item-content{
     display: flex;
   }
+  .date-change-ways{
+    .header{
+        label{
+            text-align: left !important;
+        }
+    }
+  }
   .mark-box{
     background-color: #EBEFF6;
     border:1px solid #C8CDD9;

+ 3 - 2
src/views/dataEntry_manage/components/addRightEdbDialog.vue

@@ -27,7 +27,7 @@
                     remote
                     clearable
                     :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
-                    style="width:90%;margin-top: 10px;display: block;"
+                    style="width:90%;margin-top: 20px;display: block;"
                     :remote-method="searchHandle"
                     @click.native="inputFocusHandle"
                     @change="selectTarget($event && searchOptions.find(_ => _.EdbInfoId === $event))"
@@ -259,11 +259,12 @@ export default {
                 EdbInfoType:tableItem.EdbInfoType,
                 LeadValue:tableItem.LeadValue,
                 LeadUnit:tableItem.LeadUnit,
+                IsAxis:0,
             }
         },
         confirmPerson(){
             //校验
-            if(!this.search_txt){
+            if(this.rightEdbForm.IndicatorType!==1&&!this.search_txt){
                 return this.$message.warning('请选择指标!')
             }
             this.$emit('modify',{form:this.rightEdbForm,data:this.rightEdbData})

+ 5 - 2
src/views/dataEntry_manage/components/chartReleationEdbTable.vue

@@ -154,8 +154,11 @@ export default {
     },
     currentTableData(){
         if(!(this.chartInfo.ChartType===2&&tableData[1])){
-            //如果tableData是左轴同比,只展示第一条
-            //return this.tableData[0]
+            //左轴同比不会加在tableData内,若右轴隐藏则只显示第一项
+            if(!this.chartInfo.SeasonRightConfig.IsShow){
+
+            }
+            return this.tableData[0]
         }
         return this.tableData
     },

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

@@ -547,6 +547,12 @@ export default {
             },
             SeasonRightEdbConfig:{}
         })
+    },
+    //季节性图配置数据回显
+    initSeasonData(data){
+        Object.assign(this.averageArea,data.MaxMinLimits)
+        Object.assign(this.averageLine,data.SamePeriodAverage)
+        Object.assign(this.averageStd,data.SamePeriodStandardDeviation)
     }
   },
 }

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

@@ -365,7 +365,9 @@
 						:chartType="chartInfo.ChartType"
 						:chartInfo="chartInfo"
 						@update="setChartMarkerInfo"
-                        @preview="previewChart"
+						@updateSeason="updateSeasonChart"
+						@previewSeason="previewSeasonChart"
+						@previewSeasonRight="previewSeasonRight"
 					/>
         </div>
 			</div>
@@ -790,12 +792,23 @@ export default {
 							? (this.currentLang==='en'?BarChartInfo.UnitEn:BarChartInfo.Unit) 
 							: (this.currentLang==='en'?ChartInfo.UnitEn:ChartInfo.Unit),
 						SourcesFromVisable: ChartInfo.SourcesFrom ? JSON.parse(ChartInfo.SourcesFrom).isShow : true,
-						//处理SeasonAverageConfig,SeasonRightEdbConfig,如果有
 					};
+					
 					//处理下历史默认来源
 					this.setDefaultSourceFrom();
 
 					this.$refs.markerSectionRef.initData(ChartInfo);
+					//季节性图处理SeasonAverageConfig,SeasonRightEdbConfig
+					if(this.chartInfo.ChartType===2){
+						const {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation,} = res.Data.DataResp
+						this.chartInfo.SeasonAverageConfig = {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation}
+						const tempData = _.cloneDeep(this.chartInfo.SeasonAverageConfig)
+						delete tempData.MaxMinLimits.List
+						delete tempData.SamePeriodAverage.List
+						delete tempData.SamePeriodStandardDeviation.List
+						this.$refs.markerSectionRef.initSeasonData(tempData)
+					}
+
 					this.tableData = EdbInfoList;
 					this.updateData = this.tableData.map(item=>{
 						return this.formatUpdateData(item)

+ 7 - 5
src/views/dataEntry_manage/mixins/addOreditMixin.js

@@ -1095,6 +1095,7 @@ export default {
 		},
 		//预览季节性图(请求接口)
 		previewSeasonChart({SeasonAverageConfig={},SeasonRightEdbConfig={IndicatorType:1}}){
+			this.chartInfo.SeasonAverageConfig = SeasonAverageConfig
 			let db_arr = this.tableData.map((_,index) => {
 				const {IsConvert,ConvertType,ConvertValue,ConvertUnit,ConvertEnUnit} = this.updateData[index]
 					return {
@@ -1106,7 +1107,8 @@ export default {
 						ConvertType,
 						ConvertValue:Number(ConvertValue),
 						ConvertUnit:IsConvert?ConvertUnit:'',
-						ConvertEnUnit:IsConvert?ConvertEnUnit:''
+						ConvertEnUnit:IsConvert?ConvertEnUnit:'',
+						IsAxis:_.IsAxis
 					}
 			})
 			const params = {
@@ -1124,8 +1126,7 @@ export default {
 				MaxMinLimits:MaxMinLimits.IsAdd?SeasonAverageConfig.MaxMinLimits:{},
 				SamePeriodAverage:SamePeriodAverage.IsAdd?SamePeriodAverage:{},
 				SamePeriodStandardDeviation:SamePeriodStandardDeviation.IsAdd?SamePeriodStandardDeviation:{},
-				RightAxis:SeasonRightEdbConfig.IsAdd?SeasonRightEdbConfig:{}
-				//右轴的具体配置
+				RightAxis:SeasonRightEdbConfig.IsAdd?SeasonRightEdbConfig:{}//右轴的具体配置
 			}
 			params.SeasonExtraConfig = SeasonExtraConfig
 			dataBaseInterface.getSplinePreviewData(params).then(res=>{
@@ -1136,6 +1137,7 @@ export default {
 							IndicatorType:1,
 							EdbInfoList:[]
 						}} = DataResp
+				//包含同期的具体数据,用于绘图展示和传参
 				this.chartInfo.SeasonAverageConfig = {
 					MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation
 				}
@@ -1153,8 +1155,8 @@ export default {
 				}
 				this.chartLimit.rightMin = MinData
 				this.chartLimit.rightMax = MaxData
-				//更新tableData&updateData
-				if(RightAxis.IndicatorType!==1){
+				//如果右轴有设置更新tableData&updateData
+				if(RightAxis.IsAdd&&RightAxis.IndicatorType!==1){
 					this.tableData = EdbInfoList
 					this.updateData = this.tableData.map(item=>{
 						return this.formatUpdateData(item)