Browse Source

Merge branch 'eta_web_comp'

hbchen 10 months ago
parent
commit
4cd378defa
1 changed files with 10 additions and 7 deletions
  1. 10 7
      src/CustomElement/EtaChart.ce.vue

+ 10 - 7
src/CustomElement/EtaChart.ce.vue

@@ -33,7 +33,7 @@ async function getChartData(){
         chartInfo.value=res.Data.ChartInfo
         dataList.value=res.Data.ChartInfo.Source === 1 ? res.Data.EdbInfoList : [res.Data.EdbInfoList[0]];
         chartBoxId.value=`hz-chart_${params.code}_${new Date().getTime()}`
-        //处理英文研报英文设置不全就展示中文
+
         setLangFromEnReport();
         haveData.value = true;
         nextTick(()=>{
@@ -46,7 +46,7 @@ async function getChartData(){
                     },
                 },
                 renderId:chartContentEl.value,
-                lang:'zh',
+                lang:params.language,
                 changeLangIsCheck:false,
                 showChartTitle:false
             })
@@ -59,11 +59,14 @@ async function getChartData(){
 
 const setLangFromEnReport=()=>{
     //来源于英文研报
-    if(params.fromPage !== 'en') return
-    let is_name_en = chartInfo.value.ChartNameEn ? true : false;//名称是否有英文
-    let is_target_en = [2,9,10].includes(chartInfo.value.ChartType) ? true : dataList.value.every(_ => _.EdbNameEn);//指标是否有英文
-    params.language = (is_name_en && is_target_en) ? 'en' : 'ch';
-    params.language='ch'
+    params.language = params.fromPage || params.lang || 'zh'
+
+    // 不再校验英文是否完整
+    // if(params.fromPage !== 'en') return
+    // let is_name_en = chartInfo.value.ChartNameEn ? true : false;//名称是否有英文
+    // let is_target_en = [2,9,10].includes(chartInfo.value.ChartType) ? true : dataList.value.every(_ => _.EdbNameEn);//指标是否有英文
+    // params.language = (is_name_en && is_target_en) ? 'en' : 'ch';
+    // params.language='ch'
 }
 
 getChartData()