|
@@ -361,7 +361,7 @@
|
|
|
class="add-edb-btn"
|
|
|
style="color: #0052d9; cursor: pointer"
|
|
|
v-if="formData.chartType === 2"
|
|
|
- @click="legendEditDiaShow = true"
|
|
|
+ @click="handleShowEditLegend"
|
|
|
>
|
|
|
<span>{{$t('EtaChartAddPage.label_legend_set')}}<!-- 图例名称设置 --></span>
|
|
|
<img style="width:15px" src="~@/assets/img/icons/edit-blue.png" />
|
|
@@ -480,10 +480,46 @@ export default {
|
|
|
this.edbList.push(this.createEbdListItem('A'))
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 季节图点击编辑图例
|
|
|
+ async handleShowEditLegend(){
|
|
|
+ // 如果没有选择指标数据
|
|
|
+ if(!(this.edbList[0].timeSerial&&this.edbList[0].valueSerial)){
|
|
|
+ this.legendEditDiaShow=true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 获取当前选择的 时间序列和数值序列的值
|
|
|
+ const dateObj=this.getSeriesNum(this.edbList[0].timeSerial)
|
|
|
+ const valueObj=this.getSeriesNum(this.edbList[0].valueSerial)
|
|
|
+ const dateArr=this.findLimitData(dateObj.start,dateObj.end).valueArr
|
|
|
+ const valueArr=this.findLimitData(valueObj.start,valueObj.end).valueArr
|
|
|
+ const params={
|
|
|
+ DateArr:dateArr,
|
|
|
+ DataArr:valueArr,
|
|
|
+ Calendar:this.SeasonExtraConfig.type,
|
|
|
+ SeasonExtraConfig:{
|
|
|
+ ChartLegend:this.SeasonExtraConfig.ChartLegend,// 图例名称数组
|
|
|
+ XStartDate:this.SeasonExtraConfig.XStartDate,
|
|
|
+ XEndDate:this.SeasonExtraConfig.XEndDate,
|
|
|
+ JumpYear:this.SeasonExtraConfig.JumpYear?1:0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(params);
|
|
|
+ const res=await sheetInterface.balanceSeasonChart(params)
|
|
|
+ if(res.Ret===200){
|
|
|
+ const arr=res.Data.List||[]
|
|
|
+ const temarr=arr.map(item=>{
|
|
|
+ return {Name:item.Years,Value:item.ChartLegend}
|
|
|
+ })
|
|
|
+ this.SeasonExtraConfig.ChartLegend=temarr
|
|
|
+ this.legendEditDiaShow=true
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
// 编辑时初始化数据
|
|
|
initEditData(e){
|
|
|
console.log('edit回显数据',e);
|
|
|
- const {ChartInfo,EdbInfoList}=e
|
|
|
+ const {ChartInfo,EdbInfoList,ExcelEdbList}=e
|
|
|
this.editChartInfoId=ChartInfo.ChartInfoId
|
|
|
this.formData.chartName=ChartInfo.ChartName
|
|
|
this.formData.chartSource=JSON.parse(ChartInfo.SourcesFrom).text
|
|
@@ -496,10 +532,10 @@ export default {
|
|
|
this.formData.rightTwoMin=ChartInfo.Right2Min?Number(ChartInfo.Right2Min):0
|
|
|
this.formData.rightTwoMax=ChartInfo.Right2Max?Number(ChartInfo.Right2Max):0
|
|
|
if(ChartInfo.ChartType===2&&ChartInfo.SeasonExtraConfig){
|
|
|
- this.SeasonExtraConfig.ChartLegend=ChartInfo.SeasonExtraConfig.ChartLegend
|
|
|
- this.SeasonExtraConfig.XStartDate=ChartInfo.SeasonExtraConfig.XStartDate
|
|
|
- this.SeasonExtraConfig.XEndDate=ChartInfo.SeasonExtraConfig.XEndDate
|
|
|
- this.SeasonExtraConfig.JumpYear=ChartInfo.SeasonExtraConfig.JumpYear?true:false
|
|
|
+ this.SeasonExtraConfig.ChartLegend=JSON.parse(ChartInfo.SeasonExtraConfig).ChartLegend
|
|
|
+ this.SeasonExtraConfig.XStartDate=JSON.parse(ChartInfo.SeasonExtraConfig).XStartDate
|
|
|
+ this.SeasonExtraConfig.XEndDate=JSON.parse(ChartInfo.SeasonExtraConfig).XEndDate
|
|
|
+ this.SeasonExtraConfig.JumpYear=JSON.parse(ChartInfo.SeasonExtraConfig).JumpYear?true:false
|
|
|
this.SeasonExtraConfig.type=ChartInfo.Calendar
|
|
|
}
|
|
|
|
|
@@ -508,10 +544,10 @@ export default {
|
|
|
let temEdbList=[]
|
|
|
arr.forEach((item,index)=>{
|
|
|
temEdbList.push({
|
|
|
- tag: '',
|
|
|
+ tag: ExcelEdbList[index].FromTag,
|
|
|
ExcelChartEdbId:item.EdbInfoId,
|
|
|
- timeSerial: '',
|
|
|
- valueSerial: '',
|
|
|
+ timeSerial: ExcelEdbList[index].DateSequenceStr,
|
|
|
+ valueSerial: ExcelEdbList[index].DataSequenceStr,
|
|
|
maxData:item.MaxData,//选中数据的最大值
|
|
|
minData:item.MinData,//选中数据的最小值
|
|
|
name: item.EdbAliasName,
|
|
@@ -538,9 +574,8 @@ export default {
|
|
|
this.updateLimit()
|
|
|
},
|
|
|
|
|
|
- // 手动输入数值序列改变
|
|
|
- handleValInputChange(str){
|
|
|
- console.log('数值序列改变',str);
|
|
|
+ // 通过字符串sheet1!$A$3:$A$13 获取开始和结束序列号
|
|
|
+ getSeriesNum(str){
|
|
|
// 正则表达式模式,确保格式正确且感叹号后面有两个$,冒号前后各两个$
|
|
|
const formatPattern = /^.*!\$[A-Z0-9]+\$[A-Z0-9]+:\$[A-Z0-9]+\$[A-Z0-9]/;
|
|
|
// 检查字符串是否符合格式要求
|
|
@@ -576,14 +611,27 @@ export default {
|
|
|
start.row=matches[1]-1
|
|
|
end.col=this.$parent.columnHeader.findIndex(_e=>_e===matches[2])
|
|
|
end.row=matches[3]-1
|
|
|
- this.tableSelect(start,end,str)
|
|
|
+
|
|
|
+ return {
|
|
|
+ start,
|
|
|
+ end
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
console.log("字符串格式不符合要求");
|
|
|
this.$message.warning('格式不合法')
|
|
|
+ return false
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ // 手动输入数值序列改变
|
|
|
+ handleValInputChange(str){
|
|
|
+ console.log('数值序列改变',str);
|
|
|
+ const obj=this.getSeriesNum(str)
|
|
|
+ if(!obj) return
|
|
|
+ this.tableSelect(obj.start,obj.end,str)
|
|
|
+ },
|
|
|
+
|
|
|
// 选中的序列
|
|
|
tableSelect(start,end,str){
|
|
|
console.log(start,end,str);
|
|
@@ -642,7 +690,7 @@ export default {
|
|
|
let numArr=[]
|
|
|
// 判断是选择的同行还是同列
|
|
|
if(start.col===end.col&&start.row!=end.row){//同列
|
|
|
- for (let index = start.row; index < end.row; index++) {
|
|
|
+ for (let index = start.row; index <= end.row; index++) {
|
|
|
numArr.push(data[index][start.col].ShowValue)
|
|
|
}
|
|
|
}
|
|
@@ -657,6 +705,8 @@ export default {
|
|
|
numArr.push(data[start.row][start.col].ShowValue)
|
|
|
}
|
|
|
|
|
|
+ const valueArr=JSON.parse(JSON.stringify(numArr))
|
|
|
+
|
|
|
numArr=[...new Set(numArr)]
|
|
|
numArr=numArr.filter(item=>!isNaN(item)).map(Number)
|
|
|
|
|
@@ -668,17 +718,16 @@ export default {
|
|
|
// console.log(numArr);
|
|
|
// console.log(minData,maxData);
|
|
|
return{
|
|
|
+ valueArr,
|
|
|
maxData,
|
|
|
minData
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
// 图例编辑接口保存
|
|
|
saveLegend(copyList){
|
|
|
if(copyList && copyList.length>0){
|
|
|
this.SeasonExtraConfig.ChartLegend = copyList
|
|
|
- // this.getPreviewSplineInfo()
|
|
|
this.legendEditDiaShow=false
|
|
|
}
|
|
|
},
|
|
@@ -819,6 +868,7 @@ export default {
|
|
|
},
|
|
|
cancelHandle() {
|
|
|
this.$emit('update:isShow', false);
|
|
|
+ this.initData()
|
|
|
},
|
|
|
|
|
|
/* 领先指标 过滤负数 小数点*/
|