husq
2023-09-13 8dacad04d05230e64ddfbf2c9757eecca7c61589
src/pages/page-web/projects/wayline.vue
@@ -96,6 +96,11 @@
import { load } from '@amap/amap-jsapi-loader'
import { getRoot } from '/@/root'
import * as Cesium from 'cesium'
const { appContext } = getCurrentInstance()
const global = appContext.config.globalProperties
const loading = ref(false)
const store = useMyStore()
const projectId = store.state.common.projectId
@@ -138,17 +143,18 @@
    return
  }
  canRefresh.value = false
  getWaylineFiles(workspaceId, {
    page: pagination.page,
    page_size: pagination.page_size,
    order_by: 'update_time desc'
  getWaylineFiles({
    workspaceId: projectId,
  }).then(res => {
    if (res.code !== 0) {
    console.log(res, '+++++++++++++++++++++++++++++++++++++')
    if (res.code !== 5000) {
      return
    }
    waylinesData.data = [...waylinesData.data, ...res.data.list]
    pagination.total = res.data.pagination.total
    pagination.page = res.data.pagination.page
    const data = res.data
    waylinesData.data = [...waylinesData.data, ...data]
  }).finally(() => {
    canRefresh.value = true
  })
@@ -187,7 +193,22 @@
}
function selectRoute (wayline: WaylineFile) {
  store.commit('SET_SELECT_WAYLINE_INFO', wayline)
  console.log(global, '+++++++++++')
  const options = {
    camera: global.$viewer.scene.camera,
    canvas: global.$viewer.scene.canvas,
    screenOverlayContainer: global.$viewer.container,
  }
  global.$viewer.dataSources.add(
    Cesium.KmlDataSource.load(
      '/src/assets/kmz/test.kmz',
      options
    )).then(res => {
    console.log(res, '+++++++++++++++++++')
  })
  // store.commit('SET_SELECT_WAYLINE_INFO', wayline)
}
function onScroll (e: any) {