Commit 006fb88a by wuwx

修复v1.14.0显示bug

1 parent 10e08f65
......@@ -303,8 +303,11 @@ export default {
let m = [];
m.push({ value: this.accSub(100, obj.onlineRate), name: "" });
m.push({ value: obj.onlineRate, name: "" });
this.createBindChart("onlineChart", m);
if (obj.onlineRate == 0 || obj.onlineRate == 100) {
this.unCreateBindChart("onlineChart", m);
} else {
this.createBindChart("onlineChart", m);
}
// 离线率
let n = [];
......@@ -317,7 +320,11 @@ export default {
n.push({ value: this.accSub(obj.offlineRate, obj.fakeOfflineRate), name: "" });
n.push({ value: this.addSub(b, obj.fakeOfflineRate), name: "" });
}
this.createChart("offlineChart", n);
if (this.accSub(obj.offlineRate, obj.fakeOfflineRate) == 0 || this.accSub(obj.offlineRate, obj.fakeOfflineRate) == 100) {
this.unCreateChart("offlineChart", n);
} else {
this.createChart("offlineChart", n);
}
// 假性离线率
let x = []
......@@ -325,7 +332,11 @@ export default {
x.push({ value: this.accSub(100, obj.fakeOfflineRate), name: "" });
x.push({ value: obj.fakeOfflineRate, name: "" });
}
this.createBindChart("fakeOfflineChart", x);
if (obj.fakeOfflineRate == 0 || obj.fakeOfflineRate == 100) {
this.unCreateBindChart("fakeOfflineChart", x);
} else {
this.createBindChart("fakeOfflineChart", x);
}
this.maskFlag = false
});
},
......@@ -402,7 +413,7 @@ export default {
});
},
// 创建环形图表
// 创建含有最小比例环形图表
createBindChart(id, data) {
var aChart = echarts.init(document.getElementById(id));
aChart.setOption({
......@@ -435,7 +446,39 @@ export default {
],
});
},
// 离线率环形图表
// 创建没有最小比例环形图表
unCreateBindChart(id, data) {
var aChart = echarts.init(document.getElementById(id));
aChart.setOption({
tooltip: {
show: true,
formatter: "{c0}%",
},
legendHoverLink: false,
color: [
"#c0c0c0",
"#0096fa",
"#fac858",
"#ee6666",
"#73c0de",
"#3ba272",
"#fc8452",
"#9a60b4",
"#ea7ccc",
],
series: [
{
type: "pie",
radius: ["40%", "70%"],
labelLine: {
show: false,
},
data: data
},
],
});
},
// 含有最小比例离线率环形图表
createChart(id, data) {
var aChart = echarts.init(document.getElementById(id));
aChart.setOption({
......@@ -468,6 +511,38 @@ export default {
],
});
},
// 没有最小比例离线率环形图表
unCreateChart(id, data) {
var aChart = echarts.init(document.getElementById(id));
aChart.setOption({
tooltip: {
show: true,
formatter: "{c0}%",
},
legendHoverLink: false,
color: [
"#F6B06F",
"#c0c0c0",
"#fac858",
"#ee6666",
"#73c0de",
"#3ba272",
"#fc8452",
"#9a60b4",
"#ea7ccc",
],
series: [
{
type: "pie",
radius: ["40%", "70%"],
labelLine: {
show: false,
},
data: data
},
],
});
},
// 页面跳转
linkToPage(path, start, end) {
let row = { alarmStatus: 1 };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!