From 7fbe838496148877bc5fe055e3098b3bc00a113d Mon Sep 17 00:00:00 2001
From: zhengpz <1838927346@qq.com>
Date: Fri, 20 Aug 2021 08:55:35 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_regulatory
---
src/views/securityUnitOperation/securityEchart.js | 215 +++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 190 insertions(+), 25 deletions(-)
diff --git a/src/views/securityUnitOperation/securityEchart.js b/src/views/securityUnitOperation/securityEchart.js
index 6c6298d..f88d5c9 100644
--- a/src/views/securityUnitOperation/securityEchart.js
+++ b/src/views/securityUnitOperation/securityEchart.js
@@ -1,4 +1,8 @@
-function bottomOption(data) {
+function bottomOption(alldata) {
+ let data = [];
+ for (var i in alldata) {
+ data.push(alldata[i]);
+ }
let option = {
// title: {
// text: "公司运营趋势",
@@ -36,7 +40,14 @@
}
},
tooltip: {
- trigger: "item"
+ trigger: "item",
+ backgroundColor: "#031952",
+ color: "#fff",
+ borderWidth: "0", //边框宽度设置1
+ // borderColor: "gray", //设置边框颜色
+ textStyle: {
+ color: "#fff" //设置文字颜色
+ }
},
xAxis: {
type: "category",
@@ -60,7 +71,7 @@
]
},
yAxis: {
- name: "(%)",
+ name: "(元)",
type: "value",
axisLabel: {
color: "#fff"
@@ -69,7 +80,7 @@
series: [
{
name: "趋势",
- data: [10, 30, 20, 50, 10, 40, 32, 13, 21, 12, 25, 11],
+ data: data,
type: "line",
smooth: true,
areaStyle: {}
@@ -78,7 +89,116 @@
};
return option;
}
-function middleOption1(data) {
+function bottomOption1(alldata) {
+ let option = {
+ // title: {
+ // text: "公司运营趋势",
+ // textStyle: {
+ // color: "#fff"
+ // }
+ // },
+ color: [
+ "#73c0de",
+
+ "#fac858",
+ "#91cc75",
+ "#3ba272",
+ "#fc8452",
+ "#9a60b4",
+ "#3fb1e3",
+ "#6be6c1",
+ "#626c91",
+ "#a0a7e6",
+ "#c4ebad",
+ "#96dee8"
+ ],
+ grid: {
+ top: "10%",
+ left: "3%",
+ right: "4%",
+ bottom: "15%",
+ containLabel: true
+ },
+ legend: {
+ data: ["趋势"],
+ bottom: "0%",
+ textStyle: {
+ color: "#fff"
+ }
+ },
+ tooltip: {
+ trigger: "item",
+ backgroundColor: "#031952",
+ color: "#fff",
+ borderWidth: "0", //边框宽度设置1
+ // borderColor: "gray", //设置边框颜色
+ textStyle: {
+ color: "#fff" //设置文字颜色
+ }
+ },
+ xAxis: {
+ type: "category",
+ axisLabel: {
+ color: "#fff"
+ },
+ boundaryGap: false,
+ data: [
+ "一月",
+ "二月",
+ "三月",
+ "四月",
+ "五月",
+ "六月",
+ "七月",
+ "八月",
+ "九月",
+ "十月",
+ "十一月",
+ "十二月"
+ ]
+ },
+ yAxis: {
+ name: "(元)",
+ type: "value",
+ axisLabel: {
+ color: "#fff"
+ }
+ },
+ series: [
+ {
+ name: "趋势",
+ data: [10, 20, 14, 15, 16, 17, 24, 15, 3, 7, 11, 23],
+ type: "line",
+ smooth: true,
+ areaStyle: {}
+ }
+ ]
+ };
+ return option;
+}
+function middleOption1(alldata) {
+ let baoan = [];
+ let zc = [];
+ let chiz = [];
+ let sheb = [];
+ 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 === "zc") {
+ zc.push(item[i][j]);
+ } else if (i === "chiz") {
+ chiz.push(item[i][j]);
+ } else if (i === "sheb") {
+ sheb.push(item[i][j]);
+ } else if (i === "paiq") {
+ paiq.push(item[i][j]);
+ }
+ }
+ }
+ });
let option = {
// title: {
// text: "公司保安类数据对比",
@@ -87,7 +207,14 @@
// }
// },
tooltip: {
- trigger: "axis"
+ trigger: "axis",
+ backgroundColor: "#031952",
+ color: "#fff",
+ borderWidth: "0", //边框宽度设置1
+ // borderColor: "gray", //设置边框颜色
+ textStyle: {
+ color: "#fff" //设置文字颜色
+ }
},
legend: {
data: [
@@ -157,43 +284,47 @@
name: "总保安数",
type: "bar",
barWidth: 9,
- data: [120, 132, 101, 134, 90, 230, 210, 214, 123, 22, 132, 321]
+ data: baoan
},
{
name: "正常保安数",
type: "bar",
barWidth: 9,
- data: [220, 182, 191, 234, 290, 330, 310, 111, 222, 132, 143, 123]
+ data: zc
},
{
name: "持证保安数",
type: "bar",
barWidth: 9,
- data: [150, 232, 201, 154, 190, 330, 410, 132, 111, 222, 132, 43]
+ data: chiz
},
{
name: "过考保安数",
type: "bar",
barWidth: 9,
- data: [320, 332, 301, 334, 390, 330, 320, 233, 123, 432, 122, 11]
+ data: []
},
{
name: "缴纳社保保安数",
type: "bar",
barWidth: 9,
- data: [120, 132, 101, 134, 120, 130, 132, 222, 111, 123, 341, 123]
+ data: sheb
},
{
name: "保安派遣",
type: "bar",
barWidth: 9,
- data: [120, 132, 101, 134, 1210, 130, 120, 22, 123, 33, 21, 13]
+ data: paiq
}
]
};
return option;
}
-function middleOption2(data) {
+function middleOption2(alldata) {
+ let data = [];
+ for (var i in alldata) {
+ data.push(alldata[i]);
+ }
let option = {
// title: {
// text: "服务客户",
@@ -205,6 +336,13 @@
trigger: "axis",
axisPointer: {
type: "shadow"
+ },
+ backgroundColor: "#031952",
+ color: "#fff",
+ borderWidth: "0", //边框宽度设置1
+ // borderColor: "gray", //设置边框颜色
+ textStyle: {
+ color: "#fff" //设置文字颜色
}
},
legend: {
@@ -269,17 +407,32 @@
{
name: "客户数",
type: "bar",
- data: [231, 123, 441, 123, 321, 333, 111, 221, 332, 442, 132, 51]
+ data: data
}
]
};
return option;
}
-function economicMiddle(data) {
+function economicMiddle(data1,data2) {
+ let sbData = [];
+ let pqData = [];
+ for (var a in data1) {
+ sbData.push(data1[a]);
+ }
+ for (var b in data2) {
+ pqData.push(data2[b]);
+ }
let option = {
tooltip: {
- trigger: "axis"
+ trigger: "axis",
+ backgroundColor: "#031952",
+ color: "#fff",
+ borderWidth: "0", //边框宽度设置1
+ // borderColor: "gray", //设置边框颜色
+ textStyle: {
+ color: "#fff" //设置文字颜色
+ }
},
legend: {
data: ["缴纳社保人数", "公司派遣人数"],
@@ -342,21 +495,21 @@
name: "缴纳社保人数",
type: "line",
stack: "总量",
- data: [120, 132, 101, 134, 90, 230, 210, 214, 123, 22, 132, 321]
+ data: sbData
},
{
name: "公司派遣人数",
type: "line",
stack: "总量",
- data: [220, 182, 191, 234, 290, 330, 310, 111, 222, 132, 143, 123]
+ data: pqData
}
]
};
return option;
}
-function economicPieOption() {
+function economicPieOption(allData) {
let title = "总";
- let total = "111";
+ let total = Number(allData.PCount) + Number(allData.WPCount);
let option = {
title: [
{
@@ -381,14 +534,22 @@
}
],
tooltip: {
- trigger: "item"
+ trigger: "item",
+ backgroundColor: "#031952",
+ color: "#fff",
+ borderWidth: "0", //边框宽度设置1
+ // borderColor: "gray", //设置边框颜色
+ textStyle: {
+ color: "#fff" //设置文字颜色
+ }
},
legend: {
bottom: "0%",
- left: "center",
+ right: "5%",
textStyle: {
color: "#fff"
- }
+ },
+ orient: "vertical"
},
color: [
"#73c0de",
@@ -410,9 +571,12 @@
name: "人员分布",
type: "pie",
radius: ["40%", "70%"],
+ label: {
+ color: "#fff"
+ },
data: [
- { value: 1048, name: "已派遣人数" },
- { value: 735, name: "未派遣人" }
+ { value: allData.PCount, name: "已派遣人数" },
+ { value: allData.WPCount, name: "未派遣人" }
]
}
]
@@ -422,6 +586,7 @@
export default {
bottomOption,
+ bottomOption1,
middleOption1,
middleOption2,
economicMiddle,
--
Gitblit v1.9.3