Browse Source

右轴指标回显,盲写的,后端接口调不通

cxmo 9 months ago
parent
commit
dcdf804b0b

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

@@ -1700,8 +1700,9 @@ export default {
       this.chartInfo = res.Data.ChartInfo;
       //如果是季节性图,存储额外参数(同期/右轴)
       if(this.chartInfo.ChartType===2){
-        const {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation,} = res.Data.DataResp
+        const {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation,RightAxis} = res.Data.DataResp
         this.chartInfo.SeasonAverageConfig = {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation}
+        this.chartInfo.SeasonRightConfig = RightAxis
       }
       this.tableData = res.Data.EdbInfoList;
 
@@ -1842,7 +1843,19 @@ export default {
           ConvertEnUnit:Number(_.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)
 
       if(res.Ret !== 200) return

+ 78 - 28
src/views/dataEntry_manage/components/addMarkerDialog.vue

@@ -38,7 +38,7 @@
               <div class="mark-value-wrap form-item-content">
                 <!-- 固定值:原标识线输入框 -->
                 <div class="default-value">
-                    <el-radio v-model="radio" label="固定" style="margin-right: 20px;"></el-radio>
+                    <el-radio v-model="markerForm.markLineType" :label="1" style="margin-right: 20px;">固定</el-radio>
                     <!-- 时间轴1,2,4,6的y轴数字 x轴日期  -->
                     <template v-if="[1,2,4,6].includes(chartInfo.ChartType)">
                         <el-date-picker
@@ -77,7 +77,7 @@
                 </div>
                 <!-- 指标计算 -->
                 <div class="custom-value">
-                    <el-radio v-model="radio" label="指标计算" style="margin-left: 20px;"></el-radio>
+                    <el-radio v-model="markerForm.markLineType" :label="2" style="margin-left: 20px;">指标计算</el-radio>
                 </div>
               </div>
             </template>
@@ -153,21 +153,21 @@
           </el-form-item>
 
           <!-- 标识线-指标计算部分 -->
-          <div class="custom-value-setting-wrap" v-if="form.markerType==='line'&&radio==='指标计算'">
+          <div class="custom-value-setting-wrap" v-if="form.markerType==='line'&&markerForm.markLineType===2">
             <!-- 指标选择 -->
             <el-form-item label="指标">
                 <div class="edb-box-wrap form-item-content">
                     <!-- 固定第一个指标 -->
                     <div class="fixed-edb">
-                        <el-radio v-model="markerExtraConfig.edbType" :label="1">图上第一个指标</el-radio>
+                        <el-radio v-model="markerForm.edbType" :label="1">图上第一个指标</el-radio>
                         <p>指标名称指标名称</p>
                     </div>
                     <!-- 指标/预测指标库的指标 -->
                     <div class="other-edb">
-                        <el-radio v-model="markerExtraConfig.edbType" :label="2" style="margin-right: 20px;">其他指标</el-radio>
+                        <el-radio v-model="markerForm.edbType" :label="2" style="margin-right: 20px;">其他指标</el-radio>
                         <!-- /datamanage/edb_info/filter_by_es/all -->
                         <el-input
-                                v-model="markerForm.fixed"
+                                v-model="markerForm.EdbName"
                                 style="width: 200px;"
                                 placeholder="请选择指标名称"
                                 clearable
@@ -178,19 +178,19 @@
             <!-- 时间区间选择 -->
             <el-form-item label="时间区间">
                 <div class="time-area-wrap">
-                    <el-radio v-model="markerExtraConfig.timeInterval" :label="0">跟随图表</el-radio>
-                    <el-radio v-model="markerExtraConfig.timeInterval" :label="1">自定义</el-radio>
+                    <el-radio v-model="markerForm.timeInterval" :label="0">跟随图表</el-radio>
+                    <el-radio v-model="markerForm.timeInterval" :label="1">自定义</el-radio>
                 </div>
             </el-form-item>
             <!-- 如果时间区间选择自定义 -->
-            <div class="custom-time-wrap" v-if="markerExtraConfig.timeInterval===1">
+            <div class="custom-time-wrap" v-if="markerForm.timeInterval===1">
                 <!-- 起始时间 -->
                 <el-form-item label="起始时间">
                     <div class="form-item-content">
                         <div class="fixed-time">
-                            <el-radio v-model="markerExtraConfig.startTimeInfo.timeType" :label="1" style="margin-right: 20px;">固定</el-radio>
+                            <el-radio v-model="markerForm.startTimeInfo.timeType" :label="1" style="margin-right: 20px;">固定</el-radio>
                             <el-date-picker
-                                v-model="markerExtraConfig.startTimeInfo.date"
+                                v-model="markerForm.startTimeInfo.date"
                                 type="date"
                                 style="width: 100px;"
                                 placeholder="请输入固定时间"
@@ -200,7 +200,7 @@
                             ></el-date-picker>
                         </div>
                         <div class="custom-time">
-                            <el-radio v-model="markerExtraConfig.startTimeInfo.timeType" :label="2" style="margin-left:20px;margin-right:5px">动态</el-radio>
+                            <el-radio v-model="markerForm.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,22 +209,22 @@
                     
                 </el-form-item>
                 <!-- 起始时间为动态 -->
-                <div class="start-time-custom-wrap" v-if="markerExtraConfig.startTimeInfo.timeType===2">
+                <div class="start-time-custom-wrap" v-if="markerForm.startTimeInfo.timeType===2">
                     <!-- 基准日期 -->
                     <el-form-item label="基准日期">
                         <div class="form-item-content">
                             <div class="edb-sys-date">
-                                <el-radio v-model="markerExtraConfig.startTimeInfo.baseTimeType" :label="1">系统日期</el-radio>
+                                <el-radio v-model="markerForm.startTimeInfo.baseTimeType" :label="1">系统日期</el-radio>
                             </div>
                             <div class="edb-new-date">
-                                <el-radio v-model="markerExtraConfig.startTimeInfo.baseTimeType" :label="2">指标最新日期</el-radio>
+                                <el-radio v-model="markerForm.startTimeInfo.baseTimeType" :label="2">指标最新日期</el-radio>
                                 <p>期数前移<el-input style="width:60px"></el-input>期</p>
                             </div>
                         </div>
                         
                     </el-form-item>
                     <!-- 日期变换 -->
-                    <dateMoveWaySec></dateMoveWaySec>
+                    <dateMoveWaySec ref="startTimeInfo"></dateMoveWaySec>
                    
                 </div>
                 
@@ -232,12 +232,12 @@
                 <el-form-item label="结束时间">
                     <div class="form-item-content">
                         <div class="now-time">
-                            <el-radio v-model="fixedTime" label="至今"></el-radio>
+                            <el-radio v-model="markerForm.endTimeInfo.timeType" :label="3">至今</el-radio>
                         </div>
                         <div class="fixed-time">
-                            <el-radio v-model="fixedTime" label="固定"></el-radio>
+                            <el-radio v-model="markerForm.endTimeInfo.timeType" :label="1">固定</el-radio>
                             <el-date-picker
-                                v-model="markerForm.fixedTime"
+                                v-model="markerForm.endTimeInfo.date"
                                 type="date"
                                 style="width: 200px;"
                                 placeholder="请输入固定时间"
@@ -247,19 +247,55 @@
                             ></el-date-picker>
                         </div>
                         <div class="custom-time">
-                            <el-radio v-model="fixedTime" label="动态"></el-radio>
-                            <p>说明说明</p>
+                            <el-radio v-model="markerForm.endTimeInfo.timeType" :label="2">动态</el-radio>
+                            <el-tooltip effect="dark" content="说明说明" placement="top">
+                                <i class="el-icon-question" style="font-size: 16px;"></i>
+                            </el-tooltip>
                         </div>
                     </div>
                     
                 </el-form-item>
                 <!-- 结束时间为动态 -->
-                <div class="end-time-custom-wrap">
-                    <!-- 结束时间-基准日期 -->
-                    <!-- 结束日期日期变换 -->
+                <div class="end-time-custom-wrap" v-if="markerForm.endTimeInfo.timeType===2">
+                    <!-- 基准日期 -->
+                    <el-form-item label="基准日期">
+                        <div class="form-item-content">
+                            <div class="edb-sys-date">
+                                <el-radio v-model="markerForm.endTimeInfo.baseTimeType" :label="1">系统日期</el-radio>
+                            </div>
+                            <div class="edb-new-date">
+                                <el-radio v-model="markerForm.endTimeInfo.baseTimeType" :label="2">指标最新日期</el-radio>
+                                <p>期数前移<el-input style="width:60px"></el-input>期</p>
+                            </div>
+                        </div>
+                        
+                    </el-form-item>
+                    <!-- 日期变换 -->
+                    <dateMoveWaySec ref="endTimeInfo"></dateMoveWaySec>
                 </div>
             </div>
-            <!-- 计算方式选择 -->
+            <!-- 计算方式 -->
+            <el-form-item label="计算方式">
+                <div class="form-item-content">
+                    <div class="format">
+                        <el-radio v-model="markerForm.calculation" :label="1">区间均值</el-radio>
+                    </div>
+                    <div class="format">
+                        <el-radio v-model="markerForm.calculation" :label="2">区间均值</el-radio>
+                        <p>加<el-input style="width:60px" v-model="markerForm.calculationValue"></el-input>倍标准差</p>
+                    </div>
+                    <div class="format">
+                        <el-radio v-model="markerForm.calculation" :label="3">区间</el-radio>
+                        <p>
+                            <el-input style="width:60px" v-model="calculationValue"></el-input>%
+                            <el-select v-model="calculationType">
+                                <el-option label="个数" :value="3"></el-option>
+                                <el-option label="数值" :value="4"></el-option>
+                            </el-select>分位
+                        </p>
+                    </div>
+                </div>
+            </el-form-item>
           </div>
 
           <!-- 标识线样式 可收起 -->
@@ -399,6 +435,8 @@ export default {
           textColor: themeOpt.markerOptions.style.color,
           textFontSize: themeOpt.markerOptions.style.fontSize,
           isShow: true,
+          //补上额外参数
+          ...this.markerExtraConfig
         }
       }
     }
@@ -484,16 +522,21 @@ export default {
 
         },
         endTimeInfo:{
-            timeType:1,//起始时间类型 0至今 1 固定 2动态
+            timeType:1,//起始时间类型 3至今 1 固定 2动态
             date:'2024-01-01',//固定的时间值,timeType不为1时为空
             baseTimeType:1,//基准日期 1系统日期 2指标最新日期
             moveValue:0,//baseTimeType为2时,表示前移的期数
             dateChangeInfo:[]
         },
         calculation:1,//计算方式 1区间均值 2区间均值+标准差 3区间百分位个数分位 4区间百分位数值分位
-        calculationValue:'',//计算方式对应值,calculatin为2时表示标准差的倍数,为3时表示个数分位的百分数
-
+        calculationValue:1,//计算方式对应值,calculation为2时表示标准差的倍数,为3时表示个数分位的百分数
       },
+      calculationType:3,
+      calculationValue:50,
+     /*  calculationSelect:[
+        {lable:'个数',value:3},
+        {label:'数值',value:4}
+      ], */
 
       axisLabelMap: { //暂时没有横轴的代表key 规定为3好了
         1: '左轴',
@@ -523,6 +566,13 @@ export default {
 
       
       let item = _.cloneDeep(this.markerForm)
+
+      //格式化某些值
+      //form.calculation+calculationType 共同判断计算方式
+      if(this.markerForm.calculation===3){
+            item.calculation = this.calculationType
+            item.calculationValue = this.calculationValue
+      }
       
       this.editIndex 
         ? this.$emit('edit',{

+ 16 - 0
src/views/dataEntry_manage/components/addRightEdbDialog.vue

@@ -166,6 +166,14 @@ export default {
         },
         tableData:{
             type:Array
+        },
+        formData:{
+            type:Object,
+            default:{}
+        },
+        edbData:{
+            type:Object,
+            default:{}
         }
     },
     computed:{
@@ -173,6 +181,14 @@ export default {
             return {}
         }
     },
+    watch:{
+        isShow(newval){
+            if(newval){
+                Object.assign(this.rightEdbForm,this.formData)
+                this.rightEdbData = this.edbData
+            }
+        }
+    },
     data() {
         return {
             search_page:1,

+ 5 - 1
src/views/dataEntry_manage/components/markersSection.vue

@@ -239,6 +239,8 @@
     <addRightEdbDialog 
         :isShow="isAddRightEdbDialogShow"
         :tableData="tableData"
+        :formData="rightEdbForm"
+        :edbData="rightEdbInfo"
         @close="isAddRightEdbDialogShow=false"
         @modify="addRightEdb"
     />
@@ -467,7 +469,7 @@ export default {
                 SamePeriodAverage:this.averageLine,
                 SamePeriodStandardDeviation:this.averageStd
             },
-            SeasonRightEdbConfig:{}
+            SeasonRightEdbConfig:this.rightEdbForm
         })
     },
     //季节性图配置数据回显
@@ -475,6 +477,8 @@ export default {
         Object.assign(this.averageArea,data.MaxMinLimits)
         Object.assign(this.averageLine,data.SamePeriodAverage)
         Object.assign(this.averageStd,data.SamePeriodStandardDeviation)
+        Object.assign(this.rightEdbForm,data.RightAxis)
+        this.rightEdbInfo = data.RightInfo
     }
   },
 }

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

@@ -800,12 +800,16 @@ export default {
 					this.$refs.markerSectionRef.initData(ChartInfo);
 					//季节性图处理SeasonAverageConfig,SeasonRightEdbConfig
 					if(this.chartInfo.ChartType===2){
-						const {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation,} = res.Data.DataResp
+						const {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation,RightAxis} = res.Data.DataResp
 						this.chartInfo.SeasonAverageConfig = {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation}
+						this.chartInfo.SeasonRightConfig = RightAxis
 						const tempData = _.cloneDeep(this.chartInfo.SeasonAverageConfig)
+						tempData.RightAxis = _.cloneDeep(RightAxis)
+						tempData.RightInfo = _.cloneDeep((RightAxis.EdbInfoList&&RightAxis.EdbInfoList[0])||{})
 						delete tempData.MaxMinLimits.List
 						delete tempData.SamePeriodAverage.List
 						delete tempData.SamePeriodStandardDeviation.List
+						delete tempData.RightAxis.EdbInfoList
 						this.$refs.markerSectionRef.initSeasonData(tempData)
 					}
 

+ 7 - 0
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -3062,6 +3062,13 @@ export const chartSetMixin = {
                 this.chartLimit.rightTwoMin = 0
                 this.chartLimit.rightTwoMax = 0
             }
+            //季节性图-右轴为左轴同比,单独处理
+            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
+                }
+            }
             console.table([{
                     'y轴': '左轴',
                     '最大值': this.chartLimit.max,