|
@@ -78,57 +78,7 @@ export const chartSetMixin = {
|
|
|
'周': 'W',
|
|
|
'天': 'D',
|
|
|
},
|
|
|
- // tableColums: [
|
|
|
- // {
|
|
|
- // label: '指标名称',
|
|
|
- // key: 'EdbName',
|
|
|
- // enKey:'EdbNameEn',
|
|
|
- // inputTip:'点击输入英文指标名称',
|
|
|
- // minwidthsty: '150px',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '指标ID',
|
|
|
- // key: 'EdbCode',
|
|
|
- // widthsty: '120px',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '更新频度',
|
|
|
- // key: 'Frequency',
|
|
|
- // enKey:'FrequencyEn',
|
|
|
- // minwidthsty: '60px',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '单位',
|
|
|
- // key: 'Unit',
|
|
|
- // enKey:'UnitEn',
|
|
|
- // inputTip:'英文单位',
|
|
|
- // minwidthsty: '50px',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '起始时间',
|
|
|
- // key: 'StartDate',
|
|
|
- // minwidthsty: '100px',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '最新日期',
|
|
|
- // key: 'LatestDate',
|
|
|
- // minwidthsty: '90px',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '最新值',
|
|
|
- // key: 'LatestValue',
|
|
|
- // minwidthsty: '90px',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '最近更新',
|
|
|
- // key: 'ModifyTime',
|
|
|
- // minwidthsty: '100px',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '数据来源',
|
|
|
- // key: 'SourceName',
|
|
|
- // },
|
|
|
- // ],//表格列
|
|
|
+
|
|
|
tableData: [],//表格指标数据
|
|
|
options: {}, //配置options
|
|
|
leftIndex: -1, //左侧上下限对应下标
|
|
@@ -148,7 +98,7 @@ export const chartSetMixin = {
|
|
|
|
|
|
isShowSaveOther: false,//图表另存为弹窗
|
|
|
// -------------切换图表中英文
|
|
|
- currentLang:'ch', // ch(中文) en(英文)
|
|
|
+ // currentLang:'zh', // ch(中文) en(英文)
|
|
|
setEnName:false,
|
|
|
// 传入的formItem所需内容
|
|
|
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
|
|
|
|
|
|
//不同图表来源 1eta图 2商品价格图 3相关性图表
|
|
|
const sourceMap = {
|
|
@@ -300,84 +252,252 @@ export const chartSetMixin = {
|
|
|
2: this.changeCommodityLang,
|
|
|
3: this.changeRelevanceLang,
|
|
|
4: this.changeRelevanceLang,
|
|
|
- 5: this.changeCommodityLang,
|
|
|
- // 10: wydgw
|
|
|
+ 5: this.changeCommodityLang
|
|
|
}
|
|
|
|
|
|
- sourceMap[this.chartInfo.Source]()
|
|
|
+ sourceMap[this.chartInfo.Source]&&sourceMap[this.chartInfo.Source]()
|
|
|
},
|
|
|
- // 打开设置英文信息弹窗
|
|
|
- async openEnNameDia(){
|
|
|
+ // // 打开设置英文信息弹窗
|
|
|
+ // async openEnNameDia(){
|
|
|
+ // this.formItemArray={}
|
|
|
+ // this.formItemArray.chartInfo=[]
|
|
|
+ // this.formItemArray.chartsList=[]
|
|
|
+ // this.formItemArray.chartInfo.push({
|
|
|
+ // label:/* '图表名称' */this.$t('Chart.Detail.chart_name'),
|
|
|
+ // value: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')
|
|
|
+ // })
|
|
|
+
|
|
|
+ // 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,
|
|
|
+ // key:'EdbName',
|
|
|
+ // id:item.EdbInfoId,
|
|
|
+ // notEdit:true
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label:/* '单位' */this.$t('Edb.Detail.e_unit'),
|
|
|
+ // value: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')})
|
|
|
+ // }
|
|
|
+ // ])
|
|
|
+ // }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')})
|
|
|
+ // }
|
|
|
+ // ])
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // //价格曲线
|
|
|
+ // if(this.chartInfo.Source===2) {
|
|
|
+ // this.formItemArray.chartInfo.push({
|
|
|
+ // label:/* '期货名称' */this.$t('Chart.Detail.good_name'),
|
|
|
+ // value: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')})
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // //利润曲线
|
|
|
+ // else if(this.chartInfo.Source===5) {
|
|
|
+ // this.formItemArray.chartInfo.push({
|
|
|
+ // label:/* '盘面利润名称' */this.$t('Chart.Detail.profit_name'),
|
|
|
+ // value: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')})
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // //跨品种分析
|
|
|
+ // else if(this.chartInfo.Source===10) {
|
|
|
+ // let { Data } = await crossVarietyInterface.chartLangOption({ChartInfoId: this.chartInfo.ChartInfoId})
|
|
|
+
|
|
|
+ // const { TagList,VarietyList } = Data;
|
|
|
+
|
|
|
+ // this.formItemArray.chartInfo.push({
|
|
|
+ // label:/* 'X轴名称' */this.$t('Chart.Detail.x_name'),
|
|
|
+ // value:this.crossVarietyChartData.XName,
|
|
|
+ // key:'XName',
|
|
|
+ // id:TagList[0].ChartTagId,
|
|
|
+ // notEdit:true
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label:/* '英文X轴名称' */this.$t('Chart.Detail.x_en_name'),
|
|
|
+ // value:this.crossVarietyChartData.XNameEn,
|
|
|
+ // key:'XNameEn',
|
|
|
+ // id:TagList[0].ChartTagId,
|
|
|
+ // placeholder:/* '请输入英文X轴名称' */this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.x_en_name')})
|
|
|
+ // },{
|
|
|
+ // label:/* 'Y轴名称' */this.$t('Chart.Detail.y_name'),
|
|
|
+ // value:this.crossVarietyChartData.YName,
|
|
|
+ // key:'YName',
|
|
|
+ // id:TagList[1].ChartTagId,
|
|
|
+ // notEdit:true
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label:/* '英文Y轴名称' */this.$t('Chart.Detail.y_en_name'),
|
|
|
+ // value:this.crossVarietyChartData.YNameEn,
|
|
|
+ // key:'YNameEn',
|
|
|
+ // id:TagList[1].ChartTagId,
|
|
|
+ // placeholder:/* '请输入英文Y轴名称' */this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.y_en_name')})
|
|
|
+ // })
|
|
|
+
|
|
|
+ // VarietyList.forEach(item => {
|
|
|
+ // this.formItemArray.chartsList.push([
|
|
|
+ // {
|
|
|
+ // label:/* '品种名称' */this.$t('Chart.Detail.variety_name'),
|
|
|
+ // value: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')})
|
|
|
+ // }
|
|
|
+ // ])
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ // this.setEnName = true
|
|
|
+ // },
|
|
|
+ // // 更新英文信息
|
|
|
+ // async updateEnName(enNameData){
|
|
|
+ // // console.log(enNameData)
|
|
|
+ // 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 || ''
|
|
|
+ // })
|
|
|
+ // }else if(this.chartInfo.Source===3){//相关性
|
|
|
+ // res=await chartRelevanceApi.editChartEn({
|
|
|
+ // ChartInfoId: enNameData.ChartInfoId,
|
|
|
+ // ChartNameEn: enNameData.ChartNameEn
|
|
|
+ // })
|
|
|
+ // }else if(this.chartInfo.Source===6){//拟合方程
|
|
|
+ // res=await fittingEquationInterface.editChartEn({
|
|
|
+ // ChartInfoId: enNameData.ChartInfoId,
|
|
|
+ // ChartNameEn: enNameData.ChartNameEn
|
|
|
+ // })
|
|
|
+ // }else if([7,8,9].includes(this.chartInfo.Source)){//统计特征
|
|
|
+ // res=await statisticFeatureInterface.editChartEn({
|
|
|
+ // ChartInfoId: enNameData.ChartInfoId,
|
|
|
+ // ChartNameEn: enNameData.ChartNameEn
|
|
|
+ // })
|
|
|
+ // }else if(this.chartInfo.Source === 10) {//跨品种分析
|
|
|
+ // res=await crossVarietyInterface.editChartEn(enNameData)
|
|
|
+ // }else{
|
|
|
+ // res = await dataBaseInterface.chartInfoEditEn(enNameData)
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if(res.Ret !==200) return
|
|
|
+
|
|
|
+ // this.$message.success(this.$t('MsgPrompt.edit_msg'))
|
|
|
+ // this.getChartInfo()
|
|
|
+ // this.setEnName = false
|
|
|
+ // },
|
|
|
+
|
|
|
+ /* 打开编辑信息弹窗 */
|
|
|
+ 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:/* 'X轴名称' */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:/* '请输入X轴名称' */this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.x_name')})
|
|
|
},
|
|
|
{
|
|
|
- label:/* '英文X轴名称' */this.$t('Chart.Detail.x_en_name'),
|
|
|
- value:this.crossVarietyChartData.XNameEn,
|
|
|
- key:'XNameEn',
|
|
|
- id:TagList[0].ChartTagId,
|
|
|
- placeholder:/* '请输入英文X轴名称' */this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.x_en_name')})
|
|
|
- },{
|
|
|
label:/* 'Y轴名称' */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:/* '英文Y轴名称' */this.$t('Chart.Detail.y_en_name'),
|
|
|
- value:this.crossVarietyChartData.YNameEn,
|
|
|
- key:'YNameEn',
|
|
|
- id:TagList[1].ChartTagId,
|
|
|
- placeholder:/* '请输入英文Y轴名称' */this.$t('Chart.InputHolderAll.input_common',{label:this.$t('Chart.Detail.y_en_name')})
|
|
|
+ placeholder:/* '请输入Y轴名称' */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){
|
|
|
- // console.log(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() {
|
|
|
//x轴
|
|
|
- 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)
|
|
|
});
|
|
|
}
|
|
|
//截面散点 x轴标题
|
|
|
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
|
|
|
});
|
|
|
//tooltip
|
|
|
- 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
|
|
|
//x轴
|
|
|
- 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
|
|
|
});
|
|
|
//tooltip
|
|
|
- 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') {
|
|
|
// IsAxis左轴1 右轴0 2右2轴
|
|
|
//IsOrder正序false 逆序true
|
|
|
//EdbInfoType是否是领先指标
|
|
|
// lang ch 中文 en 英文
|
|
|
- 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);
|