吉安感知网项目-前端
罗广辉
2026-01-06 ffdb6ca4eee1ae699d7b7f4e93830eeb34e4305d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template>
    <div class="wrapper" :style="{ paddingTop: route.query.topMargin + 'px' }">
        <WorkMap
            :weatherShow="true"
            :layerShow="true"
            :locationShow="true"
            :workNavigationShow="true"
            :mapCurrentDetail="mapCurrentDetail"
        >
            <template #eventNav>
                <EventNavigation :mapCurrentDetail="mapCurrentDetail"></EventNavigation>
            </template>
        </WorkMap>
    </div>
</template>
 
<script setup>
import { getDeviceRegion } from '@/api/home/aggregation'
import WorkMap from '@/appComponents/workMap/index.vue'
import EventNavigation from '@/appPages/work/workDetail/mapWork/eventNavigation.vue'
import { useRoute } from 'vue-router'
import { showToast } from 'vant'
import { getList } from '/src/api/work/index.js'
import { useStore } from 'vuex'
const store = useStore()
const userInfo = computed(() => store?.state?.user?.userInfo)
const route = useRoute()
const mapCurrentDetail = ref({})
const eventNum = ref('')
// 机巢数据
let machineData = ref([]);
// 机巢数据
const handleNodeClick = async data => {
  const droneList = await getDeviceRegion({ areaCode: userInfo.value.detail.areaCode });
  machineData.value = droneList?.data?.data;
};
const getDataList = async val => {
    const params = {
        current: 1,
        size: 9999,
        source: 1,
        event_name: val,
    }
    const res = await getList(params)
    const response = res.data.data.records
  const matchedMachine = machineData.value.find(m => m.device_sn === response[0].device_sn);
  const deviceNickname = matchedMachine?.nickname || ''
    mapCurrentDetail.value = {
        ...response[0],
        processingDetail: response[0].processing_details,
        update_photo_url: response[0].update_photo_url,
        aiType: response[0].ai_type_key_list?.join(',') || '',
    device_names:deviceNickname ? deviceNickname :''
    }
}
onMounted(async () => {
  handleNodeClick()
    eventNum.value = route.query.currentItem
    await getDataList(eventNum.value)
})
</script>
 
<style lang="scss" scoped>
.wrapper {
    width: 100%;
    height: 100%;
}
</style>