<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>
|