|
@@ -7,7 +7,7 @@ import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
|
|
|
import {pptEnInterface} from '@/api/modules/pptEnApi.js';
|
|
|
import * as sheetInterface from '@/api/modules/sheetApi.js';
|
|
|
import futuresInterface from '@/api/modules/futuresBaseApi';
|
|
|
-import { fittingEquationInterface,statisticFeatureInterface } from '@/api/modules/chartRelevanceApi';
|
|
|
+import { fittingEquationInterface,statisticFeatureInterface,crossVarietyInterface } from '@/api/modules/chartRelevanceApi';
|
|
|
import chartRelevanceApi from '@/api/modules/chartRelevanceApi.js';
|
|
|
import { defaultOpts } from '@/utils/defaultOptions';
|
|
|
import {formatPPTDate,checkPPTpageElemant,getStrSize,isShowPPTTitle} from '../newVersion/utils/untils.js';
|
|
@@ -124,7 +124,18 @@ export default {
|
|
|
this.result = {status:'',content:'获取ppt数据失败!'}
|
|
|
}
|
|
|
},
|
|
|
- //ppt设置相关,引用mixins.js里的setOptions
|
|
|
+ //ppt设置相关,引用mixins.js里的setOptions chartType只有source是1才有用
|
|
|
+ /* Source 1 ; chartType 1曲线 2季节 3面积 4堆积柱 5散点 6组合 7柱形 8截面散点
|
|
|
+ * 2 商品价格
|
|
|
+ * 3 相关性
|
|
|
+ * 4 滚动相关性
|
|
|
+ * 5 商品利润
|
|
|
+ * 6 拟合方程
|
|
|
+ * 7 统计特征/标准差
|
|
|
+ * 8 统计特征/百分位
|
|
|
+ * 9 统计特征/频率
|
|
|
+ * 10 跨品种分析
|
|
|
+ */
|
|
|
//获取图表数据
|
|
|
async getchartData(id,lang='ch') {
|
|
|
const currentLang = this.currentLang || lang
|
|
@@ -187,6 +198,17 @@ export default {
|
|
|
this.dataList = res.Data.EdbInfoList;
|
|
|
this.statisticFrequencyData = res.Data.DataResp;
|
|
|
this.setStatisticFrequency();
|
|
|
+ }else if(this.chartInfo.Source===10) {
|
|
|
+ this.dataList = res.Data.EdbInfoList;
|
|
|
+ this.crossVarietyChartData = res.Data.DataResp;
|
|
|
+ this.chartLimit = {
|
|
|
+ min: Number(res.Data.DataResp.YMinValue),
|
|
|
+ max: Number(res.Data.DataResp.YMaxValue),
|
|
|
+ x_min: Number(res.Data.DataResp.XMinValue),
|
|
|
+ x_max: Number(res.Data.DataResp.XMaxValue)
|
|
|
+ }
|
|
|
+ this.setCrossVarietyChart();
|
|
|
+ this.changeRelevanceOptions();//更改英文一样
|
|
|
}
|
|
|
|
|
|
//根据图表数据获取配置项
|
|
@@ -299,16 +321,25 @@ export default {
|
|
|
if(!this.chartInfo.ChartNameEn){
|
|
|
result = false
|
|
|
}
|
|
|
- //指标名称:this.dataList[].EdbNameEn
|
|
|
- //指标单位:this.dataList[].UnitEn
|
|
|
- this.dataList.forEach(item=>{
|
|
|
- if(!item.EdbNameEn){
|
|
|
- result = false
|
|
|
- }
|
|
|
- if(this.chartInfo.ChartType!==10&&item.Unit&&!item.UnitEn){
|
|
|
- result = false
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
+ if(this.chartInfo.Source === 10) {
|
|
|
+ const { XNameEn,YNameEn,DataList } = this.crossVarietyChartData;
|
|
|
+
|
|
|
+ let haveOneNoEn = DataList.some(_ =>!_.NameEn);
|
|
|
+
|
|
|
+ if(haveOneNoEn || !XNameEn || !YNameEn) result = false
|
|
|
+ }else {
|
|
|
+ //指标名称:this.dataList[].EdbNameEn
|
|
|
+ //指标单位:this.dataList[].UnitEn
|
|
|
+ this.dataList.forEach(item=>{
|
|
|
+ if(!item.EdbNameEn){
|
|
|
+ result = false
|
|
|
+ }
|
|
|
+ if(this.chartInfo.ChartType!==10&&item.Unit&&!item.UnitEn){
|
|
|
+ result = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
return result
|
|
|
},
|
|
|
//刷新图表数据
|
|
@@ -608,6 +639,7 @@ export default {
|
|
|
value:chartInfo.ChartName,
|
|
|
key:'ChartName',
|
|
|
id:chartInfo.ChartInfoId,
|
|
|
+ source: chartInfo.Source,
|
|
|
notEdit:true
|
|
|
},
|
|
|
{
|
|
@@ -617,7 +649,7 @@ export default {
|
|
|
id:chartInfo.ChartInfoId,
|
|
|
placeholder:'请输入英文图表名称'
|
|
|
})
|
|
|
- if(![3,6,7,8,9].includes(chartInfo.Source)){
|
|
|
+ if([1,2,5].includes(chartInfo.Source)){
|
|
|
this.formItemArray.chartsList = tableData.map(item => {
|
|
|
return item.Unit
|
|
|
? [
|
|
@@ -688,7 +720,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
//利润曲线
|
|
|
- if(chartInfo.Source===5) {
|
|
|
+ else if(chartInfo.Source===5) {
|
|
|
this.formItemArray.chartInfo.push({
|
|
|
label:'盘面利润名称',
|
|
|
value:Data.DataResp.ProfitName,
|
|
@@ -704,6 +736,60 @@ export default {
|
|
|
placeholder:'请输入英文盘面利润名称'
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ //跨品种分析
|
|
|
+ else if(chartInfo.Source===10) {
|
|
|
+ let res = await crossVarietyInterface.chartLangOption({ChartInfoId: chartInfo.ChartInfoId})
|
|
|
+
|
|
|
+ const { TagList,VarietyList } = res.Data;
|
|
|
+
|
|
|
+ this.formItemArray.chartInfo.push({
|
|
|
+ label:'X轴名称',
|
|
|
+ value:Data.DataResp.XName,
|
|
|
+ key:'XName',
|
|
|
+ id:TagList[0].ChartTagId,
|
|
|
+ notEdit:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'英文X轴名称',
|
|
|
+ value:Data.DataResp.XNameEn,
|
|
|
+ key:'XNameEn',
|
|
|
+ id:TagList[0].ChartTagId,
|
|
|
+ placeholder:'请输入英文X轴名称'
|
|
|
+ },{
|
|
|
+ label:'Y轴名称',
|
|
|
+ value:Data.DataResp.YName,
|
|
|
+ key:'YName',
|
|
|
+ id:TagList[1].ChartTagId,
|
|
|
+ notEdit:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'英文Y轴名称',
|
|
|
+ value:Data.DataResp.YNameEn,
|
|
|
+ key:'YNameEn',
|
|
|
+ id:TagList[1].ChartTagId,
|
|
|
+ placeholder:'请输入英文Y轴名称'
|
|
|
+ })
|
|
|
+
|
|
|
+ VarietyList.forEach(item => {
|
|
|
+ this.formItemArray.chartsList.push([
|
|
|
+ {
|
|
|
+ label:'品种名称',
|
|
|
+ value:item.ChartVarietyName,
|
|
|
+ key:'ChartVarietyName',
|
|
|
+ id:item.ChartVarietyId,
|
|
|
+ notEdit:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'英文品种名称',
|
|
|
+ value:item.ChartVarietyNameEn,
|
|
|
+ key:'ChartVarietyNameEn',
|
|
|
+ id:item.ChartVarietyId,
|
|
|
+ placeholder:'请输入英文品种名称'
|
|
|
+ }
|
|
|
+ ])
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
this.setEnName = true
|
|
|
},
|
|
@@ -727,16 +813,18 @@ export default {
|
|
|
ChartInfoId: enNameData.ChartInfoId,
|
|
|
ChartNameEn: enNameData.ChartNameEn
|
|
|
})
|
|
|
- }else if(this.chartInfo.Source===6){//拟合方程
|
|
|
+ }else if(this.chart_source===6){//拟合方程
|
|
|
res=await fittingEquationInterface.editChartEn({
|
|
|
ChartInfoId: enNameData.ChartInfoId,
|
|
|
ChartNameEn: enNameData.ChartNameEn
|
|
|
})
|
|
|
- }else if(this.chartInfo.Source===7){//统计特征
|
|
|
+ }else if(this.chart_source===7){//统计特征
|
|
|
res=await statisticFeatureInterface.editChartEn({
|
|
|
ChartInfoId: enNameData.ChartInfoId,
|
|
|
ChartNameEn: enNameData.ChartNameEn
|
|
|
})
|
|
|
+ }else if(this.chart_source===10) {//跨品种分析
|
|
|
+ res=await crossVarietyInterface.editChartEn(enNameData)
|
|
|
}
|
|
|
|
|
|
if(res.Ret !==200) return
|