From dc91db9bb3473c3ed058f86f74359e15c035a8a5 Mon Sep 17 00:00:00 2001
From: zhengpz <1838927346@qq.com>
Date: Mon, 23 Aug 2021 22:13:10 +0800
Subject: [PATCH] 表查询完善
---
src/views/securityUnitOperation/securityEchart.js | 130 ++++++++++++++++++++++++++++++++++++------
1 files changed, 110 insertions(+), 20 deletions(-)
diff --git a/src/views/securityUnitOperation/securityEchart.js b/src/views/securityUnitOperation/securityEchart.js
index f88d5c9..215f700 100644
--- a/src/views/securityUnitOperation/securityEchart.js
+++ b/src/views/securityUnitOperation/securityEchart.js
@@ -26,15 +26,15 @@
"#96dee8"
],
grid: {
- top: "10%",
+ top: "15%",
left: "3%",
right: "4%",
- bottom: "15%",
+ bottom: "0%",
containLabel: true
},
legend: {
- data: ["趋势"],
- bottom: "0%",
+ data: ["服务客户数量"],
+ top: "0%",
textStyle: {
color: "#fff"
}
@@ -71,7 +71,6 @@
]
},
yAxis: {
- name: "(元)",
type: "value",
axisLabel: {
color: "#fff"
@@ -79,7 +78,7 @@
},
series: [
{
- name: "趋势",
+ name: "服务对象数量",
data: data,
type: "line",
smooth: true,
@@ -90,6 +89,22 @@
return option;
}
function bottomOption1(alldata) {
+ let baoan = [];
+ let chiz = [];
+ let paiq = [];
+ alldata.forEach(item => {
+ for (var i in item) {
+ for (var j in item[i]) {
+ if (i === "baoan") {
+ baoan.push(item[i][j]);
+ } else if (i === "chiz") {
+ chiz.push(item[i][j]);
+ } else if (i === "paiq") {
+ paiq.push(item[i][j]);
+ }
+ }
+ }
+ });
let option = {
// title: {
// text: "公司运营趋势",
@@ -99,7 +114,6 @@
// },
color: [
"#73c0de",
-
"#fac858",
"#91cc75",
"#3ba272",
@@ -113,21 +127,21 @@
"#96dee8"
],
grid: {
- top: "10%",
+ top: "15%",
left: "3%",
right: "4%",
- bottom: "15%",
+ bottom: "0%",
containLabel: true
},
legend: {
- data: ["趋势"],
- bottom: "0%",
+ data: ["保安员数量", "派遣数量", "持证数量"],
+ top: "0%",
textStyle: {
color: "#fff"
}
},
tooltip: {
- trigger: "item",
+ trigger: "axis",
backgroundColor: "#031952",
color: "#fff",
borderWidth: "0", //边框宽度设置1
@@ -158,7 +172,7 @@
]
},
yAxis: {
- name: "(元)",
+ // name: "(元)",
type: "value",
axisLabel: {
color: "#fff"
@@ -166,11 +180,22 @@
},
series: [
{
- name: "趋势",
- data: [10, 20, 14, 15, 16, 17, 24, 15, 3, 7, 11, 23],
+ name: "保安员数量",
type: "line",
- smooth: true,
- areaStyle: {}
+ stack: "总量",
+ data: baoan
+ },
+ {
+ name: "派遣数量",
+ type: "line",
+ stack: "总量",
+ data: paiq
+ },
+ {
+ name: "持证数量",
+ type: "line",
+ stack: "总量",
+ data: chiz
}
]
};
@@ -413,8 +438,72 @@
};
return option;
}
+function bottomOption2(alldata) {
+ let option = {
+ tooltip: {
+ trigger: "item",
+ formatter: "{a}<br>{b}:{c}({d}%)",
+ axisPointer: {
+ type: "shadow"
+ },
+ backgroundColor: "#031952", //设置背景图片 rgba格式
+ color: "#fff",
+ borderWidth: "0", //边框宽度设置1
+ // borderColor: "gray", //设置边框颜色
+ textStyle: {
+ color: "#fff" //设置文字颜色
+ }
+ },
+ // legend: {
+ // data: ["青年", "中年", "老年"],
+ // top: "0%",
+ // itemHeight: 10,
+ // textStyle: {
+ // color: "#fff"
+ // }
+ // },
+ color: [
+ "#73c0de",
+ "#fac858",
+ "#91cc75",
+ "#3ba272",
+ "#fc8452",
+ "#9a60b4",
+ "#3fb1e3",
+ "#6be6c1",
+ "#626c91",
+ "#a0a7e6",
+ "#c4ebad",
+ "#96dee8"
+ ],
+ grid: {
+ top: "10%",
+ left: "5%",
+ right: "30%",
+ bottom: "4%",
+ containLabel: true
+ },
+ series: [
+ {
+ name: "年龄结构",
+ type: "pie",
+ center: ["33%", "50%"],
+ radius: "70%",
+ data: [
+ { value: 1048, name: "青年" },
+ { value: 735, name: "中年" },
+ { value: 580, name: "老年" }
+ ],
+ label: {
+ color: "#fff"
+ }
+ }
+ ]
+ };
+ return option;
+}
-function economicMiddle(data1,data2) {
+function economicMiddle(data1, data2) {
let sbData = [];
let pqData = [];
for (var a in data1) {
@@ -576,7 +665,7 @@
},
data: [
{ value: allData.PCount, name: "已派遣人数" },
- { value: allData.WPCount, name: "未派遣人" }
+ { value: allData.WPCount, name: "未派遣人数" }
]
}
]
@@ -590,5 +679,6 @@
middleOption1,
middleOption2,
economicMiddle,
- economicPieOption
+ economicPieOption,
+ bottomOption2
};
--
Gitblit v1.9.3