From 4d49293ba321cf346bdef66a8bfb1a93a8bbbfac Mon Sep 17 00:00:00 2001
From: KeXuCong <13266269839@163.com>
Date: Fri, 10 Jan 2025 17:47:15 +0800
Subject: [PATCH] update
---
.../gateway/earlyWarningDivisionSituation.vue | 116 ++++++++++--------
jwtech-admin-page/vue.config.js | 2 +-
2 files changed, 64 insertions(+), 54 deletions(-)
diff --git a/jwtech-admin-page/src/views/gateway/earlyWarningDivisionSituation.vue b/jwtech-admin-page/src/views/gateway/earlyWarningDivisionSituation.vue
index 052af834..693c5a79 100644
--- a/jwtech-admin-page/src/views/gateway/earlyWarningDivisionSituation.vue
+++ b/jwtech-admin-page/src/views/gateway/earlyWarningDivisionSituation.vue
@@ -9,7 +9,7 @@
预警分布情况
-
-
待办事项(个)
-
16
+
预警
+
{{ this.forewarningNum.warn }}
-
待办事项(个)
-
145
+
提醒
+
{{ this.forewarningNum.forewarning }}
-
待办事项(个)
-
3
+
正常
+
{{ this.forewarningNum.normal }}
@@ -151,6 +151,13 @@
import { returnToken } from "@/api/login";
import { setToken, removeToken } from "@/utils/auth";
import * as echarts from "echarts";
+import {
+ getDistribution,
+ getTotal,
+ getPieChart,
+} from "@/api/warn/earlyWarning";
+
+import { getTypeNum, getForewarningNum } from "@/api/projectStatistics/sort";
export default {
data() {
@@ -160,19 +167,39 @@ export default {
parmas: {
token: null,
},
+ forewarnData: {},
+ InfoList: [],
+ forewarningNum: [],
};
},
created() {
- console.log("this.$route", this.$route);
- this.parmas.token = this.$route.query.token;
- returnToken(this.parmas).then((res) => {
- console.log("有效token", res.token);
- let token = res.token;
- setToken(token);
+ // console.log("this.$route", this.$route);
+ // this.parmas.token = this.$route.query.token;
+ // returnToken(this.parmas).then((res) => {
+ // console.log("有效token", res.token);
+ // let token = res.token;
+ // setToken(token);
+ // });
+ getTotal().then((res) => {
+ this.forewarnData = res.data;
+ });
+ getDistribution({ pageNum: 1, pageSize: 99 }).then((res) => {
+ const newData = res.data.map((item) => {
+ item.adcd = item.adcdPrefix + "00";
+ item.deCodeAdcd = this.$formatAdcd(item);
+ return item;
+ });
+ console.log(newData);
+ this.InfoList = newData;
+ this.initEcharts(this.InfoList);
+ });
+ getForewarningNum().then((res) => {
+ this.forewarningNum = res.data;
+ console.log('--------',this.forewarningNum);
});
},
mounted() {
- this.initEcharts();
+ // this.initEcharts();
},
methods: {
chooseBtn(key) {
@@ -181,14 +208,23 @@ export default {
chooseTime(key) {
this.activeTime = key;
},
- initEcharts() {
+ initEcharts(chartData) {
var chartDom = this.$refs.myEcharts;
var myChart = echarts.init(chartDom);
var option;
+ let xAxisData = [];
+ let matchedCountDate = []; // 项目数
+ let proInfoCountDate = []; // 预警项目数
+ chartData.forEach((item) => {
+ xAxisData.push(item.deCodeAdcd.split("-")[1]);
+ matchedCountDate.push(item.matchedCount);
+ proInfoCountDate.push(item.proInfoCount);
+ });
+
option = {
title: {
- text: "单位:条",
+ text: "单位:个",
x: 18,
textStyle: {
color: "rgba(38, 38, 38, 0.65)",
@@ -222,27 +258,7 @@ export default {
axisTick: {
show: false,
},
- data: [
- "广州",
- "深圳",
- "佛山",
- "中山",
- "惠州",
- "东莞",
- "阳江",
- "韶关",
- "河源",
- "肇庆",
- "珠海",
- "江门",
- "汕头",
- "潮州",
- "揭阳",
- "湛江",
- "茂名",
- "清远",
- "梅州",
- ],
+ data: xAxisData,
},
],
yAxis: [
@@ -269,7 +285,7 @@ export default {
],
series: [
{
- name: "红灯",
+ name: "项目数",
type: "bar",
// 重叠
stack: "Ad",
@@ -283,13 +299,10 @@ export default {
emphasis: {
focus: "series",
},
- data: [
- 120, 132, 101, 134, 90, 230, 210, 120, 132, 101, 134, 90, 230,
- 210, 120, 132, 101, 134, 90,
- ],
+ data: matchedCountDate,
},
{
- name: "黄灯",
+ name: "预警项目数",
type: "bar",
stack: "Ad",
barMaxWidth: "25%",
@@ -302,10 +315,7 @@ export default {
emphasis: {
focus: "series",
},
- data: [
- 220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290, 330,
- 310, 220, 182, 191, 234, 290,
- ],
+ data: proInfoCountDate,
},
],
};
diff --git a/jwtech-admin-page/vue.config.js b/jwtech-admin-page/vue.config.js
index 050174ea..21721cbf 100644
--- a/jwtech-admin-page/vue.config.js
+++ b/jwtech-admin-page/vue.config.js
@@ -43,7 +43,7 @@ module.exports = {
// target: "http://127.0.0.1:18082",
// target: "http://192.168.2.108:18080",
// target: "http://192.168.2.103:18082",
- target: "http://localhost:18082",
+ target: "http://175.178.86.109:18082",
// target: "http://192.168.2.108:18080",
// target: "http://192.168.1.20:8084",
changeOrigin: true,