Ver Fonte

fix 右轴同比和指标切换时,显示错误

cxmo há 1 ano atrás
pai
commit
6e7bb804fe

+ 7 - 1
src/views/dataEntry_manage/components/addRightEdbDialog.vue

@@ -14,7 +14,7 @@
     >
         <div class="container">
            <div class="type-select">
-                <el-radio-group v-model="rightEdbForm.IndicatorType">
+                <el-radio-group v-model="rightEdbForm.IndicatorType" @change="indicatorTypeChange">
                     <el-radio :label="1"><!-- 左轴指标同比 -->{{ $t('EtaChartAddPage.right_edb_type_on_year') }}</el-radio>
                     <el-radio :label="2"><!-- 指标库 -->{{ $t('EtaChartAddPage.right_edb_type_lib') }}</el-radio>
                     <el-radio :label="3"><!-- 预测指标 -->{{ $t('EtaChartAddPage.right_edb_type_pred') }}</el-radio>
@@ -220,6 +220,12 @@ export default {
         };
     },
     methods: {
+        indicatorTypeChange(){
+            //清空指标信息
+            this.search_txt=''
+            this.searchOptions=[]
+            this.rightEdbData={}
+        },
         /* 搜索 */
         searchHandle(query) {
             this.search_page = 1;

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

@@ -454,7 +454,7 @@ export default {
             UnitEn:''
 
         }
-        this.rightEdbForm = tableData
+        this.rightEdbInfo = tableData
         Object.assign(this.rightEdbForm,form)
         this.rightEdbForm.IsAdd = true
         this.rightEdbForm.IsShow = true

+ 4 - 3
src/views/dataEntry_manage/mixins/addOreditMixin.js

@@ -1178,13 +1178,14 @@ export default {
 				this.chartLimit.rightMin = MinData
 				this.chartLimit.rightMax = MaxData
 				//如果右轴有设置更新tableData&updateData
-				if(RightAxis.IsAdd&&RightAxis.IndicatorType!==1){
+				if(RightAxis.IsAdd){
 					this.tableData = EdbInfoList
 					this.updateData = this.tableData.map(item=>{
 						return this.formatUpdateData(item)
 					})
-				}else{
-					this.reLoadChartOption()
+					
+					//弹窗回显
+					this.$refs.markerSectionRef.rightEdbInfo =RightAxis.IndicatorType!==1? _.cloneDeep(EdbInfoList[1]):{}
 				}
 				
 			})