Merge remote-tracking branch 'origin/master'
| | |
| | | watch( |
| | | () => mapCurrentDetail, |
| | | newVal => { |
| | | const newDataMap=JSON.parse(newVal) |
| | | // 只有 workNavigationShow 为 true 且有经纬度时才添加标记 |
| | | if (workNavigationShow && newVal?.longitude && newVal?.latitude) { |
| | | addIncidentMarker(newVal) |
| | | mapCurrentDetailData.value = newVal |
| | | if (workNavigationShow && newDataMap?.longitude && newDataMap?.latitude) { |
| | | addIncidentMarker(newDataMap) |
| | | mapCurrentDetailData.value = newDataMap |
| | | } else if (!workNavigationShow && incidentMarker) { |
| | | // 当 workNavigationShow 变为 false 时,移除已添加的标记 |
| | | markersLayer.removeLayer(incidentMarker) |
| | |
| | | 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) |
| | | mapCurrentDetail.value = eventNum.value |
| | | |
| | | }) |
| | | </script> |
| | | |
| | |
| | | data:{"size":100,"current":1}, |
| | | }) |
| | | } |
| | | |
| | | // 获取飞手信息 |
| | | export const deviceFlyerApi = (data) => { |
| | | return request({ |
| | | url: `/deviceFlyer/deviceFlyer/queryList`, |
| | | method: 'post', |
| | | data: data, |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | }) |
| | | // 跳转地图 |
| | | const jumpMap = item => { |
| | | const contactStr = encodeURIComponent(JSON.stringify(item)) |
| | | uni.navigateTo({ |
| | | url: `/subPackages/workDetail/mapWork/index?eventNum=${item.event_num}`, |
| | | url: `/subPackages/workDetail/mapWork/index?eventNum=${contactStr}`, |
| | | }) |
| | | } |
| | | // 退回 |