|
@@ -220,7 +220,7 @@ const getChartInfo=async (type)=>{
|
|
|
//相关性图表
|
|
|
if([3,4].includes(chartSource)) return getRelevanceDetail();
|
|
|
//商品价格曲线调另外的接口
|
|
|
- if(chartSource===2) return getCommordityDetail();
|
|
|
+ if([2,5].includes(chartSource)) return getCommordityDetail();
|
|
|
|
|
|
let res=null
|
|
|
// 如果是从我的图库中来的
|
|
@@ -564,11 +564,11 @@ const commodityXData = ref([]);//商品价格图的x轴
|
|
|
const commodityEdbList = ref([]);//商品价格图的表格数据 只用于取值
|
|
|
/* 商品价格曲线获取详情赋值 */
|
|
|
const initCommodityData = (data) => {
|
|
|
- const { XDataList,YDataList,EdbInfoList,ChartInfo } = data;
|
|
|
+ const { XDataList,YDataList,EdbInfoList,ChartInfo,DataResp } = data;
|
|
|
|
|
|
commodityEdbList.value = EdbInfoList;
|
|
|
- commodityChartData.value = YDataList;
|
|
|
- commodityXData.value = XDataList;
|
|
|
+ commodityChartData.value = ChartInfo.Source===5?DataResp.YDataList:YDataList;
|
|
|
+ commodityXData.value = ChartInfo.Source===5?DataResp.XDataList:XDataList;
|
|
|
|
|
|
hasLeftAxis.value=true;
|
|
|
axisLimitData.leftMin=Number(ChartInfo.LeftMin)
|
|
@@ -654,7 +654,11 @@ const setCommodityChart = () => {
|
|
|
let haveContract = obj_item.XEdbInfoIdList[index];
|
|
|
|
|
|
if(haveContract) {
|
|
|
- str+=`<b>${ commodityEdbList.value.find(_ => _.EdbInfoId === obj_item.XEdbInfoIdList[index]).EdbName }</b>`
|
|
|
+ // 利润曲线指标名
|
|
|
+ let edb_name = resData.value.ChartInfo.Source === 5
|
|
|
+ ? (index === 0 ? obj_item.NameList[index] : `${resData.value.DataResp.ProfitName}(${obj_item.NameList[index]})`)
|
|
|
+ : commodityEdbList.find(_ => _.EdbInfoId === obj_item.XEdbInfoIdList[index]).EdbName;
|
|
|
+ str+=`<b>${ edb_name }</b>`
|
|
|
|
|
|
if(!obj_item.NoDataEdbList.includes(obj_item.XEdbInfoIdList[index])) {
|
|
|
str += `<br><span style="color:${item.color}">\u25CF</span>${obj_item.Date}: ${item.y}<br>`
|
|
@@ -1858,7 +1862,7 @@ onMounted(()=>{
|
|
|
|
|
|
// 保存
|
|
|
const handleSaveChart=async ()=>{
|
|
|
- let params = resData.value.ChartInfo.Source === 2
|
|
|
+ let params = [2,5].includes(resData.value.ChartInfo.Source)
|
|
|
? {
|
|
|
ChartInfoId:resData.value.ChartInfo.ChartInfoId,
|
|
|
LeftMin: String(axisLimitData.leftMin),
|
|
@@ -1866,7 +1870,7 @@ const handleSaveChart=async ()=>{
|
|
|
}
|
|
|
: setChartParams()
|
|
|
|
|
|
- const res = resData.value.ChartInfo.Source === 2
|
|
|
+ const res = [2,5].includes(resData.value.ChartInfo.Source)
|
|
|
? await apiCommonChartSave(params)
|
|
|
: await apiChartSave(params)
|
|
|
if(res.code===200){
|
|
@@ -1959,7 +1963,7 @@ const handleRefreshChart=async ()=>{
|
|
|
let res=null
|
|
|
if(resData.value.ChartInfo.Source === 1){
|
|
|
res=await apiChartRefresh({ChartInfoId:Number(ChartInfoId)})
|
|
|
- }else if(resData.value.ChartInfo.Source === 2){
|
|
|
+ }else if([2,5].includes(resData.value.ChartInfo.Source)){
|
|
|
res=await apiCommonChartRefresh({ChartInfoId:Number(ChartInfoId)})
|
|
|
}else if([3,4].includes(resData.value.ChartInfo.Source)){
|
|
|
res=await apiRelevanceChartRefresh({ChartInfoId:Number(ChartInfoId)})
|