瀏覽代碼

no message

libushang 2 周之前
父節點
當前提交
7c38dbeca1
共有 3 個文件被更改,包括 135 次插入17 次删除
  1. 9 0
      src/api/event.ts
  2. 99 1
      src/views/disasterRiskMonitor/chartOptions.ts
  3. 27 16
      src/views/disasterRiskMonitor/cityEmergencyEvent.vue

+ 9 - 0
src/api/event.ts

@@ -129,3 +129,12 @@ export function getTaskRegistrationDetail(params) {
     params: params
   });
 }
+
+
+// 趋势统计
+export function getEventCompletedTrend() {
+  return request({
+    url: "/api/event_management/event_xp/completed_trend",
+    method: "get"
+  });
+}

+ 99 - 1
src/views/disasterRiskMonitor/chartOptions.ts

@@ -3,7 +3,7 @@ import { graphic } from "echarts";
 export const chartOption1 = {
   legend: {},
   grid: {
-    top: "40px",
+    top: "60px",
     left: "30px",
     right: "20px",
     bottom: "30px"
@@ -152,6 +152,104 @@ export const chartOption1 = {
         }
       },
       data: []
+    },
+    {
+      name: "公共卫生事件",
+      type: "line",
+      smooth: true, //是否平滑
+      showAllSymbol: true,
+      symbol: "circle",
+      symbolSize: 6,
+      lineStyle: {
+        color: "#9bbdf4"
+      },
+      label: {
+        show: true,
+        position: "top",
+        textStyle: {
+          color: "#9bbdf4",
+          fontSize: 10
+        }
+      },
+
+      itemStyle: {
+        color: "#9bbdf4",
+        borderColor: "#fff",
+        borderWidth: 1
+      },
+      areaStyle: {
+        normal: {
+          color: new graphic.LinearGradient(
+            0,
+            0,
+            0,
+            1,
+            [
+              {
+                offset: 0,
+                color: "rgba(0,202,149,0.3)"
+              },
+              {
+                offset: 1,
+                color: "rgba(0,202,149,0)"
+              }
+            ],
+            false
+          ),
+          shadowColor: "rgba(0,202,149, 0.9)",
+          shadowBlur: 20
+        }
+      },
+      data: []
+    },
+    {
+      name: "社会安全事件",
+      type: "line",
+      smooth: true, //是否平滑
+      showAllSymbol: true,
+      symbol: "circle",
+      symbolSize: 6,
+      lineStyle: {
+        color: "#f9df83"
+      },
+      label: {
+        show: true,
+        position: "top",
+        textStyle: {
+          color: "#f9df83",
+          fontSize: 10
+        }
+      },
+
+      itemStyle: {
+        color: "#f9df83",
+        borderColor: "#fff",
+        borderWidth: 1
+      },
+      areaStyle: {
+        normal: {
+          color: new graphic.LinearGradient(
+            0,
+            0,
+            0,
+            1,
+            [
+              {
+                offset: 0,
+                color: "rgba(0,202,149,0.3)"
+              },
+              {
+                offset: 1,
+                color: "rgba(0,202,149,0)"
+              }
+            ],
+            false
+          ),
+          shadowColor: "rgba(0,202,149, 0.9)",
+          shadowBlur: 20
+        }
+      },
+      data: []
     }
   ]
 };

+ 27 - 16
src/views/disasterRiskMonitor/cityEmergencyEvent.vue

@@ -127,7 +127,7 @@ import {getEvent} from "@/api/duty/eventing";
 import {chartOption1} from "@/views/disasterRiskMonitor/chartOptions";
 import searchImg from "@/assets/images/search.png";
 import { iconList } from '@/components/Map/mapData';
-import { getActiveEventList } from "@/api/event";
+import { getActiveEventList, getEventCompletedTrend } from "@/api/event";
 
 const proxy = getCurrentInstance()?.proxy;
 const {mm_event_type} = toRefs<any>(
@@ -231,6 +231,16 @@ const getList = () => {
     loading.value = false;
   });
 };
+
+const getCompletedTrend = async() => {
+  getEventCompletedTrend().then((res) => {
+    option1.value.xAxis[0].data = res.data.xAxis;
+    res.data.series.forEach((n, i)=>{
+      option1.value.series[i].data = n;
+    });
+  })
+};
+
 const rowDetail = ref({
   address: '',
   event_type: '',
@@ -262,22 +272,23 @@ const initData = () => {
   //   }
   // ];
   // 趋势统计
-  option1.value.xAxis[0].data = [
-    "2024-01",
-    "2024-02",
-    "2024-03",
-    "2024-04",
-    "2024-05",
-    "2024-06"
-  ];
-  option1.value.series[0].data = [
-    502.84, 205.97, 332.79, 281.55, 398.35, 214.02
-  ];
-  option1.value.series[1].data = [
-    281.55, 398.35, 214.02, 179.55, 289.57, 356.14
-  ];
+  // option1.value.xAxis[0].data = [
+  //   "2024-01",
+  //   "2024-02",
+  //   "2024-03",
+  //   "2024-04",
+  //   "2024-05",
+  //   "2024-06"
+  // ];
+  // option1.value.series[0].data = [
+  //   502.84, 205.97, 332.79, 281.55, 398.35, 214.02
+  // ];
+  // option1.value.series[1].data = [
+  //   281.55, 398.35, 214.02, 179.55, 289.57, 356.14
+  // ];
   // 事件列表
-  getList()
+  getList();
+  getCompletedTrend();
 };
 </script>