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