From 7f7c612ca21f0a1c808e2d069edf642b8e19919c Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 04 Nov 2024 16:33:03 +0800
Subject: [PATCH] Merge branch 'main' of http://139.196.74.78:10010/r/zhyq/bigScreen

---
 src/views/survey/components/box/fireContent.vue |   67 +++++--
 src/views/survey/components/box/dataContent.vue |  111 +++++++----
 src/views/survey/components/box/fireSource.vue  |  223 ++++++++----------------
 src/views/survey/components/box/fireTrend.vue   |    8 
 src/api/indParkInfo.js                          |   31 +++
 src/views/survey/components/leftContainer.vue   |    4 
 src/api/riskSource/riskSource.js                |   22 ++
 src/views/survey/components/box/unitContent.vue |   65 ++++++-
 8 files changed, 306 insertions(+), 225 deletions(-)

diff --git a/src/api/indParkInfo.js b/src/api/indParkInfo.js
index 0e3375e..38a5bc8 100644
--- a/src/api/indParkInfo.js
+++ b/src/api/indParkInfo.js
@@ -19,4 +19,35 @@
         method: 'get',
         params,
     });
+};
+
+
+
+export const getRescueTeamStatistic = (params) => {
+    const url = `/yw/rescueTeam/getStatisticData`;
+    return request({
+        url,
+        method: 'get',
+        params,
+    });
+};
+
+
+
+export const getRiskSourceStatistic = (params) => {
+    const url = `/yw/riskSource/getStatisticData`;
+    return request({
+        url,
+        method: 'get',
+        params,
+    });
+};
+
+export const getEmergencySpaceStatistic = (params) => {
+    const url = `/yw/emergencySpace/getStatisticData`;
+    return request({
+        url,
+        method: 'get',
+        params,
+    });
 };
\ No newline at end of file
diff --git a/src/api/riskSource/riskSource.js b/src/api/riskSource/riskSource.js
new file mode 100644
index 0000000..2a30a12
--- /dev/null
+++ b/src/api/riskSource/riskSource.js
@@ -0,0 +1,22 @@
+import request from 'utils/http'
+
+export const getDetail = (params) => {
+    const url = `/yw/riskSource/getDetail`;
+    return request({
+        url,
+        method: 'get',
+        params,
+    });
+};
+
+
+
+
+export const getList = (params) => {
+    const url = `/yw/riskSource/page`;
+    return request({
+        url,
+        method: 'get',
+        params,
+    });
+};
\ No newline at end of file
diff --git a/src/views/survey/components/box/dataContent.vue b/src/views/survey/components/box/dataContent.vue
index bed1169..3c61513 100644
--- a/src/views/survey/components/box/dataContent.vue
+++ b/src/views/survey/components/box/dataContent.vue
@@ -1,53 +1,86 @@
-<!--
- * @Author: shuishen 1109946754@qq.com
- * @Date: 2023-03-13 14:54:26
- * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2023-03-13 15:00:55
- * @FilePath: \forest-fire\src\views\statistics\components\box\dataContent.vue
- * @Description: 
- * 
- * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
--->
+
 <script setup>
 import publicContent from './publicContent.vue'
 
-import { ref, reactive } from 'vue'
+// import { ref, reactive, onMounted, nextTick, inject } from 'vue'
 
-import { getPage } from '../../../../api/indParkInfo'
+import { getRescueTeamStatistic } from '@/api/indParkInfo'
 
-var parkQy = ref([])
+let $echarts = inject('echarts')
+const curEcharts = ref(null)
 
-var searchQuery = ref('')
+let myEcharts = reactive(null)
 
 onMounted(() => {
-    getPages()
+    nextTick(() => {
+        myEcharts = $echarts.init(curEcharts.value)
+        getStatistic()
+
+    })
 })
 
 
-function getPages() {
-    getPage().then(res => {
-        parkQy.value = res.data.data.records
-        // console.log(res)
-    }).catch(err => {
-        console.log(err)
+function getStatistic() {
+    getRescueTeamStatistic().then(res => {
+        let xaxis_data = []
+        let yaxis_data = []
+        res.data.data.forEach(element => {
+            xaxis_data.push(element.type)
+            yaxis_data.push(element.num)
+        });
+
+        myEcharts.setOption({
+            tooltip: {
+                trigger: 'axis',
+                axisPointer: {
+                    type: 'shadow'
+                }
+            },
+            grid: {
+                left: '3%',
+                right: '4%',
+                bottom: '3%',
+                containLabel: true
+            },
+            xAxis: [
+                {
+                    type: 'category',
+                    data: xaxis_data,
+                    axisTick: {
+                        alignWithLabel: true
+                    }
+                }
+            ],
+            yAxis: [
+                {
+                    type: 'value'
+                }
+            ],
+            series: [
+                {
+                    name: 'Direct',
+                    type: 'bar',
+                    barWidth: '30%',
+                    data: yaxis_data
+                }
+            ]
+        })
     })
 }
+
+
 </script>
 
 <template>
-    <!-- <public-content>
-        <template #content> -->
-    <div class="data-content">
-        <div v-for="item in parkQy" :key="item.id">
-            <div class="data-content-item">
-                <div> {{ item.name }}</div>
-                <el-button size="small" type="primary">{{ item.categoryName }}</el-button>
-            </div>
+    <public-content>
+        <template #content>
+            <div class="unit-content">
+                <div class="unit-content-echarts" ref="curEcharts">
 
-        </div>
-    </div>
-    <!-- </template>
-    </public-content> -->
+                </div>
+            </div>
+        </template>
+    </public-content>
 </template>
 
 <style lang="scss" scoped>
@@ -56,15 +89,7 @@
 
 }
 
-.data-content-item {
-    display: flex;
-    margin: 2px 10px;
-    padding: 5px 0;
-    text-indent: 1em;
-    background-color: #747bff;
-    justify-content: space-between;
-    // 超过高度自动显示滚动条
-    overflow-y: auto;
-    border-radius: 5px;
+.unit-content-echarts {
+    height: 200px;
 }
 </style>
\ No newline at end of file
diff --git a/src/views/survey/components/box/fireContent.vue b/src/views/survey/components/box/fireContent.vue
index 7aa74cf..ba449ef 100644
--- a/src/views/survey/components/box/fireContent.vue
+++ b/src/views/survey/components/box/fireContent.vue
@@ -1,39 +1,66 @@
-<!--
- * @Author: shuishen 1109946754@qq.com
- * @Date: 2023-03-13 14:54:26
- * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2023-03-13 15:00:55
- * @FilePath: \forest-fire\src\views\statistics\components\box\dataContent.vue
- * @Description: 
- * 
- * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
--->
 <script setup>
 import publicContent from './publicContent.vue'
 
-import { inject, reactive } from 'vue'
+import { getRiskSourceStatistic } from '../../../../api/indParkInfo'
 
 let $echarts = inject('echarts')
 const curEcharts = ref(null)
 
+let myEcharts = reactive(null)
+
 onMounted(() => {
-  nextTick(() => {
-    let myEcharts = $echarts.init(curEcharts.value)
+  myEcharts = $echarts.init(curEcharts.value)
+  getRiskSource()
+
+})
+
+
+function getRiskSource () {
+  getRiskSourceStatistic().then(res => {
+    let xaxis_data = []
+    let yaxis_data = []
+    res.data.data.forEach(element => {
+      xaxis_data.push(element.riskLevel)
+      yaxis_data.push(element.num)
+    })
     myEcharts.setOption({
-      xAxis: {
-        data: ['A', 'B', 'C', 'D', 'E']
+      tooltip: {
+        trigger: 'axis',
+        axisPointer: {
+          type: 'shadow'
+        }
       },
-      yAxis: {},
+      grid: {
+        left: '3%',
+        right: '4%',
+        bottom: '3%',
+        containLabel: true
+      },
+      xAxis: [
+        {
+          type: 'category',
+          data: xaxis_data,
+          axisTick: {
+            alignWithLabel: true
+          }
+        }
+      ],
+      yAxis: [
+        {
+          type: 'value'
+        }
+      ],
       series: [
         {
+          name: 'Direct',
           type: 'bar',
-          data: [10, 22, 28, 43, 49],
-          barWidth: '60%'
+          barWidth: '30%',
+          data: yaxis_data
         }
       ]
     })
   })
-})
+}
 </script>
 
 <template>
@@ -60,6 +87,6 @@
 }
 
 .fire-content-echarts {
-  height: 4.5rem
+  height: 200px;
 }
 </style>
\ No newline at end of file
diff --git a/src/views/survey/components/box/fireSource.vue b/src/views/survey/components/box/fireSource.vue
index 9261c7f..e2b8d97 100644
--- a/src/views/survey/components/box/fireSource.vue
+++ b/src/views/survey/components/box/fireSource.vue
@@ -1,23 +1,64 @@
-<!--
- * @Author: shuishen 1109946754@qq.com
- * @Date: 2023-03-13 14:54:26
- * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-11-01 09:54:15
- * @FilePath: \bigScreen\src\views\survey\components\box\fireSource.vue
- * @Description: 
- * 
- * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
--->
+
 <script setup>
+import { Text } from 'vue';
 import publicContent from './publicContent.vue'
 const { VITE_APP_BASE } = import.meta.env
 import { getDetail } from '@/api/indParkInfo'
 
-import { ref, reactive } from 'vue'
-
 let state = reactive({
   parkInfo: {}
 })
+
+// 企业信息统计数组
+let parkInfoList = ref([
+  {
+    id: 1,
+    name: 'plaArea',
+    title: '园区面积',
+    content: '1000',
+    unit: '公顷',
+    img: 'images/雨量站@2x.png'
+  },
+  {
+    id: 2,
+    name: 'recNum',
+    title: '救援人员数量',
+    content: '1000',
+    unit: '人',
+    img: 'images/雨量站@2x.png'
+
+  },
+  {
+    id: 3,
+    name: 'riskFirmNum',
+    title: '风险企业数量',
+    content: '1000',
+    img: 'images/雨量站@2x.png'
+  },
+  {
+    id: 4,
+    name: 'proTarNum',
+    title: '保护目标数量',
+    content: '1000',
+    img: 'images/雨量站@2x.png'
+  },
+  {
+    id: 5,
+    name: 'spaceNum',
+    title: '应急空间数量',
+    content: '1000',
+    img: 'images/雨量站@2x.png'
+  },
+  {
+    id: 6,
+    name: 'firmNum',
+    title: '企业数量',
+    content: '1000',
+    img: 'images/雨量站@2x.png'
+  }
+]
+)
+
 
 
 
@@ -27,10 +68,16 @@
 
 })
 // 获取详情
-function getData () {
+function getData() {
   getDetail().then(res => {
     state.parkInfo = res.data.data
-    // console.log("************************", parkInfo)
+    parkInfoList.value.forEach(item => {
+      if (item.name == 'plaArea') {
+        state.parkInfo[item.name] && (item.content = (state.parkInfo[item.name] * 100).toFixed(2))
+      } else {
+        state.parkInfo[item.name] && (item.content = state.parkInfo[item.name])
+      }
+    })
   }).catch(err => {
     console.log(err)
   })
@@ -48,151 +95,31 @@
           <div>
             <div class="box-content-img">
               <img :src="state.parkInfo.imageUrls" alt="">
-            </div>
-          </div>
-          <div class="box-content-text-remark">
-            <div class="box-content-text">
               {{ state.parkInfo.remark }}
             </div>
           </div>
         </div>
 
         <div class="container">
-          <div class="box-content-sj">
-            <img :src="VITE_APP_BASE + 'images/雨量站@2x.png'" alt="">
+          <div class="box-content-sj" v-for="item in parkInfoList" :key="item.id">
+            <img :src="VITE_APP_BASE + item.img" alt="">
             <div>
               <div class="box-content-ss">
                 <div>
                   <div class="box-content-text-title">
-                    <span class="box-content-text-title-span">{{ state.parkInfo.plaArea }}</span>
+                    <span class="box-content-text-title-span">{{ item.content }}</span>
                   </div>
                 </div>
                 <div>
                   <div class="box-content-text-content">
-                    <span class="box-content-text-content-span">园区面积 (公顷)</span>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-
-          <div class="box-content-sj">
-            <img :src="VITE_APP_BASE + 'images/雨量站@2x.png'" alt="">
-            <div>
-              <div class="box-content-ss">
-                <div>
-                  <div class="box-content-text-title">
-                    <span class="box-content-text-title-span">{{ state.parkInfo.recNum }}</span>
-                  </div>
-                </div>
-                <div>
-                  <div class="box-content-text-content">
-                    <span class="box-content-text-content-span">救援人员数量</span>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-
-          <div class="box-content-sj">
-            <img src="../../../../../public/images/雨量站@2x.png" alt="">
-            <div>
-              <div class="box-content-ss">
-                <div>
-                  <div class="box-content-text-title">
-                    <span class="box-content-text-title-span">{{ state.parkInfo.riskFirmNum }}</span>
-                  </div>
-                </div>
-                <div>
-                  <div class="box-content-text-content">
-                    <span class="box-content-text-content-span">风险企业数量</span>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-
-          <div class="box-content-sj">
-            <img src="../../../../../public/images/雨量站@2x.png" alt="">
-            <div>
-              <div class="box-content-ss">
-                <div>
-                  <div class="box-content-text-title">
-                    <span class="box-content-text-title-span">{{ state.parkInfo.proTarNum }}</span>
-                  </div>
-                </div>
-                <div>
-                  <div class="box-content-text-content">
-                    <span class="box-content-text-content-span">保护目标数量</span>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-
-          <div class="box-content-sj">
-            <img src="../../../../../public/images/雨量站@2x.png" alt="">
-            <div>
-              <div class="box-content-ss">
-                <div>
-                  <div class="box-content-text-title">
-                    <span class="box-content-text-title-span">{{ state.parkInfo.spaceNum }}</span>
-                  </div>
-                </div>
-                <div>
-                  <div class="box-content-text-content">
-                    <span class="box-content-text-content-span">应急空间数量</span>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-
-          <div class="box-content-sj">
-            <img src="../../../../../public/images/雨量站@2x.png" alt="">
-            <div>
-              <div class="box-content-ss">
-                <div>
-                  <div class="box-content-text-title">
-                    <span class="box-content-text-title-span">{{ state.parkInfo.firmNum }}</span>
-                  </div>
-                </div>
-                <div>
-                  <div class="box-content-text-content">
-                    <span class="box-content-text-content-span">企业数量</span>
+                    <text class="box-content-text-content-span">{{ item.title }}</text>
+                    <text v-if="item.unit" class="box-content-text-content-span">({{ item.unit }})</text>
                   </div>
                 </div>
               </div>
             </div>
           </div>
         </div>
-
-
-        <div class="content-qy-info">
-          <div class="box-content-title">
-            <img src="../../../../../public/images/雨量站@2x.png" alt="">
-            <div class="box-content-title-text">
-              <span class="box-content-title-text-span">企业</span>
-            </div>
-          </div>
-
-          <div class="box-content-title">
-            <img src="../../../../../public/images/雨量站@2x.png" alt="">
-            <div class="box-content-title-text">
-              <span class="box-content-title-text-span">分区</span>
-            </div>
-          </div>
-
-          <div class="box-content-title">
-            <img src="../../../../../public/images/雨量站@2x.png" alt="">
-            <div class="box-content-title-text">
-              <span class="box-content-title-text-span">图层</span>
-            </div>
-          </div>
-
-        </div>
-
-
       </div>
     </template>
   </public-content>
@@ -209,18 +136,18 @@
   justify-content: space-between;
 }
 
-.box-content-text-remark {}
-
-.content-qy-info {
-  display: flex;
-  justify-content: space-between;
-  text-align: center;
-  margin-top: 15px;
+.box-content-img {
+  height: 300px;
+  overflow: scroll;
+  // 隐藏滚动条
+  scrollbar-width: none;
 }
 
 .box-content-img img {
+  float: left;
   margin: 5px;
   /* 宽度可以根据实际情况调整 */
+  width: 120px;
   height: 120px;
 }
 
@@ -231,7 +158,7 @@
 
 .box-content-text {
   padding-left: 5px;
-  height: 130px;
+  height: 300px;
   overflow: scroll;
   // 隐藏滚动条
   scrollbar-width: none;
@@ -269,7 +196,7 @@
 .box-content-text-title,
 .box-content-text-content {
   margin-top: 5px;
-  font-size: 12px;
+  font-size: 10px;
   text-align: center;
 }
 
diff --git a/src/views/survey/components/box/fireTrend.vue b/src/views/survey/components/box/fireTrend.vue
index af85115..75b8c7b 100644
--- a/src/views/survey/components/box/fireTrend.vue
+++ b/src/views/survey/components/box/fireTrend.vue
@@ -22,7 +22,7 @@
 })
 
 
-function getPages () {
+function getPages() {
   getPage().then(res => {
     parkQy.value = res.data.data.records
     console.log(res)
@@ -31,7 +31,7 @@
   })
 }
 
-function search () {
+function search() {
   getPage({ name: searchQuery.value }).then(res => {
     parkQy.value = res.data.data.records
     console.log(res)
@@ -88,6 +88,8 @@
   border: 1px solid #ccc;
   border-radius: 4px 0 0 4px;
   outline: none;
+  background-color: transparent;
+  color: #fff;
 }
 
 .search-button {
@@ -107,7 +109,7 @@
 .data-content-item {
   display: flex;
   margin: 2px 10px;
-  padding: 5px 0;
+  padding: 5px 5px;
   background-color: #747bff;
   justify-content: space-between;
   border-radius: 5px;
diff --git a/src/views/survey/components/box/unitContent.vue b/src/views/survey/components/box/unitContent.vue
index 649c6a3..e38a6b6 100644
--- a/src/views/survey/components/box/unitContent.vue
+++ b/src/views/survey/components/box/unitContent.vue
@@ -11,27 +11,74 @@
 <script setup>
 import publicContent from './publicContent.vue'
 
+import { getEmergencySpaceStatistic } from '../../../../api/indParkInfo'
+
 let $echarts = inject('echarts')
 const curEcharts = ref(null)
 
+let myEcharts = reactive(null)
+
 onMounted(() => {
   nextTick(() => {
-    let myEcharts = $echarts.init(curEcharts.value)
+    myEcharts = $echarts.init(curEcharts.value)
+    getEmergencySpace()
+
+  })
+})
+
+function getEmergencySpace () {
+  getEmergencySpaceStatistic().then(res => {
+    // console.log(res)
+    let data = res.data.data
+    let dataRsult = []
+    data.forEach(item => {
+      dataRsult.push({
+        name: item.type,
+        value: item.num
+      })
+    })
+
     myEcharts.setOption({
-      xAxis: {
-        data: ['A', 'B', 'C', 'D', 'E']
+      legend: {
+        orient: "vertical",
+        left: "left",
       },
-      yAxis: {},
+      tooltip: {
+        trigger: 'item'
+      },
+
       series: [
         {
-          type: 'bar',
-          data: [10, 22, 28, 43, 49],
-          barWidth: '60%'
+          // name: 'Access From',
+          type: 'pie',
+          radius: ['40%', '70%'],
+          // avoidLabelOverlap: false,
+          // padAngle: 5,
+          // itemStyle: {
+          //   borderRadius: 10
+          // },
+          // label: {
+          //   show: false,
+          //   position: 'left'
+          // },
+          // emphasis: {
+          //   label: {
+          //     show: true,
+          //     fontSize: 40,
+          //     fontWeight: 'bold'
+          //   }
+          // },
+          // labelLine: {
+          //   normal: {
+          //     show: true
+          //   }
+          // },
+          data: dataRsult
         }
       ]
     })
   })
-})
+}
 
 </script>
 
@@ -53,6 +100,6 @@
 }
 
 .unit-content-echarts {
-  height: 5rem;
+  height: 200px;
 }
 </style>
\ No newline at end of file
diff --git a/src/views/survey/components/leftContainer.vue b/src/views/survey/components/leftContainer.vue
index a3e7ef8..94e09ea 100644
--- a/src/views/survey/components/leftContainer.vue
+++ b/src/views/survey/components/leftContainer.vue
@@ -19,7 +19,7 @@
     <div class="data box">
       <title-box>
         <template #titleName>
-          数据概览1
+          救援队伍统计
         </template>
       </title-box>
       <data-content></data-content>
@@ -28,7 +28,7 @@
     <div class="unit box">
       <title-box>
         <template #titleName>
-          应急物资统计
+          应急空间统计
         </template>
       </title-box>
       <unit-content></unit-content>

--
Gitblit v1.9.3