Browse Source

其他Source也有用到曲线图,兼容一下

cxmo 9 months ago
parent
commit
6cec9a2625

+ 2 - 0
src/views/chartRelevance_manage/components/chartCard.vue

@@ -125,6 +125,8 @@ export default {
       switch(data.ChartInfo.Source) {//1曲线 
         case 1:
           this.chartInfo = data.ChartInfo;
+          //初始化上下限
+          this.setLimitData(data.EdbInfoList)
           this.setDefaultChart(data.EdbInfoList);
           break
         case 3: //3相关性 

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

@@ -595,11 +595,15 @@ export const chartSetMixin = {
         //获取对应轴的上下限
         //预测指标-走势图;图表配置-主题设置;不使用自定义上下限,剔除
         const useTableLimit = ['/predictEdb','/chartThemeSet'].includes(this.$route.path)
+        //非ETA图库图表也不设置自定义上下限,相关性和统计特征也会用到曲线图
+        //若chartInfo.Source为1,需在之前调用setLimitData
+        const isETASource = this.chartInfo.Source===1
         let minLimit = 0,maxLimit = 0
-        if(useTableLimit){
+        if(useTableLimit||!isETASource){
             minLimit = newval[sameSideIndex].MinData
             maxLimit = newval[sameSideIndex].MaxData
-        }else{
+        }
+        if(!useTableLimit&&isETASource){
             const limitMap = {
                 0:this.rightLimitData||[],
                 1:this.leftLimitData||[],
@@ -2657,7 +2661,7 @@ export const chartSetMixin = {
 				});
 			}
 		},
-        /* ----自定义上下限相关--- */
+    /* ----自定义上下限相关--- */
         /* 计算y轴上下限 */
         calcYAxislimit(tableData=[]) {
             //散点图单独处理
@@ -2788,6 +2792,6 @@ export const chartSetMixin = {
                 }
             }
         },
-        /*-------------------- */
+    /*-------------------- */
 	}
 }

+ 1 - 1
src/views/mychart_manage/components/chartDetailDia.vue

@@ -214,7 +214,7 @@
               <template v-if="!chartInfo.WarnMsg">
                 <Chart :options="options" :chartInfo="chartInfo" ref="chartRef"/>
                 <!-- 上下限 -->
-                <template v-if="![7,10].includes(chartInfo.ChartType)">
+                <template v-if="chartInfo.Source===1&&![7,10,11].includes(chartInfo.ChartType)">
                     <div class="range-cont left" v-if="leftIndex !== -1">
                         <el-input
                             style="width: 60px; display: block"

+ 15 - 6
src/views/ppt_manage/mixins/mixins.js

@@ -119,14 +119,23 @@ export default {
         //轴位置值相同的下标
         let sameSideIndex = chartData.findIndex(i => i.IsAxis === item.IsAxis);
         //获取对应轴的上下限
+        //非ETA图库图表也不设置自定义上下限
+        const isETASource = this.chartInfo.Source===1
         let minLimit = 0,maxLimit = 0
-        const limitMap = {
-            0:this.rightLimitData||[],
-            1:this.leftLimitData||[],
-            2:this.rightTwoLimitData||[]
+        if(isETASource){
+            const limitMap = {
+                0:this.rightLimitData||[],
+                1:this.leftLimitData||[],
+                2:this.rightTwoLimitData||[]
+            }
+            minLimit = limitMap[item.IsAxis][1]||0
+            maxLimit = limitMap[item.IsAxis][0]||0
+        }else{
+            minLimit = this.dataList[sameSideIndex].MinData
+            maxLimit = this.dataList[sameSideIndex].MaxData
+            console.log('useDefault',minLimit,maxLimit)
         }
-        minLimit = limitMap[item.IsAxis][1]||0
-        maxLimit = limitMap[item.IsAxis][0]||0
+        
         //y轴
         const textZh = item.ConvertUnit||item.Unit
         const textEn = item.ConvertEnUnit||item.UnitEn||item.ConvertUnit||item.Unit