FlightAreaPanel.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div class="flight-area-panel">
  3. <div v-if="data.length === 0">
  4. <a-empty :image-style="{ height: '60px', marginTop: '60px' }" />
  5. </div>
  6. <div v-else v-for="area in flightAreaList" :key="area.area_id">
  7. <FlightAreaItem :data="area" @delete="deleteArea" @update="updateArea" @location="clickLocation(area)" />
  8. </div>
  9. </div>
  10. </template>
  11. <script lang="ts" setup>
  12. import { computed } from 'vue'
  13. import FlightAreaItem from './FlightAreaItem.vue'
  14. import { GetFlightArea } from '/@/api/flight-area'
  15. const emit = defineEmits(['deleteArea', 'updateArea', 'locationArea'])
  16. const props = defineProps<{
  17. data: GetFlightArea[]
  18. }>()
  19. const flightAreaList = computed(() => props.data)
  20. const deleteArea = (areaId: string) => {
  21. emit('deleteArea', areaId)
  22. }
  23. const updateArea = (area: GetFlightArea) => {
  24. emit('updateArea', area)
  25. }
  26. const clickLocation = (area: GetFlightArea) => {
  27. emit('locationArea', area)
  28. }
  29. </script>
  30. <style lang="scss" scoped>
  31. .flight-area-panel {
  32. overflow-y: auto;
  33. height: calc(100vh - 150px);
  34. }
  35. </style>