智慧园区前端大屏
shuishen
2024-11-04 561e2e7598e34bc17ad72a659829dc78b706f99b
src/views/survey/components/box/fireSource.vue
@@ -1,23 +1,24 @@
<script setup>
import { Text } from 'vue';
import { Text } from 'vue'
import publicContent from './publicContent.vue'
const { VITE_APP_BASE } = import.meta.env
import { getDetail } from '@/api/indParkInfo'
import { getAssetsFile } from 'utils/utils'
let state = reactive({
  parkInfo: {}
})
// 企业信息统计数组
let parkInfoList = ref([
let parkInfoList = reactive([
  {
    id: 1,
    name: 'plaArea',
    title: '园区面积',
    content: '1000',
    unit: '公顷',
    img: 'images/雨量站@2x.png'
    img: getAssetsFile('yq-mj.png', '/bgicon')
  },
  {
    id: 2,
@@ -25,7 +26,7 @@
    title: '救援人员数量',
    content: '1000',
    unit: '人',
    img: 'images/雨量站@2x.png'
    img: getAssetsFile('yq-jy.png', '/bgicon')
  },
  {
@@ -33,34 +34,31 @@
    name: 'riskFirmNum',
    title: '风险企业数量',
    content: '1000',
    img: 'images/雨量站@2x.png'
    img: getAssetsFile('yq-fx.png', '/bgicon')
  },
  {
    id: 4,
    name: 'proTarNum',
    title: '保护目标数量',
    content: '1000',
    img: 'images/雨量站@2x.png'
    img: getAssetsFile('yq-bh.png', '/bgicon')
  },
  {
    id: 5,
    name: 'spaceNum',
    title: '应急空间数量',
    content: '1000',
    img: 'images/雨量站@2x.png'
    img: getAssetsFile('yq-yj.png', '/bgicon')
  },
  {
    id: 6,
    name: 'firmNum',
    title: '企业数量',
    content: '1000',
    img: 'images/雨量站@2x.png'
    img: getAssetsFile('yq-qy.png', '/bgicon')
  }
]
)
// 初始化
onMounted(() => {
@@ -68,10 +66,10 @@
})
// 获取详情
function getData() {
function getData () {
  getDetail().then(res => {
    state.parkInfo = res.data.data
    parkInfoList.value.forEach(item => {
    parkInfoList.forEach(item => {
      if (item.name == 'plaArea') {
        state.parkInfo[item.name] && (item.content = (state.parkInfo[item.name] * 100).toFixed(2))
      } else {
@@ -102,7 +100,7 @@
        <div class="container">
          <div class="box-content-sj" v-for="item in parkInfoList" :key="item.id">
            <img :src="VITE_APP_BASE + item.img" alt="">
            <img :src="item.img" alt="">
            <div>
              <div class="box-content-ss">
                <div>
@@ -138,9 +136,8 @@
.box-content-img {
  height: 300px;
  overflow: scroll;
  // 隐藏滚动条
  scrollbar-width: none;
  overflow-x: hidden;
  overflow-y: auto;
}
.box-content-img img {
@@ -185,8 +182,9 @@
}
.box-content-sj img {
  max-width: 60%;
  height: 60px;
  width: 36px;
  height: 36px;
  vertical-align: middle;
}
.box-content-ss {