|
@@ -53,6 +53,7 @@ export default {
|
|
{ label: '组合图', key: 6 },
|
|
{ label: '组合图', key: 6 },
|
|
{ label: '柱形图',key: 7 },
|
|
{ label: '柱形图',key: 7 },
|
|
{ label: '截面散点图',key: 10 },
|
|
{ label: '截面散点图',key: 10 },
|
|
|
|
+ { label: '雷达图',key: 11 },
|
|
], //图表样式
|
|
], //图表样式
|
|
|
|
|
|
|
|
|
|
@@ -138,7 +139,7 @@ export default {
|
|
this.getThemeList('init')
|
|
this.getThemeList('init')
|
|
|
|
|
|
//柱形图 截面散点切换到普通图 依赖的指标信息其实只有信息无数据 需清空
|
|
//柱形图 截面散点切换到普通图 依赖的指标信息其实只有信息无数据 需清空
|
|
- if([7,10].includes(oldval)&&![7,10].includes(newval)) {
|
|
|
|
|
|
+ if([7,10,11].includes(oldval)&&![7,10,11].includes(newval)) {
|
|
this.tableData = [];
|
|
this.tableData = [];
|
|
this.chartInfo.LeftMax = '';
|
|
this.chartInfo.LeftMax = '';
|
|
this.chartInfo.LeftMin = '';
|
|
this.chartInfo.LeftMin = '';
|
|
@@ -149,7 +150,7 @@ export default {
|
|
this.initStatus();
|
|
this.initStatus();
|
|
|
|
|
|
//共用结构的类型切换可以直接画图
|
|
//共用结构的类型切换可以直接画图
|
|
- if(![7,10].includes(newval)) {
|
|
|
|
|
|
+ if(![7,10,11].includes(newval)) {
|
|
//单指标允许切换到季节图需药重新请求数据
|
|
//单指标允许切换到季节图需药重新请求数据
|
|
this.tableData.length===1 && this.selectTarget(this.tableData[0],'switch');
|
|
this.tableData.length===1 && this.selectTarget(this.tableData[0],'switch');
|
|
this.tableData.length > 1 && this.setChartOptionHandle(this.tableData);
|
|
this.tableData.length > 1 && this.setChartOptionHandle(this.tableData);
|
|
@@ -163,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 = {
|
|
@@ -255,7 +239,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);
|
|
|
|
|
|
@@ -265,7 +249,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数据 */
|
|
@@ -314,6 +307,49 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ /* 获取雷达图预览数据 */
|
|
|
|
+ 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;
|
|
|
|
+ this.chartInfo = {
|
|
|
|
+ ...this.chartInfo,
|
|
|
|
+ ChartSource: ChartInfo.ChartSource
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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.setDefaultSourceFrom();
|
|
|
|
+
|
|
|
|
+ this.setRadarChart()
|
|
|
|
+ },
|
|
|
|
+
|
|
/* 曲线图切换筛选项时请求数据 */
|
|
/* 曲线图切换筛选项时请求数据 */
|
|
async getPreviewSplineInfo() {
|
|
async getPreviewSplineInfo() {
|
|
let dateArray=this.chartInfo.ChartType==2?this.season_year:this.select_date
|
|
let dateArray=this.chartInfo.ChartType==2?this.season_year:this.select_date
|
|
@@ -683,10 +719,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
|
|
|
|
|
|
@@ -862,7 +915,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]()
|