Merge branch 'master' of http://139.196.74.78:10010/r/jagzwxm/ja_web
14 files modified
1 files renamed
14 files deleted
| | |
| | | <div class="right-container"> |
| | | <div class="header"> |
| | | <span>{{ titleEnum[dialogMode] }}</span> |
| | | |
| | | |
| | | <el-icon class="close-btn" @click.stop="visible = false"><Close /></el-icon> |
| | | </div> |
| | | |
| | |
| | | import { fwDefenseSceneListApi } from '@/views/areaManage/sceneConfig/sceneConfigApi' |
| | | import { fieldRules, geomAnalysis, getDictLabel } from '@ztzf/utils' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { DrawPolygon } from '@/utils/cesium/DrawPolygon' |
| | | import { DrawPolygon } from '@ztzf/utils' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | | import * as turf from '@turf/turf' |
| | | import * as Cesium from 'cesium' |
| | |
| | | <div class="right-container"> |
| | | <div class="header"> |
| | | <span>{{ titleEnum[dialogMode] }}</span> |
| | | |
| | | |
| | | <el-icon class="close-btn" @click.stop="visible = false"><Close /></el-icon> |
| | | </div> |
| | | |
| | |
| | | import { useRoute } from 'vue-router' |
| | | import { fieldRules, geomAnalysis, getDictLabel } from '@ztzf/utils' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { DrawPolygon } from '@/utils/cesium/DrawPolygon' |
| | | import { DrawPolygon } from '@ztzf/utils' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | | import * as turf from '@turf/turf' |
| | | import * as Cesium from 'cesium' |
| | |
| | | |
| | | # 预览地址 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/ |
| | |
| | | # 航线文件地址 |
| | | 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 |
| | | # 算法仓库图片地址 |
| | |
| | | // 业务组件 |
| | | 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' |
| | |
| | | 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 |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | { |
| | | 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'), |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | |
| | | |
| | | 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) |
| | |
| | | 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 |
| | |
| | | <div class="val">{{ formData.reviewOpinion }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | <div v-if=" detailObjectionStatus === '1' && !requesterProvider"> |
| | | <div v-if=" detailObjectionStatus === '1' && permission.orderData_feedback"> |
| | | <div class="detail-title" :style="{ marginTop:pxToRem(20)}">异议反馈</div> |
| | | <el-form ref="feedbackFormRef" class="gd-dialog-form" :model="feedbackFormData" |
| | | :rules="feedbackRules" label-width="140px"> |
| | |
| | | </el-button> |
| | | <el-button class="" color="#4C34FF" :loading="submitting || uploading" :disabled="submitting || uploading" @click="handleApply">申请</el-button> |
| | | </template> |
| | | <template v-if="dialogReadonly && detailObjectionStatus === '1' && !requesterProvider"> |
| | | <template v-if="dialogReadonly && detailObjectionStatus === '1' && permission.orderData_feedback"> |
| | | <el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="visible = false">取消</el-button> |
| | | |
| | | <el-button |
| | |
| | | import { pxToRem } from '@/utils/rem' |
| | | import { useStore } from 'vuex' |
| | | const store = useStore() |
| | | const requesterProvider = computed(() => store.state.user.userInfo?.role_id === '2014158512610869250') |
| | | const permission = computed(() => store.state.user.permission); |
| | | // const requesterProvider = computed(() => store.state.user.userInfo?.role_id === '2014158512610869250') |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | | id:'', |
| | |
| | | }) |
| | | } |
| | | |
| | | export const getDeptTreeListApi = tenantId => { |
| | | return request({ |
| | | url: '/blade-system/dept/tree', |
| | | method: 'get', |
| | | params: { |
| | | tenantId, |
| | | }, |
| | | }); |
| | | }; |
| | |
| | | import { Search, RefreshRight, Plus, Delete } from '@element-plus/icons-vue' |
| | | import { onMounted, ref, provide, nextTick } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { getDeptTree } from '@/api/system/dept' |
| | | import { getDeptTreeListApi } from './dataObjectionApi' |
| | | import { getDictLabel } from '@ztzf/utils' |
| | | import FormDiaLog from './FormDiaLog.vue' |
| | | import { |
| | |
| | | const deptTree = ref([]) // 部门树 |
| | | const dictObj = ref({}) // 字典对象 |
| | | const treeProps = { |
| | | label: 'name', |
| | | label: 'title', |
| | | children: 'children', |
| | | } |
| | | const detailObjectionStatus = ref('') |
| | |
| | | |
| | | // 获取部门树 |
| | | function getDeptTreeFun() { |
| | | getDeptTree().then(res => { |
| | | getDeptTreeListApi().then(res => { |
| | | deptTree.value = res.data.data |
| | | }) |
| | | } |
| | |
| | | <div class="content" style="display: flex"> |
| | | <div class="processBox" v-if="dialogMode !== 'add' && processList.length"> |
| | | <div class="detail-title">工单记录</div> |
| | | <div class="process" > |
| | | <OrderStepBar :processList="processList"/> |
| | | <div class="process"> |
| | | <OrderStepBar :processList="processList" /> |
| | | </div> |
| | | </div> |
| | | <div class="leftBox"> |
| | |
| | | import { gdManageDeviceListApi } from './gdManageDeviceApi' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | | import * as Cesium from 'cesium' |
| | | import { DrawPolygon } from '@/utils/cesium/DrawPolygon' |
| | | import { DrawPolygon } from '@ztzf/utils' |
| | | import { pxToRem } from '@/utils/rem' |
| | | import dayjs from 'dayjs' |
| | | import RefuseOrderDialog from '@/views/orderView/orderManage/orderManage/RefuseOrderDialog.vue' |
| | |
| | | viewPlane = viewer.entities?.add({ |
| | | customType: 'control_group', |
| | | position: Cesium.Cartesian3.fromDegrees(result[0], result[1]), |
| | | polygon: { |
| | | hierarchy: Cesium.Cartesian3.fromDegreesArray(result), |
| | | material: Cesium.Color.fromBytes(45, 140, 240, 99), |
| | | outline: false, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | }, |
| | | polyline: { |
| | | positions: Cesium.Cartesian3.fromDegreesArray(result), |
| | | clampToGround: true, |
| | | width: 3, |
| | | material: Cesium.Color.RED, |
| | | width: 2, |
| | | material: Cesium.Color.fromBytes(45, 140, 240, 255), |
| | | }, |
| | | }) |
| | | flyVisual({ |
| | |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .process{ |
| | | .process { |
| | | height: 100%; |
| | | padding: 12px 16px 24px 16px; |
| | | width: 312px; |
| File was renamed from applications/task-work-order/src/utils/cesium/DrawPolygon.js |
| | |
| | | import * as Cesium from 'cesium' |
| | | import * as turf from '@turf/turf' |
| | | import { boxTransformScale } from '@/utils/turfFunc' |
| | | import { ElMessage } from 'element-plus' |
| | | import { getPointPositionsHeight } from '@/utils/cesium/mapUtil' |
| | | import { flyVisual } from '@ztzf/utils' |
| | | import { flyVisual, getPointPositionsHeight } from './index' |
| | | import { MapTooltip } from './MapTooltip' |
| | | |
| | | /** |
| | | * 多边形绘制与编辑工具类 |
| | |
| | | this.delPoint = this.delPoint.bind(this) |
| | | // 外部订阅者 |
| | | this.listeners = [] |
| | | // 绘制提示 tooltip |
| | | this.drawingTooltip = null |
| | | } |
| | | |
| | | // 实体命名常量 |
| | |
| | | const cartesian = this.viewer.scene.pickPosition(movement.endPosition) |
| | | if (!cartesian) return |
| | | |
| | | // 更新绘制提示 tooltip 位置 |
| | | if (this.drawingMode && this.drawingTooltip) { |
| | | this.drawingTooltip.move(movement.endPosition) |
| | | } |
| | | |
| | | // 编辑模式下,拖拽点实时更新 |
| | | if (this.editingMode && this.draggedEntity?.customData) { |
| | | this.draggedEntity.position = cartesian |
| | |
| | | finishDrawing() { |
| | | this.curPolygon.positions.pop() |
| | | |
| | | // 隐藏绘制提示 |
| | | if (this.drawingTooltip) { |
| | | this.drawingTooltip.hide() |
| | | } |
| | | |
| | | if (this.curPolygon.positions.length >= 3) { |
| | | this.drawingMode = false |
| | | this.editingMode = true |
| | |
| | | this.removeMenuPopup() |
| | | this.notify('getPolygonPositions', []) |
| | | this.startDrawing() |
| | | |
| | | // 重新显示绘制提示 |
| | | if (this.drawingTooltip) { |
| | | this.drawingTooltip.show('左键点击绘制,双击结束绘制') |
| | | } |
| | | } |
| | | // 删除图斑 |
| | | delSpot() { |
| | |
| | | this.addPosition(item, false) |
| | | }) |
| | | |
| | | const boxTransformScale = (data, multiple = 3) => { |
| | | const line = turf.lineString(data) |
| | | const bbox = turf.bbox(line) |
| | | const bboxPolygon = turf.bboxPolygon(bbox) |
| | | const scaledPolygon = turf.transformScale(bboxPolygon, multiple) |
| | | |
| | | return turf.bbox(scaledPolygon) |
| | | } |
| | | |
| | | // 视角飞入区域 |
| | | const newBox = boxTransformScale( |
| | | positions.map(item => [item.lng, item.lat]), |
| | |
| | | initHandler(viewer) { |
| | | this.viewer = viewer |
| | | this.startDrawing() |
| | | |
| | | // 初始化绘制提示 tooltip |
| | | if (!this.drawingTooltip) { |
| | | this.drawingTooltip = new MapTooltip(viewer) |
| | | this.drawingTooltip.show('左键点击绘制,双击结束绘制') |
| | | } |
| | | |
| | | if (!this.handler) { |
| | | this.handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas) |
| | |
| | | this.removeEntities() |
| | | this.removeHandler() |
| | | this.enableMapControl() |
| | | |
| | | // 销毁绘制提示 tooltip |
| | | if (this.drawingTooltip) { |
| | | this.drawingTooltip.destroy() |
| | | this.drawingTooltip = null |
| | | } |
| | | } |
| | | } |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from './MapTooltip' |
| | | import { DrawPolygon } from './DrawPolygon' |
| | | /** |
| | | * 飞到中心点并且所有点在可视范围 |
| | | * @param positionsData 二维数组,每项为 [lon, lat] 或 三维数组 [lon, lat, height] |
| | |
| | | }) |
| | | } |
| | | |
| | | export { MapTooltip, flyVisual } |
| | | // 批量获取点数组经纬度对应高度信息 |
| | | const getPointPositionsHeight = (data, viewer, droneHeight = null) => { |
| | | return new Promise((resolve, reject) => { |
| | | if (!data || !data.length) { |
| | | resolve([]) |
| | | return |
| | | } |
| | | // 假设 viewer 已经初始化并且 terrainProvider 是有效的 |
| | | const terrainProvider = viewer?.terrainProvider |
| | | // 创建 Cartographic 对象 |
| | | const cartographics = data.map(item => { |
| | | const { lng, lat } = item |
| | | return Cesium.Cartographic.fromDegrees(Number(lng), Number(lat)) |
| | | }) |
| | | // 获取地形数据的Promise |
| | | const promise = Cesium.sampleTerrainMostDetailed(terrainProvider, cartographics) |
| | | // 使用 Cesium.when 处理 Promise |
| | | promise |
| | | .then(function (updatedPositions) { |
| | | // 是一个数组,包含更新后的 Cartographic 对象 |
| | | const newPosition = updatedPositions.map((item, index) => { |
| | | const longitude = Cesium.Math.toDegrees(item.longitude) |
| | | const latitude = Cesium.Math.toDegrees(item.latitude) |
| | | let pointData = { |
| | | ...data[index], |
| | | longitude, |
| | | latitude, |
| | | ASL: Number(item.height), |
| | | customHeight: Number(item.height), |
| | | } |
| | | if (droneHeight) pointData.TH = Number(item.height) + Number(droneHeight) |
| | | return pointData |
| | | }) |
| | | resolve(newPosition) |
| | | }) |
| | | .catch(function (error) { |
| | | console.log('获取高程时发生错误:', error) |
| | | resolve(data.map(item => ({ ...item, ASL: 0, customHeight: 0, longitude: item.lng, latitude: item.lat }))) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | export { MapTooltip, flyVisual, getPointPositionsHeight, DrawPolygon } |
| | |
| | | { |
| | | "name": "@ztzf/utils", |
| | | "version": "1.0.0", |
| | | "private": true, |
| | | "description": "工具类", |
| | | "main": "index.js", |
| | | "license": "ISC", |
| | | "peerDependencies": { |
| | | "cesium": "catalog:", |
| | | "dayjs": "catalog:", |
| | | "decimal.js": "catalog:" |
| | | }, |
| | | "devDependencies": { |
| | | "cesium": "catalog:", |
| | | "dayjs": "catalog:", |
| | | "decimal.js": "catalog:" |
| | | } |
| | | "name": "@ztzf/utils", |
| | | "version": "1.0.0", |
| | | "private": true, |
| | | "description": "工具类", |
| | | "main": "index.js", |
| | | "license": "ISC", |
| | | "peerDependencies": { |
| | | "@turf/turf": "catalog:", |
| | | "cesium": "catalog:", |
| | | "dayjs": "catalog:", |
| | | "decimal.js": "catalog:", |
| | | "element-plus": "catalog:" |
| | | }, |
| | | "devDependencies": { |
| | | "@turf/turf": "catalog:", |
| | | "cesium": "catalog:", |
| | | "dayjs": "catalog:", |
| | | "decimal.js": "catalog:", |
| | | "element-plus": "catalog:" |
| | | } |
| | | } |
| | |
| | | |
| | | packages/utils: |
| | | devDependencies: |
| | | '@turf/turf': |
| | | specifier: 'catalog:' |
| | | version: 6.5.0 |
| | | '@ztzf/utils': |
| | | specifier: workspace:* |
| | | version: 'link:' |
| | | cesium: |
| | | specifier: 'catalog:' |
| | | version: 1.126.0 |
| | |
| | | decimal.js: |
| | | specifier: 'catalog:' |
| | | version: 10.6.0 |
| | | element-plus: |
| | | specifier: 'catalog:' |
| | | version: 2.9.11(vue@3.5.27(typescript@5.9.3)) |
| | | |
| | | uniapps/work-app: |
| | | dependencies: |