雷达分页

This commit is contained in:
熊丽君
2022-01-22 10:43:22 +08:00
parent 5e97aea340
commit 0007b23b1e

View File

@ -2,6 +2,7 @@
<div>
<container2 title="战略指标">
<el-pagination
v-if="total"
small
slot="datePicker"
layout="prev, pager, next"
@ -203,12 +204,8 @@ export default {
if (200 == res.code) {
this.total = res.data.length;
this.dataList = res.data;
if (res.data.length && res.data.length % 2 == 0) {
this.isOdd = true;
} else {
this.isOdd = false;
this.setData(res.data.slice(0, 2));
}
if (this.total == 0) return false;
this.setData(res.data.slice(0, 2));
// if (res.data.length > 2) {
// list = res.data.splice(0, 2);
// } else {
@ -223,8 +220,6 @@ export default {
this.setData(data);
},
// this.chart = echarts.init(this.$refs.chartOdd, "macarons");
setData(list) {
if (list.length < 2) return this.setOddEchars(list);
this.chart = echarts.init(this.$refs.chart, "macarons");
@ -260,7 +255,7 @@ export default {
},
{
text: list[1].key,
left: "65%",
left: "68%",
bottom: 5,
textStyle: {
color: "#fff",
@ -400,18 +395,21 @@ export default {
});
},
setOddEchars(list) {
console.log(list);
let arr1 = [
...list[0].value.map((e) => parseInt(e.startNumber)),
...list[0].value.map((e) => parseInt(e.endNumber)),
...list[0].value.map((e) => parseInt(e.yearTarget)),
];
let max0 = Math.max.apply(null, arr1);
this.chart.dispose();
if (this.chart) {
this.chart.dispose();
this.chart = null;
}
this.chart = echarts.init(this.$refs.chart, "macarons");
this.chart.setOption({
title: {
text: list[0].key,
left: "19%",
left: "43%",
bottom: 5,
textStyle: {
color: "#fff",
@ -452,7 +450,7 @@ export default {
}),
// { name: '登陆频次', max: 6500, axisLabel: { show: true }, color: '#fff' },
],
center: ["25.5%", "50%"],
center: ["50%", "50%"],
radius: 50,
name: {
// (圆外的标签)雷达图每个指示器名称的配置项。