From b4e097a02d80f0614281bfccb555ac6c66d0fda4 Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Fri, 1 Nov 2024 19:43:04 +0800 Subject: [PATCH] =?UTF-8?q?fit:=20=E5=8D=95=E4=BD=8D=E7=94=BB=E5=83=8F?= =?UTF-8?q?=E3=80=81=E4=B8=AA=E4=BA=BA=E7=94=BB=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/sensitivePerception/profileDepart.ts | 14 + src/components/datav/chart-bar.vue | 24 +- .../sensitivePerception/DepartNegative.vue | 330 ++++++++++++++--- .../sensitivePerception/PoliceNegative.vue | 342 ++++++++++++++++++ 4 files changed, 659 insertions(+), 51 deletions(-) create mode 100644 src/api/sensitivePerception/profileDepart.ts create mode 100644 src/views/sensitivePerception/PoliceNegative.vue diff --git a/src/api/sensitivePerception/profileDepart.ts b/src/api/sensitivePerception/profileDepart.ts new file mode 100644 index 0000000..719ce94 --- /dev/null +++ b/src/api/sensitivePerception/profileDepart.ts @@ -0,0 +1,14 @@ +import request from "@/api/request"; + +export function listDepartNegative(query) { + return request.get({ + url: `/profile/depart`, + query + }); +} + +export function getDepartProfile(departId) { + return request.get({ + url: `/profile/depart/${departId}` + }); +} \ No newline at end of file diff --git a/src/components/datav/chart-bar.vue b/src/components/datav/chart-bar.vue index 98da7fe..a5e6145 100644 --- a/src/components/datav/chart-bar.vue +++ b/src/components/datav/chart-bar.vue @@ -6,7 +6,7 @@
{{ item.label }} @@ -84,14 +84,21 @@ function getColor(val) { if (props.color instanceof String) { return props.color; } - - if (val > 0.8) { - return "linear-gradient(270deg, #63e700 0%, #19674c 100%)"; - } - if (val >= 0.7) { - return "linear-gradient( 270deg, #FFB90E 0%, #71501D 100%)"; + if (props.color instanceof Array) { + const colors = [...props.color] + colors.reduce((a, b) => b.percentage - a.percentage) + console.log(colors) + for (let i = 0; i < colors.length; i++) { + if (val > colors[0].percentage) { + return colors[0].color; + } + } } - return "linear-gradient( 270deg, #FB002D 0%, #822232 100%)"; + return "linear-gradient(270deg, #63e700 0%, #19674c 100%)"; + // if (val >= 0.7) { + // return "linear-gradient( 270deg, #FFB90E 0%, #71501D 100%)"; + // } + // return "linear-gradient( 270deg, #FB002D 0%, #822232 100%)"; } \ No newline at end of file diff --git a/src/views/sensitivePerception/PoliceNegative.vue b/src/views/sensitivePerception/PoliceNegative.vue new file mode 100644 index 0000000..cabe848 --- /dev/null +++ b/src/views/sensitivePerception/PoliceNegative.vue @@ -0,0 +1,342 @@ + + + \ No newline at end of file