From 8c6cf205affbbc8ada74f00a7ca25ebca867e9ed Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 27 Sep 2021 11:44:44 +0800
Subject: [PATCH] 图表颜色
---
src/views/securityAnalysis/index.vue | 43 ++++++++++++++++++++++---------------------
1 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/src/views/securityAnalysis/index.vue b/src/views/securityAnalysis/index.vue
index 4e3ad01..9c4aa45 100644
--- a/src/views/securityAnalysis/index.vue
+++ b/src/views/securityAnalysis/index.vue
@@ -57,14 +57,14 @@
top="9vh"
>
<situation
- :card="{ deptid: deptid, jurisdiction: jurisdiction }"
+ :card="{ deptId: deptid, jurisdiction: jurisdiction }"
v-if="sees == 1"
>
<!-- 保安员审查情况统计 -->
</situation>
<certificate
- :card="{ deptid: deptid, jurisdiction: jurisdiction }"
+ :card="{ deptId: deptid, jurisdiction: jurisdiction }"
v-if="sees == 2"
>
<!-- 保安员持证情况统计 -->
@@ -89,6 +89,7 @@
</assignment>
<socialSecurity
:card="{ deptid: deptid, jurisdiction: jurisdiction }"
+ :reself="dialogVisible"
v-if="sees == 6"
>
<!-- 社保缴纳情况 -->
@@ -142,6 +143,7 @@
// czdata: [],
sees: "",
+ colors: ["#91CC75", "#FF3106"], //[正常,异常];
};
},
computed: {
@@ -254,7 +256,7 @@
feature: {
myTool1: {
show: true,
- title: title,
+ title: "",
icon: "image://img/table.png",
onclick: function () {
that.dialogVisible = true;
@@ -264,6 +266,16 @@
},
},
};
+ },
+ setColor(d, color) {
+ for (var k in d) {
+ var itemStyle = {
+ color: color[k],
+ };
+ d[k]["itemStyle"] = itemStyle;
+ }
+ console.log(d);
+ return d;
},
getEC1() {
var that = this;
@@ -295,22 +307,10 @@
},
];
var option, data;
- // if (d) {
- data = d;
- // } else {
- // data = [
- // { value: 1048, name: "搜索引擎" },
- // { value: 735, name: "直接访问" },
- // { value: 580, name: "邮件营销" },
- // { value: 484, name: "联盟广告" },
- // { value: 300, name: "视频广告" },
- // ];
- // }
- // console.log(data);
+ data = this.setColor(d, this.colors);
option = {
title: {
text: "保安员审查情况统计",
- // subtext: "纯属虚构",
top: 25,
left: "center",
},
@@ -428,6 +428,7 @@
setEC2(data) {
var option;
var that = this;
+ data = this.setColor(data, this.colors);
// console.log(data, "持证");
option = {
title: {
@@ -501,7 +502,7 @@
sd = [],
ld = [],
that = this;
- for (var i = 0; i < 100; i++) {
+ for (var i = 0; i <= 100; i++) {
xd.push(i + "分");
}
// console.log(sd);
@@ -707,7 +708,7 @@
},
setEC5(d) {
var option;
-
+ d = this.setColor(d, this.colors);
option = {
title: {
text: "保安派遣情况统计",
@@ -776,7 +777,7 @@
},
setEC6(d) {
var option;
-
+ d = this.setColor(d, this.colors);
option = {
title: {
text: "社保缴纳情况统计",
@@ -854,10 +855,10 @@
// console.log(roleName);
// console.log(res.data.data);
// console.log(roleAlias);
- if (roleName == "超级管理员" || roleName == "公安管理员") {
+ if (roleName != "保安公司管理员") {
this.deptid = "";
this.jurisdiction = this.userInfo.jurisdiction;
- } else if (roleName == "保安公司管理员") {
+ } else {
this.deptid = this.userInfo.dept_id;
this.jurisdiction = "";
}
--
Gitblit v1.9.3