吉安感知网项目-前端
shuishen
2026-01-26 38e3bb79544ed4a18fb61b892d4832cafc83c211
applications/mobile-web-view/src/appPages/work/workDetail/mapWork/index.vue
@@ -7,56 +7,22 @@
         :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)
mapCurrentDetail.value = JSON.parse(decodeURIComponent(route.query.currentItem))
})
</script>