From d2c27ba635c49b7e0c2bac52083a7a9e9c646224 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 01 Nov 2024 10:10:39 +0800
Subject: [PATCH] 配置调整
---
src/views/survey/components/box/fireSource.vue | 330 ++++++++++++++++++------------------
src/views/survey/components/box/publicContent.vue | 6
src/views/survey/components/box/fireTrend.vue | 130 +++++++-------
src/views/survey/components/box/unitContent.vue | 53 +++--
src/utils/utils.js | 5
5 files changed, 261 insertions(+), 263 deletions(-)
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 99f75e2..c6f918b 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -9,7 +9,6 @@
* Copyright (c) 2024 by shuishen, All Rights Reserved.
*/
// 获取assets静态资源
-export const getAssetsFile = (url) => {
- console.log(import.meta.url, 1222222)
- return new URL(`../assets/img/${url}`, import.meta.url).href
+export const getAssetsFile = (url, base = '/img') => {
+ return new URL(`../assets${base}/${url}`, import.meta.url).href
}
\ 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 c61bd38..9261c7f 100644
--- a/src/views/survey/components/box/fireSource.vue
+++ b/src/views/survey/components/box/fireSource.vue
@@ -2,38 +2,38 @@
* @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
+ * @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 publicContent from './publicContent.vue'
-
-import { getDetail } from '../../../../api/indParkInfo'
+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: {}
+ parkInfo: {}
})
// 初始化
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
+ // console.log("************************", parkInfo)
+ }).catch(err => {
+ console.log(err)
+ })
}
@@ -41,240 +41,240 @@
</script>
<template>
- <!-- <public-content>
- <template #content> -->
- <div class="box-content-box">
+ <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-img">
+ <img :src="state.parkInfo.imageUrls" alt="">
</div>
- <div class="box-content-text-remark">
- <div class="box-content-text">
- {{ state.parkInfo.remark }}
- </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="../../../../../public/images/雨量站@2x.png" alt="">
+ <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-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 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 class="box-content-sj">
+ <img :src="VITE_APP_BASE + 'images/雨量站@2x.png'" alt="">
+ <div>
+ <div class="box-content-ss">
<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 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 class="box-content-sj">
+ <img src="../../../../../public/images/雨量站@2x.png" alt="">
+ <div>
+ <div class="box-content-ss">
<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 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 class="box-content-sj">
+ <img src="../../../../../public/images/雨量站@2x.png" alt="">
+ <div>
+ <div class="box-content-ss">
<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 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 class="box-content-sj">
+ <img src="../../../../../public/images/雨量站@2x.png" alt="">
+ <div>
+ <div class="box-content-ss">
<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 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 class="box-content-sj">
+ <img src="../../../../../public/images/雨量站@2x.png" alt="">
+ <div>
+ <div class="box-content-ss">
<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 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 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 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 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> -->
+ </div>
+ </template>
+ </public-content>
</template>
<style lang="scss" scoped>
.box-content-box {
- color: #fff;
- font-size: 15px;
+ color: #fff;
+ font-size: 15px;
}
.box-content {
- display: flex;
- justify-content: space-between;
+ display: flex;
+ justify-content: space-between;
}
.box-content-text-remark {}
.content-qy-info {
- display: flex;
- justify-content: space-between;
- text-align: center;
- margin-top: 15px;
+ display: flex;
+ justify-content: space-between;
+ text-align: center;
+ margin-top: 15px;
}
.box-content-img img {
- margin: 5px;
- /* 宽度可以根据实际情况调整 */
- height: 120px;
+ margin: 5px;
+ /* 宽度可以根据实际情况调整 */
+ height: 120px;
}
.box-content-title img {
- width: 80px;
- height: 80px;
+ width: 80px;
+ height: 80px;
}
.box-content-text {
- padding-left: 5px;
- height: 130px;
- overflow: scroll;
- // 隐藏滚动条
- scrollbar-width: none;
+ padding-left: 5px;
+ height: 130px;
+ overflow: scroll;
+ // 隐藏滚动条
+ scrollbar-width: none;
}
.container {
- display: flex;
- flex-wrap: wrap;
- gap: 5px;
+ display: flex;
+ 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;
- display: flex;
- // 设置高度
- align-items: center;
+ flex: 1 1 31%;
+ /* 每个盒子占据大约31%的宽度,留出一些空间用于间距 */
+ min-width: 100px;
+ /* 最小宽度,防止在非常小的屏幕上变得太窄 */
+ box-sizing: border-box;
+ padding: 5px;
+ // border: 1px solid #ccc;
+ display: flex;
+ // 设置高度
+ align-items: center;
}
.box-content-sj img {
- max-width: 60%;
- height: 60px;
+ max-width: 60%;
+ height: 60px;
}
.box-content-ss {
- margin: 0px 0px 0px 10px;
+ margin: 0px 0px 0px 10px;
}
.box-content-text-title,
.box-content-text-content {
- margin-top: 5px;
- font-size: 12px;
- text-align: center;
+ margin-top: 5px;
+ font-size: 12px;
+ text-align: center;
}
.box-content-text-title-span,
.box-content-text-content-span {
- font-weight: bold;
+ font-weight: bold;
}
</style>
\ No newline at end of file
diff --git a/src/views/survey/components/box/fireTrend.vue b/src/views/survey/components/box/fireTrend.vue
index 13d2e60..4c78ed6 100644
--- a/src/views/survey/components/box/fireTrend.vue
+++ b/src/views/survey/components/box/fireTrend.vue
@@ -2,121 +2,119 @@
* @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
+ * @LastEditTime: 2024-11-01 09:41:25
+ * @FilePath: \bigScreen\src\views\survey\components\box\fireTrend.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 { getPage } from '../../../../api/indParkInfo'
+import { getPage } from '@/api/indParkInfo'
let parkQy = ref([])
let searchQuery = ref('')
onMounted(() => {
- getPages()
+ getPages()
})
-function getPages() {
- getPage().then(res => {
- parkQy.value = res.data.data.records
- console.log(res)
- }).catch(err => {
- console.log(err)
- })
+function getPages () {
+ getPage().then(res => {
+ parkQy.value = res.data.data.records
+ console.log(res)
+ }).catch(err => {
+ console.log(err)
+ })
}
-function search() {
- getPage({ name: searchQuery.value }).then(res => {
- parkQy.value = res.data.data.records
- console.log(res)
- }).catch(err => {
- console.log(err)
- })
+function search () {
+ getPage({ name: searchQuery.value }).then(res => {
+ parkQy.value = res.data.data.records
+ console.log(res)
+ }).catch(err => {
+ console.log(err)
+ })
}
</script>
<template>
- <!-- <public-content>
- <template #content> -->
- <div class="box-content">
-
+ <public-content>
+ <template #content>
+ <div class="box-content">
<div>
- <div class="search-container">
- <input type="text" v-model="searchQuery" placeholder="请输入企业名称" class="search-input" />
- <button class="search-button" @click="search">搜索</button>
- </div>
+ <div class="search-container">
+ <input type="text" v-model="searchQuery" placeholder="请输入企业名称" class="search-input" />
+ <button class="search-button" @click="search">搜索</button>
+ </div>
</div>
<div class="data-content-list">
- <div class="data-content-item" v-for="item in parkQy" :key="item.id">
- <div> {{ item.name }}</div>
- <el-button size="small" type="primary">进入园区</el-button>
- </div>
+ <div class="data-content-item" v-for="item in parkQy" :key="item.id">
+ <div> {{ item.name }}</div>
+ <el-button size="small" type="primary">进入园区</el-button>
+ </div>
</div>
- </div>
- <!-- </template>
- </public-content> -->
+ </div>
+ </template>
+ </public-content>
</template>
<style lang="scss" scoped>
.box-content {
- color: #fff;
+ color: #fff;
}
.search-container {
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 10px 0px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin: 10px 0px;
}
.data-content-list {
- height: 50%;
- overflow: scroll;
- // 隐藏滚动条
- scrollbar-width: none;
- text-indent: 1em;
+ height: 50%;
+ overflow: scroll;
+ // 隐藏滚动条
+ scrollbar-width: none;
+ text-indent: 1em;
}
.search-input {
- width: 79%;
- /* 可以根据需要调整宽度 */
- padding: 10px;
- border: 1px solid #ccc;
- border-radius: 4px 0 0 4px;
- outline: none;
+ width: 79%;
+ /* 可以根据需要调整宽度 */
+ padding: 10px;
+ border: 1px solid #ccc;
+ border-radius: 4px 0 0 4px;
+ outline: none;
}
.search-button {
- padding: 10px 20px;
- border: 1px solid #ccc;
- border-radius: 0 4px 4px 0;
- background-color: #007bff;
- color: white;
- cursor: pointer;
- transition: background-color 0.3s;
+ padding: 10px 20px;
+ border: 1px solid #ccc;
+ border-radius: 0 4px 4px 0;
+ background-color: #007bff;
+ color: white;
+ cursor: pointer;
+ transition: background-color 0.3s;
}
.search-button:hover {
- background-color: #0056b3;
+ background-color: #0056b3;
}
.data-content-item {
- display: flex;
- margin: 2px 10px;
- padding: 5px 0;
- background-color: #747bff;
- justify-content: space-between;
- // 超过高度自动显示滚动条
- overflow-y: auto;
- border-radius: 5px;
+ display: flex;
+ margin: 2px 10px;
+ padding: 5px 0;
+ background-color: #747bff;
+ justify-content: space-between;
+ // 超过高度自动显示滚动条
+ overflow-y: auto;
+ border-radius: 5px;
}
</style>
\ No newline at end of file
diff --git a/src/views/survey/components/box/publicContent.vue b/src/views/survey/components/box/publicContent.vue
index c95938c..37f1ccd 100644
--- a/src/views/survey/components/box/publicContent.vue
+++ b/src/views/survey/components/box/publicContent.vue
@@ -2,8 +2,8 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2023-03-13 14:54:26
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-10-25 18:33:46
- * @FilePath: \bigScreen\src\views\statistics\components\box\publicContent.vue
+ * @LastEditTime: 2024-11-01 09:43:11
+ * @FilePath: \bigScreen\src\views\survey\components\box\publicContent.vue
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
@@ -14,7 +14,7 @@
<template>
<div class="content">
- <slot></slot>
+ <slot name="content"></slot>
</div>
</template>
diff --git a/src/views/survey/components/box/unitContent.vue b/src/views/survey/components/box/unitContent.vue
index 47fba66..a0c165e 100644
--- a/src/views/survey/components/box/unitContent.vue
+++ b/src/views/survey/components/box/unitContent.vue
@@ -2,58 +2,59 @@
* @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
+ * @LastEditTime: 2024-11-01 10:08:41
+ * @FilePath: \bigScreen\src\views\survey\components\box\unitContent.vue
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
-->
<script setup>
-// import publicContent from './publicContent.vue'
-
-import { inject } from 'vue'
+import publicContent from './publicContent.vue'
let $echarts = inject('echarts')
+const curEcharts = ref(null)
console.log($echarts)
onMounted(() => {
- let myEcharts = $echarts.init(document.getElementById('unit-content-echarts'))
+ nextTick(() => {
+ let myEcharts = $echarts.init(curEcharts.value)
myEcharts.setOption({
- xAxis: {
- data: ['A', 'B', 'C', 'D', 'E']
- },
- yAxis: {},
- series: [
- {
- type: 'bar',
- data: [10, 22, 28, 43, 49],
- barWidth: '60%'
- }
- ]
+ xAxis: {
+ data: ['A', 'B', 'C', 'D', 'E']
+ },
+ yAxis: {},
+ series: [
+ {
+ type: 'bar',
+ data: [10, 22, 28, 43, 49],
+ barWidth: '60%'
+ }
+ ]
})
+ })
})
</script>
<template>
- <!-- <public-content>
- <template #content> -->
- <div class="unit-content">
- <div class="unit-content-echarts" id="unit-content-echarts">
+ <public-content>
+ <template #content>
+ <div class="unit-content">
+ <div class="unit-content-echarts" ref="curEcharts">
</div>
- </div>
- <!-- </template>
- </public-content> -->
+ </div>
+ </template>
+ </public-content>
</template>
<style lang="scss" scoped>
.unit-content {
- color: #fff;
+ color: #fff;
}
.unit-content-echarts {
- height: 5rem;
+ height: 5rem;
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3