Prechádzať zdrojové kódy

Merge branch 'master' of http://8.136.199.33:3000/eta_front/eta_front

Karsa 3 mesiacov pred
rodič
commit
07ecc2895f

+ 17 - 0
src/lang/modules/ToolBox/CommodityPriceChart.js

@@ -33,6 +33,14 @@ export const CommodityPriceChartEn = {
     tips_msg04:'Please set up the trading profit configuration first.',
     tips_msg05:'Indicator not selected yet',
     tips_msg06:'Please add a date.',
+
+    xAxis_set_name:'Horizontal axis settings',
+    del_edb_empty_tips:'Are you sure you want to delete all spot indicators? The chart will be cleared after the operation.',
+    tips_msg07:'date reference cannot be empty',
+    tips_msg08:"Choose a spot indicator as the date reference, and the added date rules will be calculated based on that indicator's date",
+    tips_msg09:'Please select a date reference',
+    date_reference:'date reference',
+    xAxis_name:'Horizontal axis name',
 };
   
 /* 中文 */
@@ -66,6 +74,15 @@ export const CommodityPriceChartZh = {
     tips_msg04:'请先设置盘面利润配置',
     tips_msg05:'暂未选择指标',
     tips_msg06:'请添加日期',
+
+    xAxis_set_name:'横坐标设置',
+    del_edb_empty_tips:'现货指标全部删除后,图表会被清除,确认操作吗?',
+    tips_msg07:'日期基准不能为空',
+    tips_msg08:'选择一个现货指标为日期基准,添加的日期规则以该指标日期进行计算',
+    tips_msg09:'请选择日期基准',
+    date_reference:'日期基准',
+    xAxis_name:'横坐标名称',
+
 };
   
 /**

+ 9 - 1
src/views/dataEntry_manage/components/barOptionSection.vue

@@ -264,7 +264,11 @@ export default {
         })
       }
       this.cancelDialog()
-
+      // 商品价格曲线修改日期重置x轴
+      if(this.$route.path === '/addCommodityChart'){
+        this.$parent.xAxisList=[]
+      }
+      
       this.getBarData()
     },
 
@@ -305,6 +309,10 @@ export default {
     /* 移除日期 */
     removeDate(index) {
       this.dateList.splice(index,1)
+      // 商品价格曲线修改日期重置x轴
+      if(this.$route.path === '/addCommodityChart'){
+        this.$parent.xAxisList=[]
+      }
       this.getBarData();
     },
   },

+ 27 - 4
src/views/dataEntry_manage/components/setLangInfo.vue

@@ -195,7 +195,17 @@
                 <el-input v-model="it.value" :placeholder="it.placeholder" ></el-input>
               </el-form-item>
             </el-collapse-item>
+
+            <!-- 商品价格曲线 -->
+            <el-collapse-item v-if="formData.chartInfo&&[2,5].includes(formData.chartInfo[0].source)" :title="$t('ToolBox.CommodityPriceChart.xAxis_name')" name="横坐标名称">
+              <div class="set-xaxis-box" >
+                  <el-input class="inp-item" v-model="it.name" v-for="it,index in copyFormData.xData" :key="index"></el-input>
+              </div>
+            </el-collapse-item>
           </el-collapse>
+
+          
+
         </div>
 			</el-form>
 
@@ -227,16 +237,18 @@ export default {
         ChartNameEn:'',
         ChartEdbInfoList:[
 
-        ]
+        ],
+        xData:[]
       },
       copyFormData:{
         chartInfo:[],
-        chartsList:[]
+        chartsList:[],
+        xData:[]
       },
       activeNames: [0],
 
       fromEdbList: [],
-      updateInfo: {}
+      updateInfo: {},
     }
   },
   props:{
@@ -282,7 +294,8 @@ export default {
     cancel(){
       this.copyFormData={
         chartInfo:[],
-        chartsList:[]
+        chartsList:[],
+        xData:[]
       }
       this.$emit('cancel')
     },
@@ -354,6 +367,7 @@ export default {
         chartEdbInfoListTem.push(params)
       })
       this.langData.ChartEdbInfoList=chartEdbInfoListTem
+      this.langData.xData=this.copyFormData.xData
       this.$emit('updateLang',this.langData)
     },
 
@@ -416,6 +430,15 @@ export default {
     .el-collapse-item__content{
       padding:18px 8px 0 8px;
     }
+    .set-xaxis-box{
+      display: flex;
+      flex-wrap: wrap;
+      gap: 10px;
+      justify-content: space-between;
+      .inp-item{
+        width: 48%;
+      }
+    }
   }
 }
 

+ 43 - 8
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -476,6 +476,7 @@ export const chartSetMixin = {
       this.formItemArray={}
       this.formItemArray.chartInfo=[]
       this.formItemArray.chartsList=[]
+      this.formItemArray.xData=[]
       this.formItemArray.chartInfo.push({
         label:/* '图表名称' */this.$t('Chart.Detail.chart_name'),
         value: this.currentLang==='en'?this.chartInfo.ChartNameEn:this.chartInfo.ChartName,
@@ -506,6 +507,18 @@ export const chartSetMixin = {
         })
       }
 
+      // 商品价格曲线增加编辑X轴
+      if([2,5].includes(this.chartInfo.Source)){
+        const arr=this.commodityXData||[]
+        console.log(arr);
+        this.formItemArray.xData=arr.map(item=>{
+          return {
+            name:this.currentLang==='en'?item.NameEn:item.Name,
+          }
+        })
+
+      }
+
       //价格曲线
       if(this.chartInfo.Source===2) {
         this.formItemArray.chartInfo.push({
@@ -569,13 +582,23 @@ export const chartSetMixin = {
     async updateLang(paramsData) {
       let res=null
       if([2,5].includes(this.chartInfo.Source)){//商品价格
+        const ChartEdbInfoList=paramsData.ChartEdbInfoList.map(i=>{
+          return {
+            EdbInfoId:i.EdbInfoId,
+            EdbName:i.EdbName,
+            Unit:i.Unit
+          }
+        })
+        const XDataList=paramsData.xData.map(x=>x.name)
         res=await futuresInterface.setChartLangInfo({
           ChartInfoId: paramsData.ChartInfoId,
           ChartName: paramsData.ChartName,
-          Unit: paramsData.ChartEdbInfoList[0].Unit || '',
-          EdbName: paramsData.ChartEdbInfoList[0].EdbName || '',
+          // Unit: paramsData.ChartEdbInfoList[0].Unit || '',
+          // EdbName: paramsData.ChartEdbInfoList[0].EdbName || '',
           FutureGoodName: paramsData.FutureGoodName || '',
-          ProfitName: paramsData.ProfitName || ''
+          ProfitName: paramsData.ProfitName || '',
+          ChartEdbInfoList:ChartEdbInfoList,
+          XDataList:XDataList
         })
       }else if(this.chartInfo.Source===3){//相关性
         res=await chartRelevanceApi.setChartLangInfo({
@@ -1683,7 +1706,7 @@ export const chartSetMixin = {
       //x轴
       let xAxis = {
         ...scatterXAxis,
-        categories: this.commodityXData.map(_ =>_.Name),
+        categories: this.commodityXData.filter(_=>_.IsHide===0).map(_ =>_.Name),
         tickWidth: 1,
         labels: {
           style: {
@@ -1766,8 +1789,9 @@ export const chartSetMixin = {
             
             if(haveContract) {
               // 利润曲线指标名
+              const isEdb=commodityEdbList.some(_=>_.EdbInfoId===haveContract)
               let edb_name = chartInfo.Source === 5 
-                ? (index === 0 ? obj_item.NameList[index] : `${chartInfo.ProfitName}(${obj_item.NameList[index]})`)
+                ? (isEdb ? obj_item.NameList[index] : `${chartInfo.ProfitName}(${obj_item.NameList[index]})`)
                 : commodityEdbList.find(_ => _.EdbInfoId === obj_item.XEdbInfoIdList[index]).EdbName;
               str+=`<b>${ edb_name }</b>`
   
@@ -1791,8 +1815,9 @@ export const chartSetMixin = {
             
             if(haveContract) {
               // 利润曲线指标名
+              const isEdb=commodityEdbList.some(_=>_.EdbInfoId===haveContract)
               let edb_name = chartInfo.Source === 5
-                ? (index === 0 ? obj_item.NameList[index] : `${chartInfo.ProfitName}(${obj_item.NameList[index]})`)
+                ? (isEdb? obj_item.NameList[index] : `${chartInfo.ProfitName}(${obj_item.NameList[index]})`)
                 : commodityEdbList.find(_ => _.EdbInfoId === obj_item.XEdbInfoIdList[index]).EdbName;
               str+=`<b>${ edb_name }</b>`
   
@@ -1816,8 +1841,9 @@ export const chartSetMixin = {
 
             if(haveContract) {
               // 利润曲线指标名
+              const isEdb=commodityEdbList.some(_=>_.EdbInfoId===haveContract)
               let edb_name = chartInfo.Source === 5
-                ? (index === 0 ? obj_item.NameList[index] : `${chartInfo.ProfitNameEn}(${obj_item.NameList[index]})`)
+                ? (isEdb ? obj_item.NameList[index] : `${chartInfo.ProfitNameEn}(${obj_item.NameList[index]})`)
                 : commodityEdbList.find(_ => _.EdbInfoId === obj_item.XEdbInfoIdList[index]).EdbNameEn;
               str+=`<b>${ edb_name }</b>`
   
@@ -1865,7 +1891,16 @@ export const chartSetMixin = {
             return item
           }
         })
-        return arr;
+
+        // 根据设置的x轴显示隐藏去除值
+        let temArr=[]
+        this.commodityXData.forEach((i,index)=>{
+          if(i.IsHide!==1){
+            temArr.push(arr[index]||null)
+          }
+        })
+
+        return temArr;
     },
 
     /* 获取图表详情后赋值柱状图数据 */

+ 288 - 20
src/views/futures_manage/chartEditor.vue

@@ -111,9 +111,47 @@
 							:placeholder="$t('ToolBox.CommodityPriceChart.please_select_classify')"
 						/>
 					</el-form-item>
+					<el-form-item :label="$t('ToolBox.CommodityPriceChart.date_reference')" prop="basisEdb">
+						<el-select 
+							:placeholder="$t('ToolBox.CommodityPriceChart.tips_msg09')" 
+							v-model="chartInfo.basisEdb" 
+							style="width: 90%"
+							@change="handleBasisEdbChange"
+						>
+							<el-option 
+								v-for="item in tableData" 
+								:key="item.EdbInfoId"
+								:label="item.EdbName"
+								:value="item.EdbInfoId"
+							/>
+						</el-select>
+						<el-tooltip class="item" effect="dark" :content="$t('ToolBox.CommodityPriceChart.tips_msg08')" placement="top">
+							<i class="el-icon-info"></i>
+						</el-tooltip>
+					</el-form-item>
 				</el-form>
 
 				<div class="targetset-cont">
+					<!-- 选择的指标模块 -->
+					<div class="basis-edb-wrap" v-if="tableData.length>0">
+						<div class="label-btn" @click="isShowxAxisSet=true">{{$t('ToolBox.CommodityPriceChart.xAxis_set_name')}}</div>
+						<div 
+							class="item-basis-edb" 
+							v-for="item,index in tableData" 
+							:key="item.EdbInfoId"
+						>
+							<span class="name">{{$i18n.locale == 'zh'?item.EdbName:item.EdbNameEn||item.EdbName}}</span>
+							<div class="opt-box">
+								<img 
+									class="icon" 
+									:src="item.isHide?require('@/assets/img/icons/eyes-hide-active.png') : require('@/assets/img/icons/eyes-show-active.png')" 
+									alt=""
+									@click="handleChangeBasisEdbHide(item,index)"
+								>
+								<img class="icon" src="~@/assets/img/icons/delete-red.png" alt="" @click="handleBasisEdbDel(index,item)">
+							</div>
+						</div>
+					</div>
 					
 					<!-- 价格曲线日期配置 -->
 					<bar-option
@@ -190,6 +228,12 @@
 		:data="profitInfo"
 		@ensure="setProfitBack"
 	/>
+	<!-- 横坐标设置 -->
+	<xAxisSet 
+		:isShow.sync="isShowxAxisSet"
+		:opts="xAxisList"
+		@change="handleXAxisDataChange"
+	/>
   </div>
 </template>
 
@@ -200,8 +244,9 @@ import { chartSetMixin } from '@/views/dataEntry_manage/mixins/chartPublic';
 import Chart from '@/views/dataEntry_manage/components/chart';
 import barOption from '@/views/dataEntry_manage/components/barOptionSection.vue';
 import plateProfitDia from './components/plateProfitDia.vue';
+import xAxisSet from './components/xAxisSet.vue';
 export default {
-  components: { Chart,barOption,plateProfitDia },
+  components: { Chart,barOption,plateProfitDia,xAxisSet },
 	directives: {
     drag(el, bindings) {
       el.onmousedown = function (e) {
@@ -246,6 +291,9 @@ export default {
 				classify:[
 					{ required: true, message: this.$t('ToolBox.CommodityPriceChart.tips_msg03')||'图表分类不能为空', trigger: 'blur' },
 				],
+				basisEdb:[
+					{ required: true, message: this.$t('ToolBox.CommodityPriceChart.tips_msg07')||'日期基准不能为空', trigger: 'blur' },
+				]
 			}
 		}
 	},
@@ -262,6 +310,7 @@ export default {
 				futures_id: '',
 				classify: '',
 				Source: this.$route.query.scence==='profit' ? 5 : 2,
+				basisEdb:'',//选择的基准指标
 			},
 
 			classifyOptions: [],//分类option
@@ -278,11 +327,21 @@ export default {
 			profitInfo: {
 				list: [],
 				formula: ''
-			}
+			},
 
+			// 横坐标设置
+			isShowxAxisSet:false,
+			xAxisList:[],
     };
   },
   methods: {
+		// 刷新数据
+		handleRefreshChartData(){
+			// 价格曲线判断 this.chartInfo.futures_id
+			if(this.chartInfo.Source===2&&!this.chartInfo.futures_id) return
+			this.tableData.length && this.$refs.BarOptRef.getBarData();
+			console.log('刷新图表');
+		},
 
 		/* 获取图表详情 */
 		getChartInfo() {
@@ -291,22 +350,41 @@ export default {
         })
         .then((res) => {
           if (res.Ret !== 200) return;
-					const { ChartInfo,BarChartInfo,EdbInfoList,DataResp } = res.Data;
+					let { ChartInfo,BarChartInfo,EdbInfoList,DataResp,XDataList } = res.Data;
 
           this.chartInfo = ChartInfo.Source===5 ? {
 						...ChartInfo,
 						classify: ChartInfo.ChartClassifyId,
 						ProfitNameEn: DataResp.ProfitNameEn,
 						ProfitName: DataResp.ProfitName,
+						basisEdb:DataResp.Extra.BaseEdbInfoId
 					} : {
 						...ChartInfo,
 						classify: ChartInfo.ChartClassifyId,
-						futures_id: BarChartInfo.EdbInfoIdList.find(_ => _.Source===2).EdbInfoId
+						futures_id: BarChartInfo.EdbInfoIdList.find(_ => _.Source===2).EdbInfoId,
+						basisEdb:BarChartInfo.BaseEdbInfoId
 					};
+					if(ChartInfo.Source===5){
+						XDataList=DataResp.Extra.XDataList
+					}
+
+					// this.tableData = [EdbInfoList[0]];
+					this.tableData=EdbInfoList.filter(_e=>_e.Source).map((_e,index)=>{
+						return{
+							EdbInfoId:_e.EdbInfoId,
+							EdbName:_e.EdbName,
+							EdbNameEn:_e.EdbNameEn,
+							isHide:XDataList[index].IsHide?true:false
+						}
+					})
+					this.xAxisList=XDataList.map((_item,index)=>{
+						return {
+							..._item,
+							// 判断是否为选择的指标
+							EdbInfoId:EdbInfoList[index]&&EdbInfoList[index].Source?EdbInfoList[index].EdbInfoId:0,
+						}
+					})
 
-					this.search_txt = EdbInfoList[0].EdbInfoId;
-					this.tableData = [EdbInfoList[0]];
-					this.searchOptions = this.tableData;
 
 					this.initDateOptions = ChartInfo.Source===5 ? {
 						DateList: DataResp.Extra.DateList,
@@ -326,23 +404,118 @@ export default {
     /* 选择指标 获取指标详情并push到表格中*/
 		selectTarget(edb) {
 			if(!edb){
-				this.tableData = [];
+				// this.tableData = [];
 				return
 			} 
+			// 不允许添加重复的指标
+			if(this.tableData.some(_=>_.EdbInfoId===edb.EdbInfoId)){
+				this.$message.warning(this.$t('OnlineExcelPage.already_exists_msg'))
+				return
+			}
 
-			this.tableData = [edb];
-			this.commodityChartData.length && this.chartInfo.futures_id && this.$refs.BarOptRef.getBarData();
+			this.tableData.push({...edb,isHide:false});
+			console.log(this.xAxisList);
+			// 向横坐标配置项中插入值
+			if(this.xAxisList.length){
+				const index=this.xAxisList.findIndex(i=>i.EdbInfoId===0)
+				console.log(index);
+				if(index!=-1){
+					this.xAxisList.splice(index,0,{
+						EdbInfoId:edb.EdbInfoId,
+						IsHide:0,
+						Name:edb.EdbName,
+						NameEn:edb.EdbNameEn
+					})
+				}else{
+					this.xAxisList.push({
+						EdbInfoId:edb.EdbInfoId,
+						IsHide:0,
+						Name:edb.EdbName,
+						NameEn:edb.EdbNameEn
+					})
+				}
+			}
+			
+			
+			this.search_txt=''
+			this.search_page = 1;
+			this.searchOptions=[]
+			if(!this.chartInfo.basisEdb){
+				this.chartInfo.basisEdb=this.tableData[0].EdbInfoId
+			}
+			this.handleRefreshChartData()
+		},
+
+		// 选择的指标显示隐藏状态改变
+		handleChangeBasisEdbHide(item,index){
+			item.isHide=!item.isHide
+			this.xAxisList[index].IsHide=item.isHide?1:0
+			this.handleRefreshChartData()
+		},
+		// 删除选择的指标
+		async handleBasisEdbDel(index,item){
+			if(this.tableData.length===1){
+
+				await this.$confirm(this.$t('ToolBox.CommodityPriceChart.del_edb_empty_tips'),this.$t('Dialog.warn_tit'),{
+					type:'warning'
+				}) 
+			}
+			
+			this.tableData.splice(index,1)
+			this.xAxisList.splice(index,1)
+			if(this.chartInfo.basisEdb===item.EdbInfoId){
+				this.chartInfo.basisEdb=''
+				this.xAxisList=[]
+				return
+			}
+			this.handleRefreshChartData()
+		},
+		// 横坐标设置修改回调
+		handleXAxisDataChange(arr){
+			console.log('横坐标修改回调',arr);
+			this.xAxisList=arr
+			// 修改tableData
+			const temArr=this.tableData.filter(_e=>arr.some(_i=>_i.EdbInfoId===_e.EdbInfoId))
+			console.log(temArr)
+
+			temArr.forEach(item=>{
+				arr.forEach(_item=>{
+					if(_item.EdbInfoId===item.EdbInfoId){
+						item.isHide=_item.IsHide?true:false
+					}
+				})
+			})
+
+			this.tableData=temArr
+			if(temArr.length===0){
+				this.chartInfo.basisEdb=''
+				this.xAxisList=[]
+				return
+			}
+			this.handleRefreshChartData()
+			
 		},
 
 		/* 选择期货 */
 		changeFuturesHandle(val) {
 			if(!val) return
-			this.commodityChartData.length && this.tableData.length && this.$refs.BarOptRef.getBarData();
+			this.xAxisList=[]
+			this.handleRefreshChartData()
+		},
+
+		// 日期基准变更
+		handleBasisEdbChange(val){
+			if(!val) return
+			this.xAxisList=[]
+			this.handleRefreshChartData()
 		},
 
     /* 获取数据 */
 		async getPreviewData({sort,dateList}) {
-			if(!dateList.length) this.commodityChartData = [];
+			if(!dateList.length) {
+				this.commodityChartData = []
+				this.xAxisList=[]
+			};
 			if(!this.tableData.length || !dateList.length) return
 
 			this.chartInfo.Source===2
@@ -353,6 +526,22 @@ export default {
 
 		/* 价格曲线预览 */
 		async getCommodityPreview(dateList) {
+			if(!this.chartInfo.basisEdb){
+				this.$message.warning(this.$t('ToolBox.CommodityPriceChart.tips_msg09')||'请选择日期基准');
+				return
+			}
+			if(!this.chartInfo.futures_id){
+				this.$message.warning(this.$t('ToolBox.CommodityPriceChart.please_select_future')||'请选择期货');
+				return
+			}
+
+			const xDataListArr=this.xAxisList.map(_item=>{
+				return {
+					Name:_item.Name,
+					NameEn:_item.NameEn,
+					IsHide:_item.IsHide
+				}
+			})
 			let params = {
 				EdbInfoIdList: [
 					...this.tableData.map(_ => ({EdbInfoId: _.EdbInfoId,Name:'',Source: 1})),
@@ -365,6 +554,8 @@ export default {
 					Name: '',
 					Color: _.Color
 				})),
+				BaseEdbInfoId:this.chartInfo.basisEdb,
+				XDataList:xDataListArr||[]
 			}
 
 			const res = await futuresInterface.getChartData(params);
@@ -374,6 +565,13 @@ export default {
 			this.commodityEdbList = EdbInfoList;
 			this.commodityChartData = YDataList;
 			this.commodityXData = XDataList;
+			this.xAxisList=XDataList.map((_item,index)=>{
+				return {
+					..._item,
+					// 判断是否为选择的指标
+					EdbInfoId:EdbInfoList[index]&&EdbInfoList[index].Source?EdbInfoList[index].EdbInfoId:0,
+				}
+			})
 
 			//初始状态设置上下限极值
 			if(!this.chartInfo.LeftMin) {
@@ -389,12 +587,22 @@ export default {
 		/* 利润曲线预览 */
 		async getProfitPreview(dateList) {
 			if(!this.profitInfo.list.length) return this.$message.warning(this.$t('ToolBox.CommodityPriceChart.tips_msg04')||'请先设置盘面利润配置')
-
+			if(!this.chartInfo.basisEdb){
+				this.$message.warning(this.$t('ToolBox.CommodityPriceChart.tips_msg09')||'请选择日期基准');
+				return
+			}
+			const xDataListArr=this.xAxisList.map(_item=>{
+				return {
+					Name:_item.Name,
+					NameEn:_item.NameEn,
+					IsHide:_item.IsHide
+				}
+			})
 			const { list,formula } = this.profitInfo;
 			let params = {
 				FutureGoodEdbInfoIdList: list,
 				CalculateFormula: formula,
-				BaseEdbInfoId: this.tableData[0].EdbInfoId,
+				BaseEdbInfoId: this.chartInfo.basisEdb,
 				DateList: dateList.map(_ => ({
 					Type: _.Type,
 					Date: _.Date,
@@ -402,7 +610,10 @@ export default {
 					Name: '',
 					Color: _.Color
 				})),
+				EdbInfoIdList:this.tableData.map(i=>i.EdbInfoId),
+				XDataList:xDataListArr||[]
 			}
+			console.log('刷新利润曲线');
 
 			const res = await futuresInterface.previewProfitData(params);
 			if(res.Ret !== 200) return
@@ -413,6 +624,13 @@ export default {
 			this.commodityEdbList = EdbInfoList;
 			this.commodityChartData = YDataList;
 			this.commodityXData = XDataList;
+			this.xAxisList=XDataList.map((_item,index)=>{
+				return {
+					..._item,
+					// 判断是否为选择的指标
+					EdbInfoId:EdbInfoList[index]&&EdbInfoList[index].Source?EdbInfoList[index].EdbInfoId:0,
+				}
+			})
 			this.chartInfo = {
 				...this.chartInfo,
 				ProfitName,
@@ -499,19 +717,26 @@ export default {
 				ChartType:8,
 				DateType: 6,
 			}
-			
+
 			this.chartInfo.Source === 2 ? this.handleSaveCommodity(public_param) : this.handleSaveProfit(public_param);
 		},
 		
 		/* 商品价格曲线保存 */
 		async handleSaveCommodity(public_param) {
+			const xDataListArr=this.xAxisList.map(_item=>{
+				return {
+					Name:_item.Name,
+					NameEn:_item.NameEn,
+					IsHide:_item.IsHide
+				}
+			})
 			let params =  {
 				...public_param,
 				LeftMin: String(this.chartLimit.min),
 				LeftMax: String(this.chartLimit.max),
 				BarChartInfo: {
 					EdbInfoIdList: [
-						...this.tableData.map(_ => ({EdbInfoId: _.EdbInfoId,Name:'',Source: 1})),
+						...this.tableData.map(_ => ({EdbInfoId: _.EdbInfoId,Source: 1})),
 						{ EdbInfoId: this.chartInfo.futures_id,Name: '',Source: 2 }
 					],
 					DateList: this.$refs.BarOptRef.dateList.map(item => ({
@@ -520,8 +745,10 @@ export default {
 						Value: item.Value,
 						Name: '',
 						Color: item.Color
-					}))
-				}
+					})),
+					BaseEdbInfoId:this.chartInfo.basisEdb,
+					XDataList:xDataListArr||[]
+				},
 			}
 
 			const { Ret,Data } = this.chart_code
@@ -536,6 +763,13 @@ export default {
 		async handleSaveProfit(public_param) {
 			if(!this.profitInfo.list.length)  return this.$message.warning(this.$t('ToolBox.CommodityPriceChart.tips_msg04')||'请先设置盘面利润配置');
 			const { list,formula } = this.profitInfo;
+			const xDataListArr=this.xAxisList.map(_item=>{
+				return {
+					Name:_item.Name,
+					NameEn:_item.NameEn,
+					IsHide:_item.IsHide
+				}
+			})
 			let params = {
 				...public_param,
 				LeftMin: String(this.chartLimit.min),
@@ -543,7 +777,7 @@ export default {
 				Extra: {
 					FutureGoodEdbInfoIdList: list,
 					CalculateFormula: formula,
-					BaseEdbInfoId: this.tableData[0].EdbInfoId,
+					BaseEdbInfoId: this.chartInfo.basisEdb,
 					DateList: this.$refs.BarOptRef.dateList.map(_ => ({
 						Type: _.Type,
 						Date: _.Date,
@@ -551,6 +785,8 @@ export default {
 						Name: '',
 						Color: _.Color
 					})),
+					EdbInfoIdList:this.tableData.map(i=>i.EdbInfoId),
+					XDataList:xDataListArr||[]
 				}
 			}
 
@@ -601,7 +837,11 @@ export default {
 		/* 盘面利润数据 */
 		setProfitBack(obj) {
 			this.profitInfo = obj;
-			this.tableData.length && this.$refs.BarOptRef.dateList.length && this.getPreviewData({sort:null,dateList:this.$refs.BarOptRef.dateList});
+			if(this.tableData.length && this.$refs.BarOptRef.dateList.length){
+				// 重置x轴
+				this.xAxisList=[]
+				this.getPreviewData({sort:null,dateList:this.$refs.BarOptRef.dateList});
+			}
 		},
 	},
   mounted() {
@@ -754,6 +994,34 @@ export default {
 					display: flex;
 					margin-bottom: 20px;
 				}
+
+				.basis-edb-wrap{
+					.label-btn{
+						cursor: pointer;
+						color: #409eff;
+						margin-bottom: 10px;
+					}
+					.item-basis-edb{
+						background-color: #F0F2F5;
+						border: 1px solid #DCDFE6;
+						padding: 10px 5px;
+						margin-bottom: 5px;
+						display: flex;
+						.name{
+							flex: 1;
+						}
+						.opt-box{
+							display: flex;
+							align-items: center;
+							gap: 0 5px;
+							.icon{
+								width: 16px;
+								height: 16px;
+								cursor: pointer;
+							}
+						}
+					}
+				}
 			}
 		}
 		.move-btn {

+ 2 - 1
src/views/futures_manage/commodityChartBase.vue

@@ -719,7 +719,8 @@ export default {
 					ProfitNameEn: res.Data.DataResp.ProfitNameEn,
 					ProfitName: res.Data.DataResp.ProfitName,
 				} : res.Data.ChartInfo;
-				this.tableData = [res.Data.EdbInfoList[0]]
+				// this.tableData = [res.Data.EdbInfoList[0]]
+				this.tableData=res.Data.EdbInfoList.filter(_e=>_e.Source)
 				this.initCommodityData(res.Data)
 			})
 		},

+ 137 - 0
src/views/futures_manage/components/xAxisSet.vue

@@ -0,0 +1,137 @@
+<template>
+  <el-dialog
+    :visible.sync="isShow"
+    :close-on-click-modal="false"
+    :modal-append-to-body="true"
+		append-to-body
+    :title="$t('ToolBox.CommodityPriceChart.xAxis_set_name')"
+    @close="cancelHandle"
+    custom-class="xAxis-set-dialog"
+    center
+    width="800px"
+    top="8vh"
+    v-dialogDrag
+  >
+    <div class="list-wrap">
+      <ul class="list-box">
+        <li v-for="item,index in arr" :key="`${item.EdbInfoId}_${index}`" class="item">
+          <el-input v-model="item.label"></el-input>
+          <img
+            class="icon"
+            :src="
+              item.IsHide
+                ? require('@/assets/img/icons/eyes-hide-active.png')
+                : require('@/assets/img/icons/eyes-show-active.png')
+            "
+            alt=""
+            @click="handleChangeBasisEdbHide(item, index)"
+          />
+          <img class="icon" src="~@/assets/img/icons/delete-red.png" alt="" v-if="item.EdbInfoId" @click="handleBasisEdbDel(index,item)">
+        </li>
+      </ul>
+			<div class="btns">
+				<el-button type="primary" plain @click="cancelHandle">{{$t('Dialog.cancel_btn')}}</el-button>
+				<el-button type="primary" @click="handleSave">{{$t('Dialog.confirm_save_btn')}}</el-button>
+			</div>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  props: {
+    isShow: {
+      type: Boolean,
+    },
+    opts: []
+  },
+  watch: {
+    isShow(n) {
+      console.log('isShow', this.opts);
+      if (n) {
+        const arr = this.opts || []
+        this.arr = arr.map(item => {
+          return {
+						...item,
+            label: this.$i18n.locale == 'zh' ? item.Name : item.NameEn,
+          }
+        })
+      }
+    }
+  },
+  data() {
+    return {
+      arr: []
+    }
+  },
+  methods: {
+    cancelHandle() {
+      this.$emit('update:isShow', false);
+    },
+
+		handleSave(){
+			this.arr.forEach(item => {
+				if(this.$i18n.locale == 'zh'){
+					item.Name=item.label
+				}else{
+					item.NameEn=item.label
+				}
+			});
+      if(this.arr.length){
+        this.$emit('change',this.arr)
+      }
+			this.cancelHandle()
+		},
+
+		handleChangeBasisEdbHide(item,index){
+			item.IsHide=item.IsHide?0:1
+		},
+
+		handleBasisEdbDel(item,index){
+			const count=this.arr.filter(i=>i.EdbInfoId)
+			if(count.length===1){
+				this.$confirm(this.$t('ToolBox.CommodityPriceChart.del_edb_empty_tips'),this.$t('Dialog.warn_tit'),{
+					type:'warning'
+				}).then(()=>{
+					this.arr.splice(index,1)
+				}).catch(()=>{})
+				return 
+			}
+			this.arr.splice(index,1)
+		}
+
+
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.list-wrap{
+	.list-box{
+		display: flex;
+		flex-wrap: wrap;
+		gap: 20px 0;
+		.item{
+			width: 50%;
+			padding: 0 10px;
+			display: flex;
+			align-items: center;
+			box-sizing: border-box;
+			.el-input{
+				width: 300px;
+			}
+			.icon{
+				width: 16px;
+				height: 16px;
+				margin-left: 10px;
+				display: block;
+			}
+		}
+	}
+	.btns{
+		margin-top: 20px;
+		padding: 30px 0;
+		text-align: center;
+	}
+}
+</style>

+ 2 - 1
src/views/mychart_manage/components/chartDetailDia.vue

@@ -668,7 +668,8 @@ export default {
             //雷达图
             this.chartInfo.ChartType === 11 && this.initRadarData(res.Data);
           }else if([2,5].includes(this.chartInfo.Source)) {
-            this.tableData = [res.Data.EdbInfoList[0]];
+            // this.tableData = [res.Data.EdbInfoList[0]];
+            this.tableData=res.Data.EdbInfoList.filter(_e=>_e.Source)
             this.chartInfo = res.Data.ChartInfo.Source===5 ? {
               ...res.Data.ChartInfo,
               ProfitNameEn: res.Data.DataResp.ProfitNameEn,

+ 9 - 2
src/views/ppt_manage/mixins/mixins.js

@@ -981,7 +981,7 @@ export default {
       //x轴
       let xAxis = {
         ...scatterXAxis,
-        categories: this.commodityXData.map(_ =>_.Name),
+        categories: this.commodityXData.filter(_=>_.IsHide===0).map(_ =>_.Name),
         tickWidth: 1,
         labels: {
           y: 14,
@@ -1163,7 +1163,14 @@ export default {
             return item
           }
         })
-        return arr;
+        // 根据设置的x轴显示隐藏去除值
+        let temArr=[]
+        this.commodityXData.forEach((i,index)=>{
+          if(i.IsHide!==1){
+            temArr.push(arr[index]||null)
+          }
+        })
+        return temArr;
     },
 
     /* 商品价格曲线获取详情赋值 */