|
@@ -78,57 +78,7 @@ export const chartSetMixin = {
|
|
|
'周': 'W',
|
|
|
'天': 'D',
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
tableData: [],
|
|
|
options: {},
|
|
|
leftIndex: -1,
|
|
@@ -148,7 +98,7 @@ export const chartSetMixin = {
|
|
|
|
|
|
isShowSaveOther: false,
|
|
|
|
|
|
- currentLang:'ch',
|
|
|
+
|
|
|
setEnName:false,
|
|
|
|
|
|
formItemArray:[],
|
|
@@ -200,7 +150,10 @@ export const chartSetMixin = {
|
|
|
crossVarietyChartData: {},
|
|
|
|
|
|
|
|
|
- radarChartData: {}
|
|
|
+ radarChartData: {},
|
|
|
+
|
|
|
+
|
|
|
+ isLangInfoDia: false
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
@@ -259,7 +212,10 @@ export const chartSetMixin = {
|
|
|
},
|
|
|
yearSelector() {
|
|
|
return yearSelector
|
|
|
- }
|
|
|
+ },
|
|
|
+ currentLang() {
|
|
|
+ return this.$store.state.lang
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
|
|
@@ -277,22 +233,18 @@ export const chartSetMixin = {
|
|
|
newval.DataList && this.setSectionScatterChart();
|
|
|
},
|
|
|
deep: true
|
|
|
+ },
|
|
|
+
|
|
|
+ currentLang() {
|
|
|
+ this.changeLanguage()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
- async changeLanguage(lang){
|
|
|
+ async changeLanguage(){
|
|
|
this.search_txt = '';
|
|
|
- this.currentLang = lang;
|
|
|
|
|
|
- if(this.$route.path === '/chartsetting') {
|
|
|
- await dataBaseInterface.setUserLang({
|
|
|
- ConfigCode: 'chart_language',
|
|
|
- ConfigValue: lang === 'en' ? 'EN' : 'CN'
|
|
|
- })
|
|
|
- this.setLangIntoStore();
|
|
|
- if(!this.selected_chartid) return
|
|
|
- }
|
|
|
+ if(!this.$refs.chartRef) return
|
|
|
|
|
|
|
|
|
const sourceMap = {
|
|
@@ -300,84 +252,252 @@ export const chartSetMixin = {
|
|
|
2: this.changeCommodityLang,
|
|
|
3: this.changeRelevanceLang,
|
|
|
4: this.changeRelevanceLang,
|
|
|
- 5: this.changeCommodityLang,
|
|
|
-
|
|
|
+ 5: this.changeCommodityLang
|
|
|
}
|
|
|
|
|
|
- sourceMap[this.chartInfo.Source]()
|
|
|
+ sourceMap[this.chartInfo.Source]&&sourceMap[this.chartInfo.Source]()
|
|
|
},
|
|
|
-
|
|
|
- async openEnNameDia(){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ async openLangInfoDia() {
|
|
|
this.formItemArray={}
|
|
|
this.formItemArray.chartInfo=[]
|
|
|
this.formItemArray.chartsList=[]
|
|
|
this.formItemArray.chartInfo.push({
|
|
|
label:this.$t('Chart.Detail.chart_name'),
|
|
|
- value:this.chartInfo.ChartName,
|
|
|
+ value: this.currentLang==='en'?this.chartInfo.ChartNameEn:this.chartInfo.ChartName,
|
|
|
key:'ChartName',
|
|
|
id:this.chartInfo.ChartInfoId,
|
|
|
source: this.chartInfo.Source,
|
|
|
- notEdit:true
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t('Chart.Detail.chart_en_name'),
|
|
|
- value:this.chartInfo.ChartNameEn,
|
|
|
- key:'ChartNameEn',
|
|
|
- id:this.chartInfo.ChartInfoId,
|
|
|
- placeholder:this.$t('Chart.InputHolderAll.input_en_name')
|
|
|
+ placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.chart_name')})
|
|
|
})
|
|
|
|
|
|
if([1,2,5].includes(this.chartInfo.Source)){
|
|
|
this.tableData.map(item =>{
|
|
|
- if(item.Unit){
|
|
|
this.formItemArray.chartsList.push([
|
|
|
{
|
|
|
label:this.$t('Edb.Detail.e_name'),
|
|
|
- value:item.EdbName,
|
|
|
+ value:this.currentLang==='en'?item.EdbNameEn:item.EdbName,
|
|
|
key:'EdbName',
|
|
|
id:item.EdbInfoId,
|
|
|
- notEdit:true
|
|
|
+ placeholder: this.$t('Edb.InputHolderAll.input_common',{label: this.$t('Edb.Detail.e_name')})
|
|
|
},
|
|
|
{
|
|
|
label:this.$t('Edb.Detail.e_unit'),
|
|
|
- value:item.Unit,
|
|
|
+ value:this.currentLang==='en'?item.UnitEn:item.Unit,
|
|
|
key:'Unit',
|
|
|
id:item.EdbInfoId,
|
|
|
- notEdit:true
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t('Edb.Detail.e_en_name'),
|
|
|
- value:item.EdbNameEn,
|
|
|
- key:'EdbNameEn',
|
|
|
- id:item.EdbInfoId,
|
|
|
- placeholder: this.$t('Edb.InputHolderAll.input_common',{label: this.$t('Edb.Detail.e_en_name')})
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t('Edb.Detail.e_en_unit'),
|
|
|
- value:item.UnitEn,
|
|
|
- key:'UnitEn',
|
|
|
- id:item.EdbInfoId,
|
|
|
- placeholder:this.$t('Edb.InputHolderAll.input_common',{label: this.$t('Edb.Detail.e_en_unit')})
|
|
|
+ placeholder: this.$t('Edb.InputHolderAll.input_common',{label: this.$t('Edb.Detail.e_unit')})
|
|
|
}
|
|
|
])
|
|
|
- }else{
|
|
|
- this.formItemArray.chartsList.push([
|
|
|
- {
|
|
|
- label:this.$t('Edb.Detail.e_name'),
|
|
|
- value:item.EdbName,
|
|
|
- key:'EdbName',
|
|
|
- id:item.EdbInfoId,
|
|
|
- notEdit:true
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t('Edb.Detail.e_en_name'),
|
|
|
- value:item.EdbNameEn,
|
|
|
- key:'EdbNameEn',
|
|
|
- id:item.EdbInfoId,
|
|
|
- placeholder:this.$t('Edb.InputHolderAll.input_common',{label: this.$t('Edb.Detail.e_en_name')})
|
|
|
- }
|
|
|
- ])
|
|
|
- }
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -385,17 +505,10 @@ export const chartSetMixin = {
|
|
|
if(this.chartInfo.Source===2) {
|
|
|
this.formItemArray.chartInfo.push({
|
|
|
label:this.$t('Chart.Detail.good_name'),
|
|
|
- value:this.commodityEdbList[1].EdbName,
|
|
|
+ value:this.currentLang==='en'?this.commodityEdbList[1].EdbNameEn:this.commodityEdbList[1].EdbName,
|
|
|
key:'FutureGoodName',
|
|
|
id:this.chartInfo.ChartInfoId,
|
|
|
- notEdit:true
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t('Chart.Detail.good_en_name'),
|
|
|
- value:this.commodityEdbList[1].EdbNameEn,
|
|
|
- key:'FutureGoodNameEn',
|
|
|
- id:this.chartInfo.ChartInfoId,
|
|
|
- placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.good_en_name')})
|
|
|
+ placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.good_name')})
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -403,17 +516,10 @@ export const chartSetMixin = {
|
|
|
else if(this.chartInfo.Source===5) {
|
|
|
this.formItemArray.chartInfo.push({
|
|
|
label:this.$t('Chart.Detail.profit_name'),
|
|
|
- value:this.chartInfo.ProfitName,
|
|
|
+ value: this.currentLang==='en'?this.chartInfo.ProfitNameEn:this.chartInfo.ProfitName,
|
|
|
key:'ProfitName',
|
|
|
id:this.chartInfo.ChartInfoId,
|
|
|
- notEdit:true
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t('Chart.Detail.profit_en_name'),
|
|
|
- value:this.chartInfo.ProfitNameEn,
|
|
|
- key:'ProfitNameEn',
|
|
|
- id:this.chartInfo.ChartInfoId,
|
|
|
- placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.profit_en_name')})
|
|
|
+ placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.profit_en_name')})
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -425,106 +531,85 @@ export const chartSetMixin = {
|
|
|
|
|
|
this.formItemArray.chartInfo.push({
|
|
|
label:this.$t('Chart.Detail.x_name'),
|
|
|
- value:this.crossVarietyChartData.XName,
|
|
|
+ value:this.currentLang==='en'?this.crossVarietyChartData.XNameEn:this.crossVarietyChartData.XName,
|
|
|
key:'XName',
|
|
|
id:TagList[0].ChartTagId,
|
|
|
- notEdit:true
|
|
|
+ placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.x_name')})
|
|
|
},
|
|
|
{
|
|
|
- label:this.$t('Chart.Detail.x_en_name'),
|
|
|
- value:this.crossVarietyChartData.XNameEn,
|
|
|
- key:'XNameEn',
|
|
|
- id:TagList[0].ChartTagId,
|
|
|
- placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.x_en_name')})
|
|
|
- },{
|
|
|
label:this.$t('Chart.Detail.y_name'),
|
|
|
- value:this.crossVarietyChartData.YName,
|
|
|
+ value:this.currentLang==='en'?this.crossVarietyChartData.YNameEn:this.crossVarietyChartData.YName,
|
|
|
key:'YName',
|
|
|
id:TagList[1].ChartTagId,
|
|
|
- notEdit:true
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t('Chart.Detail.y_en_name'),
|
|
|
- value:this.crossVarietyChartData.YNameEn,
|
|
|
- key:'YNameEn',
|
|
|
- id:TagList[1].ChartTagId,
|
|
|
- placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.y_en_name')})
|
|
|
+ placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.y_name')})
|
|
|
})
|
|
|
|
|
|
VarietyList.forEach(item => {
|
|
|
- this.formItemArray.chartsList.push([
|
|
|
+ this.formItemArray.chartsList.push(
|
|
|
{
|
|
|
label:this.$t('Chart.Detail.variety_name'),
|
|
|
- value:item.ChartVarietyName,
|
|
|
+ value:this.currentLang==='en'?item.ChartVarietyNameEn:item.ChartVarietyName,
|
|
|
key:'ChartVarietyName',
|
|
|
id:item.ChartVarietyId,
|
|
|
- notEdit:true
|
|
|
- },
|
|
|
- {
|
|
|
- label:this.$t('Chart.Detail.variety_en_name'),
|
|
|
- value:item.ChartVarietyNameEn,
|
|
|
- key:'ChartVarietyNameEn',
|
|
|
- id:item.ChartVarietyId,
|
|
|
- placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.variety_en_name')})
|
|
|
+ placeholder:this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.variety_name')})
|
|
|
}
|
|
|
- ])
|
|
|
+ )
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- this.setEnName = true
|
|
|
+ this.isLangInfoDia = true
|
|
|
},
|
|
|
-
|
|
|
- async updateEnName(enNameData){
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ async updateLang(paramsData) {
|
|
|
let res=null
|
|
|
if([2,5].includes(this.chartInfo.Source)){
|
|
|
- res=await futuresInterface.editChartEn({
|
|
|
- ChartInfoId: enNameData.ChartInfoId,
|
|
|
- ChartNameEn: enNameData.ChartNameEn,
|
|
|
- UnitEn: enNameData.ChartEdbInfoList[0].UnitEn || '',
|
|
|
- EdbNameEn: enNameData.ChartEdbInfoList[0].EdbNameEn || '',
|
|
|
- FutureGoodNameEn: enNameData.FutureGoodNameEn || '',
|
|
|
- ProfitNameEn: enNameData.ProfitNameEn || ''
|
|
|
+ res=await futuresInterface.setChartLangInfo({
|
|
|
+ ChartInfoId: paramsData.ChartInfoId,
|
|
|
+ ChartName: paramsData.ChartName,
|
|
|
+ Unit: paramsData.ChartEdbInfoList[0].Unit || '',
|
|
|
+ EdbName: paramsData.ChartEdbInfoList[0].EdbName || '',
|
|
|
+ FutureGoodName: paramsData.FutureGoodName || '',
|
|
|
+ ProfitName: paramsData.ProfitName || ''
|
|
|
})
|
|
|
}else if(this.chartInfo.Source===3){
|
|
|
- res=await chartRelevanceApi.editChartEn({
|
|
|
- ChartInfoId: enNameData.ChartInfoId,
|
|
|
- ChartNameEn: enNameData.ChartNameEn
|
|
|
+ res=await chartRelevanceApi.setChartLangInfo({
|
|
|
+ ChartInfoId: paramsData.ChartInfoId,
|
|
|
+ ChartName: paramsData.ChartName
|
|
|
})
|
|
|
}else if(this.chartInfo.Source===6){
|
|
|
- res=await fittingEquationInterface.editChartEn({
|
|
|
- ChartInfoId: enNameData.ChartInfoId,
|
|
|
- ChartNameEn: enNameData.ChartNameEn
|
|
|
+ res=await fittingEquationInterface.setChartLangInfo({
|
|
|
+ ChartInfoId: paramsData.ChartInfoId,
|
|
|
+ ChartNameEn: paramsData.ChartName
|
|
|
})
|
|
|
}else if([7,8,9].includes(this.chartInfo.Source)){
|
|
|
- res=await statisticFeatureInterface.editChartEn({
|
|
|
- ChartInfoId: enNameData.ChartInfoId,
|
|
|
- ChartNameEn: enNameData.ChartNameEn
|
|
|
+ res=await statisticFeatureInterface.setChartLangInfo({
|
|
|
+ ChartInfoId: paramsData.ChartInfoId,
|
|
|
+ ChartName: paramsData.ChartName
|
|
|
})
|
|
|
}else if(this.chartInfo.Source === 10) {
|
|
|
- res=await crossVarietyInterface.editChartEn(enNameData)
|
|
|
+ res=await crossVarietyInterface.setChartLangInfo(paramsData)
|
|
|
}else{
|
|
|
- res = await dataBaseInterface.chartInfoEditEn(enNameData)
|
|
|
+ res = await dataBaseInterface.setChartLangInfo(paramsData)
|
|
|
}
|
|
|
|
|
|
if(res.Ret !==200) return
|
|
|
|
|
|
this.$message.success(this.$t('MsgPrompt.edit_msg'))
|
|
|
this.getChartInfo()
|
|
|
- this.setEnName = false
|
|
|
+ this.isLangInfoDia = false
|
|
|
},
|
|
|
|
|
|
|
|
|
changeBarOptions() {
|
|
|
|
|
|
- this.options.xAxis.categories = this.barXIdList.map(_ => this.currentLang == 'ch'
|
|
|
+ this.options.xAxis.categories = this.barXIdList.map(_ => this.currentLang === 'zh'
|
|
|
? this.barEdbData.find(edb => edb.EdbInfoId===_).EdbAliasName
|
|
|
: this.barEdbData.find(edb => edb.EdbInfoId===_).EdbNameEn)
|
|
|
|
|
|
|
|
|
this.options.yAxis.forEach(item => {
|
|
|
- item.title.text = this.currentLang == 'ch' ? this.chartInfo.Unit : this.chartInfo.Unit;
|
|
|
+ item.title.text = this.currentLang === 'zh' ? this.chartInfo.Unit : this.chartInfo.Unit;
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -534,34 +619,34 @@ export const chartSetMixin = {
|
|
|
console.log(this.options,'options');
|
|
|
|
|
|
if(this.chartInfo.ChartType == 5){
|
|
|
- this.options.yAxis.title.text = this.currentLang == 'ch' ? this.options.yAxis.title.textCh : this.options.yAxis.title.textEn;
|
|
|
- this.options.xAxis.title.text = this.currentLang == 'ch' ? this.options.xAxis.title.textCh : this.options.xAxis.title.textEn
|
|
|
+ this.options.yAxis.title.text = this.currentLang == 'zh' ? this.options.yAxis.title.textCh : this.options.yAxis.title.textEn;
|
|
|
+ this.options.xAxis.title.text = this.currentLang == 'zh' ? this.options.xAxis.title.textCh : this.options.xAxis.title.textEn
|
|
|
this.options.series.forEach(item => {
|
|
|
- item.name = this.currentLang == 'ch' ? item.nameCh : item.nameEn;
|
|
|
+ item.name = this.currentLang == 'zh' ? item.nameCh : item.nameEn;
|
|
|
});
|
|
|
- this.options.tooltip.formatter = this.currentLang == 'ch' ? this.options.tooltip.formatterCh : this.options.tooltip.formatterEn;
|
|
|
+ this.options.tooltip.formatter = this.currentLang == 'zh' ? this.options.tooltip.formatterCh : this.options.tooltip.formatterEn;
|
|
|
}else{
|
|
|
|
|
|
this.options.yAxis.forEach(item => {
|
|
|
- item.title.text = this.currentLang == 'ch' ? item.title.textCh : item.title.textEn;
|
|
|
+ item.title.text = this.currentLang == 'zh' ? item.title.textCh : item.title.textEn;
|
|
|
});
|
|
|
|
|
|
if(this.chartInfo.ChartType != 2){
|
|
|
|
|
|
this.options.series.forEach(item => {
|
|
|
- item.name = this.currentLang == 'ch'
|
|
|
+ item.name = this.currentLang == 'zh'
|
|
|
? item.nameCh
|
|
|
: (item.nameEn||item.nameCh)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if(this.chartInfo.ChartType === 10){
|
|
|
- this.options.xAxis.title.text = this.currentLang == 'ch' ? this.options.xAxis.title.textCh : this.options.xAxis.title.textEn;
|
|
|
- this.options.tooltip.formatter = this.currentLang == 'ch' ? this.options.tooltip.formatterCh : this.options.tooltip.formatterEn;
|
|
|
+ this.options.xAxis.title.text = this.currentLang == 'zh' ? this.options.xAxis.title.textCh : this.options.xAxis.title.textEn;
|
|
|
+ this.options.tooltip.formatter = this.currentLang == 'zh' ? this.options.tooltip.formatterCh : this.options.tooltip.formatterEn;
|
|
|
this.options.series.forEach(item => {
|
|
|
if(!item.linkedTo) {
|
|
|
item.data.forEach(point => {
|
|
|
- point.dataLabels.format = this.currentLang == 'ch' ? point.dataLabels.formatCh : (point.dataLabels.formatEn||point.dataLabels.formatCh);
|
|
|
+ point.dataLabels.format = this.currentLang == 'zh' ? point.dataLabels.formatCh : (point.dataLabels.formatEn||point.dataLabels.formatCh);
|
|
|
point.dataLabels.color = (this.currentLang==='en' && !point.dataLabels.formatEn) ? '#999' : '#333'
|
|
|
})
|
|
|
}
|
|
@@ -577,30 +662,30 @@ export const chartSetMixin = {
|
|
|
changeCommodityLang() {
|
|
|
console.log(this.options)
|
|
|
this.options.yAxis.forEach(item => {
|
|
|
- item.title.text = this.currentLang == 'ch' ? item.title.textCh : item.title.textEn
|
|
|
+ item.title.text = this.currentLang == 'zh' ? item.title.textCh : item.title.textEn
|
|
|
});
|
|
|
|
|
|
this.options.series.forEach(item => {
|
|
|
- item.name = this.currentLang == 'ch' ? item.nameCh : item.nameEn
|
|
|
+ item.name = this.currentLang == 'zh' ? item.nameCh : item.nameEn
|
|
|
});
|
|
|
|
|
|
- this.options.tooltip.formatter = this.currentLang == 'ch' ? this.options.tooltip.formatterCh : this.options.tooltip.formatterEn
|
|
|
+ this.options.tooltip.formatter = this.currentLang == 'zh' ? this.options.tooltip.formatterCh : this.options.tooltip.formatterEn
|
|
|
|
|
|
- this.options.xAxis.categories = this.commodityXData.map(_ => this.currentLang == 'ch' ? _.Name:_.NameEn);
|
|
|
+ this.options.xAxis.categories = this.commodityXData.map(_ => this.currentLang == 'zh' ? _.Name:_.NameEn);
|
|
|
},
|
|
|
|
|
|
|
|
|
changeRelevanceLang(){
|
|
|
this.options.yAxis.forEach(item => {
|
|
|
- item.title.text = this.currentLang == 'ch' ? item.title.textCh : item.title.textEn
|
|
|
+ item.title.text = this.currentLang == 'zh' ? item.title.textCh : item.title.textEn
|
|
|
});
|
|
|
|
|
|
this.options.series.forEach(item => {
|
|
|
- item.name = this.currentLang == 'ch' ? item.nameCh : item.nameEn
|
|
|
+ item.name = this.currentLang == 'zh' ? item.nameCh : item.nameEn
|
|
|
});
|
|
|
|
|
|
- this.options.tooltip.formatter = this.currentLang == 'ch' ? this.options.tooltip.formatterCh : this.options.tooltip.formatterEn
|
|
|
- this.options.xAxis.title.text=this.currentLang == 'ch' ? this.options.xAxis.title.textCh : this.options.xAxis.title.textEn
|
|
|
+ this.options.tooltip.formatter = this.currentLang == 'zh' ? this.options.tooltip.formatterCh : this.options.tooltip.formatterEn
|
|
|
+ this.options.xAxis.title.text=this.currentLang == 'zh' ? this.options.xAxis.title.textCh : this.options.xAxis.title.textEn
|
|
|
},
|
|
|
|
|
|
|
|
@@ -2374,31 +2459,31 @@ export const chartSetMixin = {
|
|
|
},
|
|
|
|
|
|
|
|
|
- concatDynamicTag({ IsAxis,IsOrder,EdbInfoType,LeadValue,LeadUnit },lang='ch') {
|
|
|
+ concatDynamicTag({ IsAxis,IsOrder,EdbInfoType,LeadValue,LeadUnit },lang='zh') {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- const axisLabelMap = lang=='ch'?{
|
|
|
+ const axisLabelMap = lang=='zh'?{
|
|
|
0: '右轴',
|
|
|
2: '右2轴'
|
|
|
}:{
|
|
|
0: 'RHS',
|
|
|
2: '2-RHS'
|
|
|
}
|
|
|
- const orderLabelMap = lang=='ch'?{
|
|
|
+ const orderLabelMap = lang=='zh'?{
|
|
|
1: '逆序'
|
|
|
}:{
|
|
|
1: 'REV'
|
|
|
}
|
|
|
- const edbInfoMap = lang=='ch'?{
|
|
|
+ const edbInfoMap = lang=='zh'?{
|
|
|
0: '领先'
|
|
|
}:{
|
|
|
0: 'Lead'
|
|
|
}
|
|
|
|
|
|
|
|
|
- const leadUnit = lang==='ch' ? LeadUnit : this.leadUnitEnMap[LeadUnit];
|
|
|
+ const leadUnit = lang==='zh' ? LeadUnit : this.leadUnitEnMap[LeadUnit];
|
|
|
|
|
|
let axis_tag = axisLabelMap[IsAxis] || '';
|
|
|
|
|
@@ -2551,7 +2636,7 @@ export const chartSetMixin = {
|
|
|
let count = parseInt(widthNum / 21);
|
|
|
let reg = new RegExp("(.{" + count + "})", "g");
|
|
|
let newTitle = ''
|
|
|
- if(this.currentLang == 'ch'){
|
|
|
+ if(this.currentLang == 'zh'){
|
|
|
newTitle = _.cloneDeep(ChartName).replace(/\s/g, "").replace(reg, "$1<br/>");
|
|
|
}else{
|
|
|
newTitle = _.cloneDeep(ChartName);
|