吉安感知网项目-前端
罗广辉
2026-01-31 1731e29ef418bb3b89cd6d514988893f8a870bf7
feat: 地形
5 files modified
7 files deleted
2532 ■■■■■ changed files
applications/task-work-order/env/.env 2 ●●●●● patch | view | raw | blame | history
applications/task-work-order/env/.env.development 2 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/components/PlaybackVideo/PlaybackVideo.vue 141 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/components/PlaybackVideo/components/MapContainer.vue 227 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/components/PlaybackVideo/components/PhotoList.vue 187 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/components/PlaybackVideo/components/VideoPlayer.vue 170 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/components/map-container/mapContainer.vue 172 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/main.js 2 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/router/views/index.js 25 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/utils/cesium/publicCesium.js 80 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/resource/components/spotDetails.vue 955 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/resource/patchManagement.vue 569 ●●●●● patch | view | raw | blame | history
applications/task-work-order/env/.env
@@ -21,3 +21,5 @@
# 预览地址 previewURL
VITE_APP_PREVIEW_URL=http://192.168.1.204:8012
VITE_APP_TERRAIN_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_c_uas/
applications/task-work-order/env/.env.development
@@ -31,8 +31,6 @@
# 航线文件地址
VITE_APP_AIRLINE_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
# 图片存放地址
VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
# 行政区划存放地址
VITE_APP_REGION_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
# 算法仓库图片地址
applications/task-work-order/src/components/PlaybackVideo/PlaybackVideo.vue
File was deleted
applications/task-work-order/src/components/PlaybackVideo/components/MapContainer.vue
File was deleted
applications/task-work-order/src/components/PlaybackVideo/components/PhotoList.vue
File was deleted
applications/task-work-order/src/components/PlaybackVideo/components/VideoPlayer.vue
File was deleted
applications/task-work-order/src/components/map-container/mapContainer.vue
File was deleted
applications/task-work-order/src/main.js
@@ -50,7 +50,6 @@
// 业务组件
import tenantPackage from './views/system/tenantpackage.vue'
// 地图依赖
import mapContainer from './components/map-container/mapContainer.vue'
import * as DC from '@dvgis/dc-sdk'
import '@dvgis/dc-sdk/dist/dc.min.css'
@@ -102,7 +101,6 @@
app.component('thirdRegister', thirdRegister)
app.component('flowDesign', flowDesign)
app.component('tenantPackage', tenantPackage)
app.component('mapContainer', mapContainer)
app.config.globalProperties.$dayjs = dayjs
app.config.globalProperties.website = website
applications/task-work-order/src/router/views/index.js
@@ -134,29 +134,4 @@
      },
    ],
  },
  {
    path: '/resource',
    component: Layout,
    redirect: '/resource/patchManagement',
    children: [
      {
        path: 'patchManagement',
        name: '图斑管理',
        meta: {
          i18n: 'info',
        },
        component: () => import(/* webpackChunkName: "views" */ '@/views/resource/patchManagement.vue'),
      },
      {
        path: 'patchTypeManagement',
        name: '图斑类型管理',
        meta: {
          i18n: 'info',
        },
        component: () => import(/* webpackChunkName: "views" */ '@/views/resource/patchTypeManagement.vue'),
      },
    ],
  },
]
applications/task-work-order/src/utils/cesium/publicCesium.js
@@ -146,52 +146,7 @@
        this.viewer?.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK) // 禁用双击
        if (terrain) {
            try {
                const noTerrainMechanism = ['1962779164650135554']
                if (noTerrainMechanism.includes(store.state.user.userInfo?.deptId)) {
                    // 使用Cesium World Terrain
                    Cesium.createWorldTerrainAsync({
                        requestWaterMask: false,    // 请求水域效果
                        requestVertexNormals: true // 请求光照和地形法线
                    }).then(terrainProvider => {
                        this.viewer.terrainProvider = terrainProvider
                        terrainLoadCallback?.()
                    })
                } else {
                    /*// 正则:第一位非0,第二位任意数字,后10位都是0
                    const re = /^[1-9]\d0{10}$/
                    let result = null
                    // 1️⃣先判断 areaCode
                    if (re.test(store.state.user.userInfo.detail.areaCode)) {
                        result = store.state.user.userInfo.detail.areaCode.slice(0, 6)
                    } else {
                        // 2️⃣如果不满足,从 ancestors 里找
                        const matchedItems = store.state.user.userInfo.detail.ancestors
                            .split(',')
                            .filter(item => re.test(item)) // 过滤出符合条件的
                        // 取第一个符合条件的前6位(可以改成 last one 看需求)
                        if (matchedItems.length > 0) {
                            result = matchedItems[0].slice(0, 6)
                        }
                    }
                    // 使用公司地形
                    Cesium.CesiumTerrainProvider.fromUrl(`${import.meta.env.VITE_APP_TERRAIN_URL}${result}`, {
                        requestVertexNormals: true, // 启用地形法线增强立体感
                        requestWaterMask: true, // 启用水体遮罩效果
                    }).then(terrainProvider => {
                        this.viewer.terrainProvider = terrainProvider
                        terrainLoadCallback?.()
                    })*/
                }
            } catch (error) {
                console.error('地形加载失败:', error)
            }
        }
        this.setTerrainVisible(terrain, terrainLoadCallback)
        this.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 4500000
        this.switchLayers(layerMode)
@@ -205,6 +160,39 @@
            this.viewer.resolutionScale = dpr // 设置分辨率缩放比例
        }
    }
    async ensureTerrainProvider () {
        if (this.terrainProvider) return this.terrainProvider
        if (this.terrainLoading) return this.terrainLoading
        this.terrainLoading = Cesium.CesiumTerrainProvider.fromUrl(
            `${import.meta.env.VITE_APP_TERRAIN_URL}ja_terrain`,
            {
                requestVertexNormals: true, // 启用地形法线增强立体感
                requestWaterMask: true, // 启用水体遮罩效果
            }
        ).then(provider => {
            this.terrainProvider = provider
            return provider
        })
        return this.terrainLoading
    }
    async setTerrainVisible (visible, terrainLoadCallback) {
        if (!this.viewer) return
        if (!visible) {
            this.viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider()
            this.terrainEnabled = false
            return
        }
        try {
            const provider = await this.ensureTerrainProvider()
            if (!this.viewer) return
            this.viewer.terrainProvider = provider
            this.terrainEnabled = true
            terrainLoadCallback?.()
        } catch (error) {
            this.terrainEnabled = false
        }
    }
    getViewer () {
        return this.viewer
applications/task-work-order/src/views/resource/components/spotDetails.vue
File was deleted
applications/task-work-order/src/views/resource/patchManagement.vue
File was deleted