From 9a37c5e1b2190c3f6ec71483923922189091dd52 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 18 Dec 2024 09:42:01 +0800
Subject: [PATCH] 事件模拟更新
---
src/views/survey/components/box/fireSource.vue | 408 +++++++++++++++++++++++++--------------------------------
1 files changed, 179 insertions(+), 229 deletions(-)
diff --git a/src/views/survey/components/box/fireSource.vue b/src/views/survey/components/box/fireSource.vue
index c61bd38..c985430 100644
--- a/src/views/survey/components/box/fireSource.vue
+++ b/src/views/survey/components/box/fireSource.vue
@@ -1,280 +1,230 @@
-<!--
- * @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 { Picture } from '@element-plus/icons-vue'
-import { getDetail } from '../../../../api/indParkInfo'
+import { inject, Text } from 'vue'
+const { VITE_APP_BASE } = import.meta.env
+import { getDetail } from '@/api/indParkInfo'
-import { ref, reactive } from 'vue'
+import { getAssetsFile } from 'utils/utils'
+import { useRouterStore } from 'store/router'
+import { useRouter, useRoute } from 'vue-router'
+let router = useRouter()
+const store = useRouterStore()
let state = reactive({
- parkInfo: {}
+ parkInfo: {}
})
+// 企业信息统计数组
+let parkInfoList = reactive([
+ {
+ id: 1,
+ name: 'plaArea',
+ title: '园区面积',
+ content: '1000',
+ unit: '公顷',
+ img: getAssetsFile('yq-mj.png', '/bgicon')
+ },
+ {
+ id: 2,
+ name: 'recNum',
+ title: '救援人员数量',
+ content: '1000',
+ unit: '人',
+ img: getAssetsFile('yq-jy.png', '/bgicon')
+ },
+ // {
+ // id: 3,
+ // name: 'riskFirmNum',
+ // title: '风险企业数量',
+ // content: '1000',
+ // img: getAssetsFile('yq-fx.png', '/bgicon')
+ // },
+ // {
+ // id: 4,
+ // name: 'proTarNum',
+ // title: '保护目标数量',
+ // content: '1000',
+ // img: getAssetsFile('yq-bh.png', '/bgicon')
+ // },
+ {
+ id: 5,
+ name: 'spaceNum',
+ title: '应急空间数量',
+ content: '1000',
+ img: getAssetsFile('yq-yj.png', '/bgicon')
+ },
+ {
+ id: 6,
+ name: 'firmNum',
+ title: '企业数量',
+ content: '1000',
+ img: getAssetsFile('yq-qy.png', '/bgicon')
+ }
+]
+)
// 初始化
onMounted(() => {
- getData()
+ getData()
})
// 获取详情
-function getData() {
- getDetail().then(res => {
- state.parkInfo = res.data.data
- // console.log("************************", parkInfo)
- }).catch(err => {
- console.log(err)
+function getData () {
+ getDetail().then(res => {
+ state.parkInfo = res.data.data
+ parkInfoList.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)
+ })
}
-
-
-
</script>
<template>
- <!-- <public-content>
- <template #content> -->
- <div class="box-content-box">
- <div class="box-content">
- <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 class="box-content-box">
+ <div class="box-content">
+ <div>
+ <div class="box-content-img">
+ <!-- <img :src="state.parkInfo.imageUrls" alt=""> -->
+ <el-image style="width: 100px; height: 100px" :src="state.parkInfo.imageUrls" :zoom-rate="1.2" :max-scale="7"
+ :min-scale="0.2" :preview-src-list="[state.parkInfo.imageUrls]" :initial-index="4" fit="cover">
+ <template #error>
+ <div class="image-slot">
+ <el-icon>
+ <Picture />
+ </el-icon>
+ </div>
+ </template>
+ </el-image>
+ <span>{{ state.parkInfo.remark }}</span>
</div>
-
- <div class="container">
- <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.plaArea }}</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.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>
- </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>
</div>
- <!-- </template>
- </public-content> -->
+
+ <div class="container">
+ <div class="box-content-sj" v-for="item in parkInfoList" :key="item.id">
+ <img :src="item.img" alt="">
+ <div class="r">
+ <div class="box-content-text-title">
+ {{ item.content }}
+ <text v-if="item.unit">({{ item.unit }})</text>
+ </div>
+
+ <div class="box-content-text-content">
+ {{ item.title }}
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- <el-button @click="goSubLayout">跳转a</el-button> -->
+ </div>
</template>
<style lang="scss" scoped>
.box-content-box {
- color: #fff;
- font-size: 15px;
+ padding: 10px;
+ color: #fff;
+ font-size: 15px;
}
.box-content {
- display: flex;
- justify-content: space-between;
+ display: flex;
+ justify-content: space-between;
}
-.box-content-text-remark {}
+.box-content-img {
-.content-qy-info {
- display: flex;
- justify-content: space-between;
- text-align: center;
- margin-top: 15px;
+ height: 280px;
+ line-height: 28px;
+ // 隐藏滚动条
+ scrollbar-width: none;
+ overflow-x: hidden;
+ overflow-y: auto;
}
-.box-content-img img {
- margin: 5px;
- /* 宽度可以根据实际情况调整 */
- height: 120px;
+.box-content-img span {
+ // 行距
+ line-height: 25px;
+ // 字体间隙
+ letter-spacing: 1px;
}
-.box-content-title img {
- width: 80px;
- height: 80px;
+.box-content-img .el-image {
+ float: left;
+ margin: 5px;
+ margin-right: 15px;
+ /* 宽度可以根据实际情况调整 */
+ width: 130px;
+ height: 130px;
}
+
.box-content-text {
- padding-left: 5px;
- height: 130px;
- overflow: scroll;
- // 隐藏滚动条
- scrollbar-width: none;
+ padding-left: 5px;
+ height: 360px;
+ overflow: scroll;
+ // 隐藏滚动条
+ // scrollbar-width: none;
}
.container {
- display: flex;
- flex-wrap: wrap;
- gap: 5px;
+ margin-top: 10px;
+ display: flex;
+ justify-content: space-around;
+ flex-wrap: wrap;
+ gap: 5px;
}
.box-content-sj {
- flex: 1 1 31%;
- /* 每个盒子占据大约31%的宽度,留出一些空间用于间距 */
- min-width: 100px;
- /* 最小宽度,防止在非常小的屏幕上变得太窄 */
- box-sizing: border-box;
- padding: 5px;
- // border: 1px solid #ccc;
+ /* 每个盒子占据大约31%的宽度,留出一些空间用于间距 */
+ min-width: 40%;
+ /* 最小宽度,防止在非常小的屏幕上变得太窄 */
+ box-sizing: border-box;
+ // border: 1px solid #ccc;
+ display: flex;
+ // 设置高度
+ align-items: center;
+ justify-content: space-between;
+
+ img {
+ width: 36px;
+ height: 36px;
+ vertical-align: middle;
+ }
+
+ .r {
+ margin-left: 1px;
+ flex: 1;
display: flex;
- // 设置高度
- align-items: center;
-}
+ flex-direction: column;
+ justify-content: space-around;
-.box-content-sj img {
- max-width: 60%;
- height: 60px;
-}
+ .box-content-text-title,
+ .box-content-text-content {
+ margin-top: 5px;
+ font-size: 13px;
+ text-align: center;
+ }
-.box-content-ss {
- margin: 0px 0px 0px 10px;
-}
+ .box-content-text-title {
+ font-size: 16px;
+ font-weight: bold;
+ }
-.box-content-text-title,
-.box-content-text-content {
- margin-top: 5px;
- font-size: 12px;
- text-align: center;
-}
-
-.box-content-text-title-span,
-.box-content-text-content-span {
- font-weight: bold;
+ .box-content-text-title text {
+ margin-top: 5px;
+ font-size: 10px;
+ text-align: center;
+ }
+ }
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3