|
@@ -164,26 +164,9 @@ export default {
|
|
selectTarget(item,type='') {
|
|
selectTarget(item,type='') {
|
|
if(!item) return
|
|
if(!item) return
|
|
|
|
|
|
- /* 正常图获取指标数据 柱形图不获取 */
|
|
|
|
- if(this.chartInfo.ChartType === 7) return this.setBarEdbList(item);
|
|
|
|
- // let params = this.sameOptionType.includes(this.chartInfo.ChartType)
|
|
|
|
- // ? {
|
|
|
|
- // EdbInfoId: item.EdbInfoId,
|
|
|
|
- // ChartType: this.chartInfo.ChartType,
|
|
|
|
- // DateType: this.year_select,
|
|
|
|
- // StartDate:
|
|
|
|
- // this.year_select === 5 || this.year_select === 6
|
|
|
|
- // ? this.select_date[0]
|
|
|
|
- // : '',
|
|
|
|
- // EndDate: this.year_select === 5 ? this.select_date[1] : '',
|
|
|
|
- // }
|
|
|
|
- // : {
|
|
|
|
- // EdbInfoId: item.EdbInfoId,
|
|
|
|
- // ChartType: this.chartInfo.ChartType,
|
|
|
|
- // Calendar: this.calendar_type,
|
|
|
|
- // SeasonStartDate: '',
|
|
|
|
- // SeasonEndDate: '',
|
|
|
|
- // };
|
|
|
|
|
|
+ /* 正常图获取指标数据 柱形图 雷达图不获取 */
|
|
|
|
+ if([7,11].includes(this.chartInfo.ChartType)) return this.setBarEdbList(item);
|
|
|
|
+
|
|
let dateArray=this.chartInfo.ChartType==2?this.season_year:this.select_date
|
|
let dateArray=this.chartInfo.ChartType==2?this.season_year:this.select_date
|
|
|
|
|
|
let params = {
|
|
let params = {
|
|
@@ -237,7 +220,7 @@ export default {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- /* 添加柱形图表格 */
|
|
|
|
|
|
+ /* 添加柱形图 /雷达图指标数组 */
|
|
setBarEdbList(edb) {
|
|
setBarEdbList(edb) {
|
|
let have_bol = this.tableData.some(item => item.EdbInfoId === edb.EdbInfoId);
|
|
let have_bol = this.tableData.some(item => item.EdbInfoId === edb.EdbInfoId);
|
|
|
|
|
|
@@ -247,7 +230,16 @@ export default {
|
|
this.search_txt = '';
|
|
this.search_txt = '';
|
|
this.chartInfo.Unit = this.chartInfo.Unit||edb.Unit
|
|
this.chartInfo.Unit = this.chartInfo.Unit||edb.Unit
|
|
this.tableData.push(edb)
|
|
this.tableData.push(edb)
|
|
|
|
+ },
|
|
|
|
|
|
|
|
+ /* 奇怪柱形图的日期配置项现在不止柱形图用了 获取数据时扩展一下 */
|
|
|
|
+ barOptionPreviewMap(data) {
|
|
|
|
+ let tyepeMapApi = {
|
|
|
|
+ 7: this.getBarPreviewData,//柱形图
|
|
|
|
+ 11: this.getRadarPreviewData//雷达图
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ tyepeMapApi[this.chartInfo.ChartType](data);
|
|
},
|
|
},
|
|
|
|
|
|
/* 获取bar数据 */
|
|
/* 获取bar数据 */
|
|
@@ -290,8 +282,50 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
/* 获取雷达图预览数据 */
|
|
/* 获取雷达图预览数据 */
|
|
- getRadarPreviewData() {
|
|
|
|
|
|
+ async getRadarPreviewData({dateList}) {
|
|
|
|
+ if(this.tableData.length<3 || !dateList.length) return
|
|
|
|
+
|
|
|
|
+ let parmas = {
|
|
|
|
+ ChartEdbInfoList: this.tableData.map(_ => ({
|
|
|
|
+ EdbInfoId: _.EdbInfoId,
|
|
|
|
+ EdbAliasName:_.EdbAliasName
|
|
|
|
+ })),
|
|
|
|
+ ExtraConfig: JSON.stringify({ DateList: dateList})
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const res = await dataBaseInterface.getRadarPreviewData(parmas)
|
|
|
|
+
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+
|
|
|
|
+ const { DataResp,EdbInfoList,ChartInfo } = res.Data;
|
|
|
|
+
|
|
|
|
+ console.log(JSON.parse(this.chartInfo.ChartThemeStyle))
|
|
|
|
+ //默认来源搞一下
|
|
|
|
+ this.chartInfo.SourcesFrom = JSON.stringify({
|
|
|
|
+ isShow: true,
|
|
|
|
+ text: ChartInfo.ChartSource,
|
|
|
|
+ color: JSON.parse(this.chartInfo.ChartThemeStyle).markerOptions.style.color,
|
|
|
|
+ fontSize: JSON.parse(this.chartInfo.ChartThemeStyle).markerOptions.style.fontSize
|
|
|
|
+ });
|
|
|
|
|
|
|
|
+ this.radarChartData = {
|
|
|
|
+ YDataList: DataResp.YDataList,
|
|
|
|
+ XDataList: EdbInfoList.filter(_ => DataResp.XEdbIdValue.includes(_.EdbInfoId))
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // //初始状态设置上下限极值
|
|
|
|
+ if(!this.chartInfo.LeftMin) {
|
|
|
|
+ const value_arr = this.radarChartData.YDataList.map(_ => _.Value).flat(Infinity)
|
|
|
|
+
|
|
|
|
+ this.chartLimit = {
|
|
|
|
+ min: Math.min(...value_arr),
|
|
|
|
+ max: Math.max(...value_arr)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.setRadarChart()
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
/* 曲线图切换筛选项时请求数据 */
|
|
/* 曲线图切换筛选项时请求数据 */
|
|
@@ -656,10 +690,27 @@ export default {
|
|
}))
|
|
}))
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ case 11:
|
|
|
|
+ return {
|
|
|
|
+ ...public_param,
|
|
|
|
+ DateType: 6,
|
|
|
|
+ Unit: this.chartInfo.Unit,
|
|
|
|
+ LeftMin: String(this.chartLimit.min),
|
|
|
|
+ LeftMax: String(this.chartLimit.max),
|
|
|
|
+ ExtraConfig: JSON.stringify({
|
|
|
|
+ DateList: this.$refs.BarOptRef.dateList.map(item => ({
|
|
|
|
+ Type: item.Type,
|
|
|
|
+ Date: item.Date,
|
|
|
|
+ Value: item.Value,
|
|
|
|
+ Name: item.Name,
|
|
|
|
+ Color: item.Color
|
|
|
|
+ })),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- /* 奇怪柱形图更新单位 */
|
|
|
|
|
|
+ /* 更新单位 */
|
|
changeUnit(val) {
|
|
changeUnit(val) {
|
|
if(!this.options.series) return
|
|
if(!this.options.series) return
|
|
|
|
|
|
@@ -782,7 +833,8 @@ export default {
|
|
|
|
|
|
const chartTypeMap = {
|
|
const chartTypeMap = {
|
|
7: this.setBarChart, //柱形图
|
|
7: this.setBarChart, //柱形图
|
|
- 10: this.setSectionScatterChart //截面散点
|
|
|
|
|
|
+ 10: this.setSectionScatterChart, //截面散点
|
|
|
|
+ 11: this.setRadarChart //雷达图
|
|
}
|
|
}
|
|
chartTypeMap[this.chartInfo.ChartType]
|
|
chartTypeMap[this.chartInfo.ChartType]
|
|
? chartTypeMap[this.chartInfo.ChartType]()
|
|
? chartTypeMap[this.chartInfo.ChartType]()
|