智慧园区前端大屏
shuishen
2024-11-15 7f8b859123f0ed0b7585987d56acf6d835085cc0
src/views/pac/components/box/dataContent.vue
@@ -11,30 +11,36 @@
<script setup>
import { getList } from "@/api/space/space"
import { onUnmounted, reactive } from 'vue'
import { usePointStore } from 'store/usepoint'
const pointStore = usePointStore()
const resData = reactive({
    data: [{
        label: '一级防控',
        value: '1',
        type: 1,
        remark: '防火提及配套设置、装置围堰、罐区围堰'
        // remark: '防火提及配套设置、装置围堰、罐区围堰'
    }, {
        label: '二级防控',
        value: '2',
        type: 1,
        remark: '雨污水排口一体化闸阀、车间收集池、雨污管阀'
        type: 2,
        // remark: '雨污水排口一体化闸阀、车间收集池、雨污管阀'
    },
    {
        label: '三级防控',
        value: '3',
        type: 1,
        remark: '事故应急池、雨水收集池'
        type: 3,
        // remark: '事故应急池、雨水收集池'
    }
    ]
})
const curSelect = ref('1')
let addTileLayers = {}
const handleCheckChange = (row) => {
    console.log(row)
    // console.log(row)
    resData.data.forEach(item => {
        if (row.value === item.value) {
            if (!addTileLayers[item.label]) {
@@ -58,7 +64,7 @@
                            }
                        } else {
                            iconEl = `<div class="marsBlueGradientPnl">
                                 <div>${item.remark}</div>  </div>`
                                 <div>${i.name}</div>  </div>`
                        }
                        let divIcon = new DC.DivIcon(
                            new DC.Position(i.lng, i.lat, 0),
@@ -66,9 +72,7 @@
                    ${iconEl}
                  </div>`
                        )
                        divIcon.attrParams = i
                        let incident = () => { }
                        if (item.incident) incident = item.incident
@@ -91,6 +95,7 @@
const tabClick = (item) => {
    handleCheckChange(item)
    pointStore.updateSharedData(item.type)
    curSelect.value = item.value
}
@@ -103,15 +108,18 @@
})
onMounted(() => {
    curSelect.value = '1'
    pointStore.updateSharedData(1)
    tabClick(resData.data[0])
}),
    onUnmounted(() => {
        let arr = Object.keys(addTileLayers)
        arr.forEach(i => {
            addTileLayers[i] && window.$viewer.removeLayer(addTileLayers[i])
        })
})
onUnmounted(() => {
    let arr = Object.keys(addTileLayers)
    arr.forEach(i => {
        addTileLayers[i] && window.$viewer && window.$viewer.removeLayer(addTileLayers[i])
    })
})
</script>
<template>