diff --git a/src/main/index.ts b/src/main/index.ts index 69fd92b..69738f8 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -195,6 +195,7 @@ function createWindow(): void { }); }); // 监听渲染进程创建新窗口的请求 + // @ts-ignore ipcMain.handle('create-new-window', async (event, params, url, option) => { try { const newWindow = await new BrowserWindow(params) diff --git a/src/renderer/public/sdk/custom/css/index.css b/src/renderer/public/sdk/custom/css/index.css index 37d4333..13c193a 100644 --- a/src/renderer/public/sdk/custom/css/index.css +++ b/src/renderer/public/sdk/custom/css/index.css @@ -899,14 +899,14 @@ .fly-roam>.content .table .tr .th:first-child, .fly-roam>.content .table .tr .td:first-child { - flex: 0 0 95px; - width: 95px; + flex: 0 0 70px; + width: 70px; } .fly-roam>.content .table .tr .th:nth-child(2), .fly-roam>.content .table .tr .td:nth-child(2) { - flex: 0 0 240px; - width: 240px; + flex: 0 0 100px; + width: 100px; } .fly-roam>.content .table .tr .th:last-child, diff --git a/src/renderer/src/I18n/zh-CN.ts b/src/renderer/src/I18n/zh-CN.ts index 59dc626..e4dea9b 100644 --- a/src/renderer/src/I18n/zh-CN.ts +++ b/src/renderer/src/I18n/zh-CN.ts @@ -1,3 +1,5 @@ +import { title } from "process"; + export default { week: { 0: '星期日', @@ -163,7 +165,9 @@ export default { authTime: '授权时间', authCode: '授权码', upload: '授权导入', - authexpire: '授权过期' + authexpire: '授权过期', + authTempExpire: '授权正常', + noAuthexpire: '暂未授权', }, systemSetting: { setLanguage: '语言设置', @@ -188,6 +192,7 @@ export default { areaUnit: '面积单位', heightUnit: '高度单位', speedUnit: '速度单位', + administrativeArea: '行政区划', skinList: { yingguangse: '荧光色', gonganlan: '科技蓝', @@ -205,5 +210,9 @@ export default { versions: { version_code: '版本号', version_update: '检查更新' + }, + model: { + title: '模型选择', + setting: '默认模型参数设置' } } diff --git a/src/renderer/src/api/route/index.ts b/src/renderer/src/api/route/index.ts new file mode 100644 index 0000000..09a8140 --- /dev/null +++ b/src/renderer/src/api/route/index.ts @@ -0,0 +1,25 @@ +//路径规划 +import request from '@/axios/request' +export const RouteApi = { + // 查看路径 + queryRoute: async (data: any) => { + return await request.post({ + url: `/graphhopper/route`, + data + }); + }, + //获取地图列表 + getRouteList: async () => { + return await request.get({ + url: `/graphhopper/list` + }) + }, + //加载路网数据 + loadRoute: async (data: any) => { + return await request.post({ + url: `/graphhopper/loadMap`, + data, + headersType: 'application/x-www-form-urlencoded' + }) + }, +} diff --git a/src/renderer/src/assets/i18n/lang/local_zh.js b/src/renderer/src/assets/i18n/lang/local_zh.js index 25e986d..794ca02 100644 --- a/src/renderer/src/assets/i18n/lang/local_zh.js +++ b/src/renderer/src/assets/i18n/lang/local_zh.js @@ -1,335 +1,330 @@ // productName -let obj = require("../../../../../config/app_config"); -console.log(obj); +let obj = require('../../../../../config/app_config') +console.log(obj) module.exports = { title: { - name: obj.productName, //"实景三维数字孪生系统" + name: obj.productName //"实景三维数字孪生系统" }, login: { - signIn: "登录", + signIn: '登录' }, dashboard: { - langLable: "中文简体", + langLable: '中文简体' }, leftMenu: { firstMenu: { - measure: "测量库", - tool: "工具库", - effect: "特效库", - bigData: "大数据", - modelLibrary: "模型库", - situation: "方案库", - onlinePictureSource: "在线图源", - analysis: "分析库", - militaryMark: "军标库", - ersanwei: "二三维", - junbiao3d: "三维军标", + measure: '测量库', + tool: '工具库', + effect: '特效库', + bigData: '大数据', + modelLibrary: '模型库', + situation: '方案库', + onlinePictureSource: '在线图源', + analysis: '分析库', + militaryMark: '军标库', + ersanwei: '二三维', + junbiao3d: '三维军标' }, secondMenu: { //模型库 - imports: "导入", + imports: '导入', // 测量二级菜单 - projectionArea: "投影面积", - areaMeasure: "贴地面积", - distanceMeasure: "贴地距离", - heightMeasure: "垂直高度", - triangleMeasure: "空间三角", - coorMeasure: "坐标", - MeasureAngle: "夹角", - clearMeasure: "清除测量", - MeasureAzimuth: "方位角", - lopeDistanceMeasures: "坡度", - projectionDistanceMeasure: "投影距离", - clear: "清除", + projectionArea: '投影面积', + areaMeasure: '贴地面积', + distanceMeasure: '贴地距离', + heightMeasure: '垂直高度', + triangleMeasure: '空间三角', + coorMeasure: '坐标', + MeasureAngle: '夹角', + clearMeasure: '清除测量', + MeasureAzimuth: '方位角', + lopeDistanceMeasures: '坡度', + projectionDistanceMeasure: '投影距离', + clear: '清除', // 工具二级菜单 - BIMEdit: "BIM编辑", - goodsSearch: "物资统计", - goodsSearchPolgon: "多边形统计", - goodsSearchCircle: "圆形统计", - rangeQuery: "范围查询", - floodSimulation: "淹没模拟", - clearQuery: "清除查询", - destoryRecord: "结束录制", - graffiti: "涂鸦", - stopGraffiti: "结束涂鸦", - clearGraffiti: "清除涂鸦", - HDScreen: "屏幕截图", - HDScreenHD: "高清出图", - areaScreen: "范围截图", - coorLocation: "坐标定位", - perspective: "透视", - Intervisibility: "视线分析", - transform: "模型转换", - videoRecording: "视频录制", - routePlan: "路径规划", - tilesetClipping: "剖切", - clearTilesetClipping: "清除剖切", - pressModel: "模型压平", - terrainDig: "地形开挖", - splitScreen: "卷帘对比", + BIMEdit: 'BIM编辑', + goodsSearch: '物资统计', + goodsSearchPolgon: '多边形统计', + goodsSearchCircle: '圆形统计', + rangeQuery: '范围查询', + floodSimulation: '淹没模拟', + clearQuery: '清除查询', + destoryRecord: '结束录制', + graffiti: '涂鸦', + stopGraffiti: '结束涂鸦', + clearGraffiti: '清除涂鸦', + HDScreen: '屏幕截图', + HDScreenHD: '高清出图', + areaScreen: '范围截图', + coorLocation: '坐标定位', + perspective: '透视', + Intervisibility: '视线分析', + transform: '模型转换', + videoRecording: '视频录制', + routePlan: '路径规划', + tilesetClipping: '剖切', + clearTilesetClipping: '清除剖切', + pressModel: '模型压平', + terrainDig: '地形开挖', + splitScreen: '卷帘对比', - path: "飞行漫游", - annotationAggregation: "标注点聚合", - mouseLocation: "鼠标定位", - mouseOver: "结束定位", - importImg: "全景关联", - gdbImport: "gdb导入", - projConvert: "度分秒", - projectionConvert: "投影转换", - peopleRoomLink: "人房关联", + path: '飞行漫游', + annotationAggregation: '标注点聚合', + mouseLocation: '鼠标定位', + mouseOver: '结束定位', + importImg: '全景关联', + gdbImport: 'gdb导入', + projConvert: '度分秒', + projectionConvert: '投影转换', + peopleRoomLink: '人房关联', // 特效库二级菜单 - fire: "火焰", - smoke: "烟雾", - explosion: "爆炸", - waterSurface: "水面", - radarLightWave: "扩散光波", - diffusedLightWave: "雷达光波", - scanStereoscopic: "立体雷达", - electronicFence: "电子围墙", - entityWall: "实体墙", - multilateralBody: "多边体", - cube: "立方体", - trajectoryMotion: "轨迹运动", - clearTrajectoryMotion: "清除轨迹", - roadDraw: "道路绘制", - lineDraw: "线路绘制", - rain: "雨", - snow: "雪", - fog: "雾", - nightVision: "夜视", - skystarry: "星空", - illumination: "光照", - light: "光照", - heatMap: "热力图", - fountain: "喷泉", - waterL: "喷射水柱", - flyLine:"飞线", + fire: '火焰', + smoke: '烟雾', + explosion: '爆炸', + waterSurface: '水面', + radarLightWave: '扩散光波', + diffusedLightWave: '雷达光波', + scanStereoscopic: '立体雷达', + electronicFence: '电子围墙', + entityWall: '实体墙', + multilateralBody: '多边体', + cube: '立方体', + trajectoryMotion: '轨迹运动', + clearTrajectoryMotion: '清除轨迹', + roadDraw: '道路绘制', + lineDraw: '线路绘制', + rain: '雨', + snow: '雪', + fog: '雾', + nightVision: '夜视', + skystarry: '星空', + illumination: '光照', + light: '光照', + heatMap: '热力图', + fountain: '喷泉', + waterL: '喷射水柱', + flyLine: '飞线', // 分析二级菜单 - inundationAnalysis: "淹没分析", - visualFieldAnalysis: "视域分析", - visualFieldAnalysis2: "圆形视域", - profileAnalysis: "剖面分析", - cutFill: "土方分析", - slopeDirection: "坡度坡向", - contour: "等高线", - qcontour:'全局等高线', - pictureLocation: "照片定位", - importPanorama: "全景导入", - }, + inundationAnalysis: '淹没分析', + visualFieldAnalysis: '视域分析', + visualFieldAnalysis2: '圆形视域', + profileAnalysis: '剖面分析', + cutFill: '土方分析', + slopeDirection: '坡度坡向', + contour: '等高线', + qcontour: '全局等高线', + pictureLocation: '照片定位', + importPanorama: '全景导入', + clearAnalysis: '清除' + } }, bottomMenu: { - groundText: "贴地文字", - standText: "立体文字", - point: "点", - line: "线", - curve: "曲线", - panel: "面", - ellipse: "椭圆", - sector: "扇形", - circle: "圆", - attackArrow: "箭头", - pincerArrow: "双箭头", - assemble: "集结地", - rect: "矩形", - unLock: "锁定", - Lock: "解锁", + groundText: '贴地文字', + standText: '立体文字', + point: '点', + line: '线', + curve: '曲线', + panel: '面', + ellipse: '椭圆', + sector: '扇形', + circle: '圆', + attackArrow: '箭头', + pincerArrow: '双箭头', + assemble: '集结地', + rect: '矩形', + unLock: '锁定', + Lock: '解锁' }, headerTitles: { //顶部抬头以及系统设置页面文字汉语翻译 - systemTitle: "系统设置", - udp: "物理沙盘", - ConcurrencyControl: "并发量控制", - localIP: "本地IP", - localPort: "本地端口", - remoteIP: "远程IP", - remotePort: "远程端口", - weather: "天气", - week: [ - "星期日", - "星期一", - "星期二", - "星期三", - "星期四", - "星期五", - "星期六", - ], + systemTitle: '系统设置', + udp: '物理沙盘', + ConcurrencyControl: '并发量控制', + localIP: '本地IP', + localPort: '本地端口', + remoteIP: '远程IP', + remotePort: '远程端口', + weather: '天气', + week: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], equipment: { - title: "设备管理", - addEquipment: "添加设备", - downloadEquipment: "下载模板", - bulkImport: "批量导入", + title: '设备管理', + addEquipment: '添加设备', + downloadEquipment: '下载模板', + bulkImport: '批量导入' }, // 无人机 air: { - title: "无人机管理", - addAir: "添加无人机", - downloadAir: "下载模板", + title: '无人机管理', + addAir: '添加无人机', + downloadAir: '下载模板' }, // 0827 isc: { - title: "ISC平台", - url: "平台地址", - setInfo: "设置平台信息", - updateEquipment: "更新平台设备", + title: 'ISC平台', + url: '平台地址', + setInfo: '设置平台信息', + updateEquipment: '更新平台设备' }, iconTitle: { - reset: "默认视角", - fullScreen: "全屏", - set: "设置", - shrink: "退出全屏", - logout: "退出登录", - locate: "北斗定位", - air: "无人机", - excel: "Excel", + reset: '默认视角', + fullScreen: '全屏', + set: '设置', + shrink: '退出全屏', + logout: '退出登录', + locate: '北斗定位', + air: '无人机', + excel: 'Excel' }, - auth: "授权信息", - Engineering: "工程信息", - Hikang: "海康平台", - Version: "版本信息", - Theme: "系统设置", - Satellite: "卫星定位", + auth: '授权信息', + Engineering: '工程信息', + Hikang: '海康平台', + Version: '版本信息', + Theme: '系统设置', + Satellite: '卫星定位', searchWay: { - title: "搜索方式", + title: '搜索方式', searchWayList: { - poi: "离线搜索", - net: "在线搜索", - }, + poi: '离线搜索', + net: '在线搜索' + } }, - Service: "服务接入", - confirm: "确认", + Service: '服务接入', + confirm: '确认', auths: { - authType: "授权状态", - authTime: "授权时间", - authCode: "授权码", - upload: "授权导入", - authexpire: "授权过期", + authType: '授权状态', + authTime: '授权时间', + authCode: '授权码', + upload: '授权导入', + authexpire: '授权过期', + authTempExpire: '授权正常', + noAuthexpire: '暂未授权' }, service: { - offline: "离线服务", - official: "官方服务", - customize: "自定义", + offline: '离线服务', + official: '官方服务', + customize: '自定义', agreements: { - Agreement: "协议", - setAgreement: "协议设置", - port: "端口", - location: "地址", - }, + Agreement: '协议', + setAgreement: '协议设置', + port: '端口', + location: '地址' + } }, Engineerings: { - import: "路网导入", - cover: "覆盖", - increase: "增加", - importProject: "工程覆盖导入", - consolidated: "工程合并导入", - derive: "工程导出", - importPOI: "POI导入", + import: '路网导入', + cover: '覆盖', + increase: '增加', + importProject: '工程覆盖导入', + consolidated: '工程合并导入', + derive: '工程导出', + importPOI: 'POI导入' }, Hikangs: { - enable: "启用", + enable: '启用' }, versions: { - version_code: "版本号", - version_update: "检查更新", + version_code: '版本号', + version_update: '检查更新' }, systemSetting: { - setLanguage: "语言设置", - theme: "主题换肤", - defaultView: "设置默认视角", - defaultData: "添加在线数据", - management: "后台管理", - showCompass: "导航器", - showLatitudeLongitudeNetwork: "经纬网", - showFangliNet: "方里网", - showDistanceLegend: "比例尺", - showToolBar: "信息栏", - showFPS: "刷新率", - showMapX: "鹰眼图", - occlusion: "地形遮挡", - coordinateSystem: "系统坐标系", - sheetIndexStatusSwitch: "标准图幅", - switch: "切换", - battery: "电池信息", + setLanguage: '语言设置', + theme: '主题换肤', + defaultView: '设置默认视角', + defaultData: '添加在线数据', + management: '后台管理', + showCompass: '导航器', + showLatitudeLongitudeNetwork: '经纬网', + showFangliNet: '方里网', + showDistanceLegend: '比例尺', + showToolBar: '信息栏', + showFPS: '刷新率', + showMapX: '鹰眼图', + occlusion: '地形遮挡', + coordinateSystem: '系统坐标系', + sheetIndexStatusSwitch: '标准图幅', + switch: '切换', + battery: '电池信息', skinList: { - yingguangse: "荧光色", - gonganlan: "科技蓝", - hong: "烈日红", - }, + yingguangse: '荧光色', + gonganlan: '科技蓝', + hong: '烈日红' + } }, model: { - title: "模型管理", - createModelLibrary: "创建模型库", - selectModelLibrary: "选择模型库", - addModelType: "添加模型类型", - importModel: "导入模型", - updatePoster: "更换缩略图", - preview: "预览", - updateModel: "更换模型", - deleteModel: "删除", - editModel: "编辑", + title: '模型管理', + createModelLibrary: '创建模型库', + selectModelLibrary: '选择模型库', + addModelType: '添加模型类型', + importModel: '导入模型', + updatePoster: '更换缩略图', + preview: '预览', + updateModel: '更换模型', + deleteModel: '删除', + editModel: '编辑' }, graphLabel: { - title: "军标管理", - createGraphLabelLibrary: "创建军标库", - selectGraphLabelLibrary: "选择军标库", - addGraphLabelType: "添加军标类型", - importGraphLabel: "导入军标", - edit: "编辑", - delete: "删除", - importGraph: "导入军标", - addLine: "添加线", - addPanel: "添加面", - addCircle: "添加圆", + title: '军标管理', + createGraphLabelLibrary: '创建军标库', + selectGraphLabelLibrary: '选择军标库', + addGraphLabelType: '添加军标类型', + importGraphLabel: '导入军标', + edit: '编辑', + delete: '删除', + importGraph: '导入军标', + addLine: '添加线', + addPanel: '添加面', + addCircle: '添加圆' }, user: { - title: "用户管理", - deleteUser: "删除", - createUser: "创建用户", - importUser: "导入用户", - role: "权限管理", - deleteRole: "删除", - createRole: "创建角色", - depart: "部门管理", - createDepart: "创建部门", - deleteDepart: "删除部门", - editDepart: "修改部门", + title: '用户管理', + deleteUser: '删除', + createUser: '创建用户', + importUser: '导入用户', + role: '权限管理', + deleteRole: '删除', + createRole: '创建角色', + depart: '部门管理', + createDepart: '创建部门', + deleteDepart: '删除部门', + editDepart: '修改部门' }, terrain: { - terrainSetting: "地形设置", - }, + terrainSetting: '地形设置' + } }, rightMenu: { - addDirectory: "添加文件夹", - addResource: "添加地图数据", - pictureLocation: "带定位照片", - importPanorama: "带定位全景", - addBIM: "添加BIM", - edit: "编辑节点", - del: "删除节点", - setView: "设置视角", - resetView: "重置视角", - layerRaise: "图层上移", - layerLower: "图层下移", - layerToTop: "图层置顶", - layerToBottom: "图层置底", - tilesetClipping: "剖切", - addTrajectory: "轨迹运动", - addXlsx: "添加作战数据", - showAttr: "查看属性", - importHeader: "导入表头", - resetPerspective: "重置透视", + addDirectory: '添加文件夹', + addResource: '添加地图数据', + pictureLocation: '带定位照片', + importPanorama: '带定位全景', + addBIM: '添加BIM', + edit: '编辑节点', + del: '删除节点', + setView: '设置视角', + resetView: '重置视角', + layerRaise: '图层上移', + layerLower: '图层下移', + layerToTop: '图层置顶', + layerToBottom: '图层置底', + tilesetClipping: '剖切', + addTrajectory: '轨迹运动', + addXlsx: '添加作战数据', + showAttr: '查看属性', + importHeader: '导入表头', + resetPerspective: '重置透视' }, tree: { - title: "图层指挥舱", + title: '图层指挥舱', // title: "综合信息", - layer: "图层", - location: "地点", + layer: '图层', + location: '地点' }, btn: { - search: "搜索", - treePlaceholder: "关键词搜索", - selectPlaceholder: "请选择", - selectNoText: "无数据", - }, -}; + search: '搜索', + treePlaceholder: '关键词搜索', + selectPlaceholder: '请选择', + selectNoText: '无数据' + } +} diff --git a/src/renderer/src/assets/images/noData.png b/src/renderer/src/assets/images/noData.png new file mode 100644 index 0000000..4549694 Binary files /dev/null and b/src/renderer/src/assets/images/noData.png differ diff --git a/src/renderer/src/common/initMapData.ts b/src/renderer/src/common/initMapData.ts index 19f45fa..324336a 100644 --- a/src/renderer/src/common/initMapData.ts +++ b/src/renderer/src/common/initMapData.ts @@ -20,7 +20,7 @@ export const initMapData = async (type, data) => { case 'linkImage': case 'vrImage': entityObject = new YJ.Obj.BillboardObject(window.earth, data) - entityObject.options.billboard.defaultImage='' + entityObject.options.billboard.defaultImage = '' break case 'line': entityObject = await new YJ.Obj.PolylineObject(window.earth, data) @@ -56,7 +56,7 @@ export const initMapData = async (type, data) => { break case 'layer': data.host = baseURL - console.log('data',data) + console.log('data', data) entityObject = new YJ.Obj.Layer(window.earth, data) break case 'tileset': @@ -101,16 +101,19 @@ export const initMapData = async (type, data) => { default: break } - options = structuredClone(entityObject.options) - delete options.host - //鼠标左键点击事件 - entityObject.onClick = () => { - leftClick(options); - }; - //鼠标右键点击事件 - entityObject.onRightClick = () => { - rightClick(options); - }; + + if (entityObject) { + options = structuredClone(entityObject.options) + delete options.host + //鼠标左键点击事件 + entityObject.onClick = () => { + leftClick(options); + }; + //鼠标右键点击事件 + entityObject.onRightClick = () => { + rightClick(options); + }; + } // options = entityObject return options } diff --git a/src/renderer/src/components/upload/uploadFiles.vue b/src/renderer/src/components/upload/uploadFiles.vue index 4e634aa..67ccaf4 100644 --- a/src/renderer/src/components/upload/uploadFiles.vue +++ b/src/renderer/src/components/upload/uploadFiles.vue @@ -19,6 +19,7 @@ @@ -83,8 +126,8 @@ const copy = () => { .auth_info_text { color: #fff; - font-size: 18px; - font-weight: bolder; + font-size: 14px; + font-weight: 700; margin: 7px 0 15px 15px; display: flex; align-items: center; diff --git a/src/renderer/src/views/components/headers/components/setPup/components/contentMenu.vue b/src/renderer/src/views/components/headers/components/setPup/components/contentMenu.vue new file mode 100644 index 0000000..65c4d90 --- /dev/null +++ b/src/renderer/src/views/components/headers/components/setPup/components/contentMenu.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/renderer/src/views/components/headers/components/setPup/components/engineering.vue b/src/renderer/src/views/components/headers/components/setPup/components/engineering.vue index 7d19627..f7e9d45 100644 --- a/src/renderer/src/views/components/headers/components/setPup/components/engineering.vue +++ b/src/renderer/src/views/components/headers/components/setPup/components/engineering.vue @@ -3,16 +3,47 @@
工程设置 - - - 路网导入 - + + + + + 路网导入 + +
-
-
+
+
+
+
+ +
+
+ {{ item.fileName }} + {{ item.createdAt }} +
+
+
+ + 删除 + +
+
+
@@ -109,7 +121,100 @@
- + diff --git a/src/renderer/src/views/components/headers/components/setPup/components/modelManage.vue b/src/renderer/src/views/components/headers/components/setPup/components/modelManage.vue index 7d5b3fc..c2c05be 100644 --- a/src/renderer/src/views/components/headers/components/setPup/components/modelManage.vue +++ b/src/renderer/src/views/components/headers/components/setPup/components/modelManage.vue @@ -1,6 +1,6 @@ @@ -127,6 +127,8 @@ import { ref, reactive } from 'vue' import { inject } from 'vue' import Dialog from '@/components/dialog/baseDialog.vue' +import { addMapSource } from '../../../common/addMapSource' +import { initMapData } from '@/common/initMapData' const baseDialog: any = ref(null) const eventBus: any = inject('bus') @@ -141,14 +143,15 @@ var latMin = ref(null) var lngSec = ref(null) var latSec = ref(null) +var id = ref(null) eventBus.on('coorLocationDialog', () => { + id.value = new YJ.Tools().randomString() baseDialog.value?.open() }) // @ts-ignore (define in dts) const handleClick = (tab: TabsPaneContext, event: Event) => { - console.log(tab, event) longitude.value = null latitude.value = null lngMin.value = null @@ -163,13 +166,21 @@ const closeCallBack = (e) => { latMin.value = null lngSec.value = null latSec.value = null + activeName.value = 'first' } -const flyto = (e) => { +const turnToPosition = async () => { + let position switch (activeName.value) { case 'first': - new YJ.Global.flyTo(window.earth, { - position: { lng: longitude.value, lat: latitude.value, alt: 100 } - }) + var point = await new YJ.Tools().sampleHeightMostDetailed( + [{ lng: longitude.value, lat: latitude.value, alt: 0 }], + window.earth + ) + position = { + lng: longitude.value, + lat: latitude.value, + alt: point[0].height < 0 ? 0 : point[0].height + } break case 'second': // @ts-ignore (define in dts) @@ -181,10 +192,16 @@ const flyto = (e) => { // @ts-ignore (define in dts) lat = latitude.value < 0 ? -lat : lat - var position = { lng, lat, alt: 100 } - new YJ.Global.flyTo(window.earth, { - position: position - }) + var point2 = await new YJ.Tools().sampleHeightMostDetailed( + [{ lng, lat, alt: 0 }], + window.earth + ) + position = { + lng: lng, + lat: lat, + alt: point2[0].height < 0 ? 0 : point2[0].height + } + break case 'third': var lng = @@ -199,14 +216,97 @@ const flyto = (e) => { // @ts-ignore (define in dts) lat = latitude.value < 0 ? -lat : lat - var position = { lng, lat, alt: 100 } - new YJ.Global.flyTo(window.earth, { - position: position - }) + var point3 = await new YJ.Tools().sampleHeightMostDetailed( + [{ lng, lat, alt: 0 }], + window.earth + ) + position = { + lng: lng, + lat: lat, + alt: point3[0].height < 0 ? 0 : point3[0].height + } break } + return position } -const draw = (e) => { + +const flyto = async (e) => { + let position = await turnToPosition() + new YJ.Global.flyTo(window.earth, { + position: { lng: position.lng, lat: position.lat, alt: position.alt + 100 } + }) + let name = '点标注' + let params = { + type: 'point', + id: id.value, + sourceName: name, + opt: { + id: id.value, + name: name, + position: position + } + } + if (!window.earth.entityMap.get(id.value)) { + await initMapData('point', params) + } + // switch (activeName.value) { + // case 'first': + // new YJ.Global.flyTo(window.earth, { + // position: { lng: longitude.value, lat: latitude.value, alt: 100 } + // }) + // break + // case 'second': + // // @ts-ignore (define in dts) + // var lng = Math.abs(longitude.value) + Math.abs(lngMin.value) / 60 + // // @ts-ignore (define in dts) + // var lat = Math.abs(latitude.value) + Math.abs(latMin.value) / 60 + // // @ts-ignore (define in dts) + // lng = longitude.value < 0 ? -lng : lng + // // @ts-ignore (define in dts) + // lat = latitude.value < 0 ? -lat : lat + + // var position = { lng, lat, alt: 100 } + // new YJ.Global.flyTo(window.earth, { + // position: position + // }) + // break + // case 'third': + // var lng = + // // @ts-ignore (define in dts) + // Math.abs(longitude.value) + Math.abs(lngMin.value) / 60 + Math.abs(lngSec.value) / 3600 + // var lat = + // // @ts-ignore (define in dts) + // Math.abs(latitude.value) + Math.abs(latMin.value) / 60 + Math.abs(latSec.value) / 3600 + + // // @ts-ignore (define in dts) + // lng = longitude.value < 0 ? -lng : lng + // // @ts-ignore (define in dts) + // lat = latitude.value < 0 ? -lat : lat + + // var position = { lng, lat, alt: 100 } + // new YJ.Global.flyTo(window.earth, { + // position: position + // }) + // break + // } +} +const draw = async (e) => { + let position = await turnToPosition() + if (!position) { + return + } + let name = '点标注' + await addMapSource({ + type: 'point', + id: id.value, + sourceName: name, + opt: { + id: id.value, + name: name, + position: position + } + }) + baseDialog.value?.close() } const close = (e) => { diff --git a/src/renderer/src/views/components/propertyBox/FlyRoam.vue b/src/renderer/src/views/components/propertyBox/FlyRoam.vue index 3c56ad2..eaa19a8 100644 --- a/src/renderer/src/views/components/propertyBox/FlyRoam.vue +++ b/src/renderer/src/views/components/propertyBox/FlyRoam.vue @@ -1,8 +1,9 @@ -
-
+ +
+
-
+ +
+
+
+ + 设置总时长 +
+ + s + +
+
@@ -110,8 +160,13 @@ @@ -120,6 +175,12 @@ import { ref, reactive } from 'vue' import { inject } from 'vue' import Dialog from '@/components/dialog/baseDialog.vue' +import { app } from 'electron' +import { TreeApi } from '@/api/tree' +import { useTreeNode } from '../tree/hooks/treeNode' +import { ElMessage } from 'element-plus' + +const { cusAddNodes } = useTreeNode() const baseDialog: any = ref(null) const eventBus: any = inject('bus') @@ -130,9 +191,44 @@ eventBus.on('flyRoamDialog', () => { show.value = true baseDialog.value?.open() setTimeout(() => { - flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }) - }, 0) + flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }, {}, draw) + }, 100) }) +const draw = (data) => { + if (data.points.length != 0) { + let selectedNodes = window.treeObj.getSelectedNodes() + let node = selectedNodes && selectedNodes[selectedNodes.length - 1] + let parentId + if (node) { + if (node.sourceType === 'directory') { + parentId = node.id + } else { + parentId = node.parentId + } + } + let id = new YJ.Tools().randomString() + let paramsData: any = { + params: data, + id, + sourceName: '漫游路径', + sourceType: 'roam', + parentId: parentId + } + + TreeApi.addOtherSource(paramsData) + paramsData.isShow = true + paramsData.params = JSON.stringify(paramsData.params) + cusAddNodes(window.treeObj, paramsData.parentId, [paramsData]) + baseDialog.value?.close() + } else { + ElMessage({ + message: '请添加数据', + type: 'warning' + }) + } + + console.log(data) +} const clangeViewPointHeight = () => {} const viewPointHeightInput = () => { @@ -147,11 +243,30 @@ const closeCallBack = (e) => { YJ.Global.FlyRoam.cease(window.earth) YJ.Global.FlyRoam.close() } -const draw = (e) => {} +const apply = (e) => { + YJ.Global.FlyRoam.apply() +} const close = (e) => { show.value = false baseDialog.value?.close() } - --> + diff --git a/src/renderer/src/views/components/propertyBox/RoutePlanning.vue b/src/renderer/src/views/components/propertyBox/RoutePlanning.vue index aecc66a..55a4e73 100644 --- a/src/renderer/src/views/components/propertyBox/RoutePlanning.vue +++ b/src/renderer/src/views/components/propertyBox/RoutePlanning.vue @@ -5,30 +5,129 @@ title="路径规划" left="180px" top="100px" + width="527px" :closeCallback="closeCallBack" > @@ -37,6 +136,7 @@ import { ref, reactive } from 'vue' import { inject } from 'vue' import Dialog from '@/components/dialog/baseDialog.vue' +import { RouteApi } from '@/api/route/index.ts' const baseDialog: any = ref(null) const eventBus: any = inject('bus') @@ -48,29 +148,148 @@ var endLng: any = ref(null) var endLat: any = ref(null) var routePlanning: any = reactive([]) + +var svgHover: any = reactive([false, false]) eventBus.on('routePlanningDialog', () => { baseDialog.value?.open() + setTimeout(() => { + //加载路网数据 + + let host = 'http://192.168.110.25:8848' + routePlanning = new YJ.Obj.RoutePlanning(window.earth, { + gps: false, + host + }) + routePlanning.Dialog.queryCallBack = async (v) => { + console.log(v, 'vvvvvvvvv') + // await queryRoute(params, (response) => { + // if (response) { + // routePlanning.createRoute(response.list[0].positions) + // } + // }) + let res = await RouteApi.queryRoute({ + startLng: startLng.value, + startLat: startLat.value, + endLng: endLng.value, + endLat: endLat.value, + waypoints: [] + }) + routePlanning.createRoute(res.data.pathPoints) + console.log(res, 'routLIst') + } + }, 100) }) -const closeCallBack = (e) => {} -function pickStartPos() {} -function pickEndPos() {} +//加载路网数据 -const draw = (e) => {} +const addRoute = async (fileId) => { + let res = await RouteApi.loadRoute({ fileId }) + console.log(res, 'res') +} +const getList = async () => { + let list = await RouteApi.getRouteList() + if (list.data.length > 0) { + let file = list.data[list.data.length - 1] + addRoute(file.id) + } + console.log(list, 'list') +} + +const closeCallBack = (e) => { + startLng.value = null + startLat.value = null + endLng.value = null + endLat.value = null +} +const routeQuery = async (e) => { + console.log('aaaaa') + let res = await RouteApi.queryRoute({ + startLng: startLng.value, + startLat: startLat.value, + endLng: endLng.value, + endLat: endLat.value, + waypoints: [] + }) + console.log(res, 'res') +} +const clearRoute = (e) => {} +const pickStartPos = () => { + routePlanning.pickStartPos((position) => { + console.log(position, 'position') + startLng.value = position.lng + startLat.value = position.lat + }) +} +const pickEndPos = () => { + routePlanning.pickEndPos((position) => { + endLng.value = position.lng + endLat.value = position.lat + }) +} + +const close = (e) => { + baseDialog.value?.close() +} + +const changeStartLng = () => { + routePlanning.startLng = startLng.value +} +const inputStartLng = () => { + let dom: any = document.getElementById('startLng') + if (startLng.value < dom.min * 1) { + startLng.value = dom.min * 1 + } else if (startLng.value > dom.max * 1) { + startLng.value = dom.max * 1 + } +} +const changeStartLat = () => { + routePlanning.startLat = startLat.value +} +const inputStartLat = () => { + let dom: any = document.getElementById('startLat') + if (startLat.value < dom.min * 1) { + startLat.value = dom.min * 1 + } else if (startLat.value > dom.max * 1) { + startLat.value = dom.max * 1 + } +} +const changeEndLng = () => { + routePlanning.endLng = endLng.value +} +const inputEndLng = () => { + let dom: any = document.getElementById('endLng') + if (endLng.value < dom.min * 1) { + endLng.value = dom.min * 1 + } else if (endLng.value > dom.max * 1) { + endLng.value = dom.max * 1 + } +} +const changeEndLat = () => { + routePlanning.endLat = endLat.value +} +const inputEndLat = () => { + let dom: any = document.getElementById('endLat') + if (endLat.value < dom.min * 1) { + endLat.value = dom.min * 1 + } else if (endLat.value > dom.max * 1) { + endLat.value = dom.max * 1 + } +} diff --git a/src/renderer/src/views/components/propertyBox/imagePop.vue b/src/renderer/src/views/components/propertyBox/imagePop.vue new file mode 100644 index 0000000..11f4cfa --- /dev/null +++ b/src/renderer/src/views/components/propertyBox/imagePop.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/renderer/src/views/components/propertyBox/model.vue b/src/renderer/src/views/components/propertyBox/model.vue new file mode 100644 index 0000000..02c5331 --- /dev/null +++ b/src/renderer/src/views/components/propertyBox/model.vue @@ -0,0 +1,204 @@ + + + + + diff --git a/src/renderer/src/views/home/index.vue b/src/renderer/src/views/home/index.vue index fe926a2..f395abd 100644 --- a/src/renderer/src/views/home/index.vue +++ b/src/renderer/src/views/home/index.vue @@ -10,32 +10,41 @@ - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +