diff --git a/src/views/earthMap/edit/EarthComp.vue b/src/views/earthMap/edit/EarthComp.vue index d1f47be..ecf7fa9 100644 --- a/src/views/earthMap/edit/EarthComp.vue +++ b/src/views/earthMap/edit/EarthComp.vue @@ -925,7 +925,7 @@ let type = 1; //** let models: any = { - ref: 'main', + ref: this.sceneInfo[0].sceneId, expand: true, title: this.sceneInfo[0].sceneName, children: [], @@ -942,7 +942,7 @@ }); } - console.log('models',models); + // console.log('models',models); // 加载区域 // console.log("加载区域"); @@ -1197,21 +1197,19 @@ //加载区域 getLineInfo(models, type) { const that = this; - // console.log("type",type); - return new Promise((resolve, reject) => { - let submitData: any = { + //请求线路信息 + defHttp.get({ + url: this.url.queryLineList, + params: { pageNo: 1, pageSize: 99999, - }; + sceneId: this.userStore.userInfo?.sceneId + "*", + } }, + { isTransformResponse: false }) + .then(async (res) => { + // console.log('加载区域',res); - // 如果进入单位是岛屿,则只加载相关岛屿信息 - if (type == 2) { - submitData.sysOrgCode = that.orgCode - } - //请求线路信息 - defHttp.get({ url: this.url.queryLineList, params: submitData }, { isTransformResponse: false }).then(async (res) => { - // console.log('res',res); if (res.success) { //一级区域 let parentArea: any = [] @@ -1225,21 +1223,16 @@ } }) parentArea.forEach((data) => { - // data.sysOrgCode + // console.log(data); + + // data.sceneId let updatedPositions: any = [] let positionsData = JSON.parse(data.positions) if (!positionsData) { positionsData = [] } updatedPositions = positionsData - // //地形是否开启 - // if (window.$earth.sceneTree.$refs.terrain.czmObject.show) { - // // 设置位置 - // updatedPositions = positionsData - // } else { - // // 删除高度,只设置经纬度。 - // positionsData.forEach((item) => updatedPositions.push([item[0], item[1], 0])) - // } + let lineOptions: any = { maxShowHeight: 30000, customProp: data.lineCode, @@ -1377,46 +1370,12 @@ } }); } - // 如果是总部 - if (type == 1) { - const childs = models.children - for (const child of childs) { - if (child.ref == data.sysOrgCode) { - const node = { - ref: 'node_' + data.id, - expand: false, - title: data.name, - children: [ - { - expand: false, - title: '监控点位', - ref: 'monitor_' + window.guid(), - children: [], - }, - { - expand: false, - title: '雷达点位', - ref: 'ldList_' + window.guid(), - children: currentChildArea, - }, - { - expand: false, - title: '微波点位', - ref: 'wbList_' + window.guid(), - children: [], - }, - ], - } - child.children.push(node) - this.nodeConfigByRef.set(node.ref, node) - this.areaByNodeId.set(node.ref, data.sysOrgCode) - } - } - } else { - const node = { + + //配置信息 + const node = { ref: 'node_' + data.id, expand: false, - title: data.name, + title: "<防区>"+data.name, children: [ { expand: false, @@ -1438,12 +1397,31 @@ }, ], } + if(data.sceneId == models.ref){ + // console.log("当前场景下"); + + //该防区为当前场景下 + //压入树 models.children.push(node) - this.areaByNodeId.set(node.ref, data.sysOrgCode) + this.nodeConfigByRef.set(node.ref, node) + this.areaByNodeId.set(node.ref, data.sceneId) + // return + } + else{ + const childs = models.children + for (const child of childs) { + if (child.ref == data.sceneId) { + //该防区为子场景下 + // console.log("子场景下"); + child.children.push(node) + this.nodeConfigByRef.set(node.ref, node) + this.areaByNodeId.set(node.ref, data.sceneId) + } + } } + //放进世界场景树 that._earth.sceneTree.root.children.push({ czmObject: lineOptions, ref: data.id }) - // models[0].children.push({ ref: 'node_' + data.id, expand: false, title: data.name, children: [] }) - // models.children[0].children.push({ czmObject: lineOptions, ref: data.id }) + }) //加载二级区域模型 childArea.forEach((data) => { @@ -1463,20 +1441,20 @@ $(element).css('display', 'none') }) }) + // console.log("models",models); resolve(models) } }); }); } - + //加载相机 getCameraInfo(models, type) { return new Promise((resolve, reject) => { //请求电线杆信息 defHttp.get({ url: this.url.queryCameraInfo }, { isTransformResponse: false }).then(async (res) => { if (res.success) { // console.log("res",res); - this.setCamera(res.result, models, type); this.cameraData = res.result; resolve(models); @@ -1484,7 +1462,6 @@ }); }); } - async setCamera(res, models, type) { //根据经纬度算出该点地形高度 let posArr: any = [], @@ -1515,6 +1492,8 @@ //设置电线杆 res.forEach((data, index) => { + // console.log("data",data); + let siteConfig: any = null; const lineId = data.id; let childs: any = null; @@ -1532,6 +1511,7 @@ } childs = parentNode.children; siteConfig = childs[0]; + // console.log("parentNode",parentNode); } if (!siteConfig) { return; @@ -1643,11 +1623,12 @@ }); } + // 加载雷达和微波 async getLabelInfo(models, type) { return new Promise((resolve, reject) => { //请求地图标志信息 defHttp.get({ url: this.url.queryLabelList }, { isTransformResponse: false }).then(async (res) => { - console.log("请求地图标志信息",res); + // console.log("请求地图标志信息",res); if (res.success) { const labelItems = await this.setLabel(res.result, models, type); @@ -1656,19 +1637,27 @@ }); }); } - + //地图标志信息 async setLabel(res, models, type) { + // console.log("res",res); const that = this; const args = { pageNo: 1, pageSize: 999 }; - await defHttp.get({ url: this.url.queryDeviceInfoList, params: args }, { isTransformResponse: false }) + await defHttp.get({ + url: this.url.queryDeviceInfoList, + params: args + }, { isTransformResponse: false }) .then((reponse) => { if (reponse.success) { + // console.log("queryDeviceInfoList",reponse); const hostDeviceList = reponse.result.records for (const hostDevice of hostDeviceList) { that.hostDeviceMapById.set(hostDevice.id, hostDevice); } return that.hostDeviceMapById; } + else{ + console.error("获取主机信息错误",reponse); + } }) .catch(() => { throw '获取主机信息错误'; @@ -1676,7 +1665,7 @@ //根据经纬度算出该点地形高度 let posArr: any = [], updatedPositions: any = []; - res.forEach((data, index) => { + res.forEach((data, index) => { updatedPositions.push(window.Cesium.Cartographic.fromDegrees(data.mapLabel.labelLon, data.mapLabel.labelLat, data.mapLabel.labelHeight)); }); const labelItems: any = []; @@ -1705,9 +1694,11 @@ }, }; if (item.labelAttr == 4) { + console.log("雷达",item); that.statusByNodeId.set(item.id, 1); that.addLabelNodeToTree(item, models, objConfig3, type); } else { + console.log("微波",item); that.statusByNodeId.set(item.id, -10); that.addLabelNodeToTree(item, models, objConfig3, type); const device = that.hostDeviceMapById.get(data.deviceId); diff --git a/src/views/military/modules/earthMap/scene/SceneManage.vue b/src/views/military/modules/earthMap/scene/SceneManage.vue index 114c416..dce5718 100644 --- a/src/views/military/modules/earthMap/scene/SceneManage.vue +++ b/src/views/military/modules/earthMap/scene/SceneManage.vue @@ -219,8 +219,8 @@ // }, // { // title: '父场景编号', - // dataIndex: 'parentSceneCode', - // key: 'parentSceneCode', + // dataIndex: 'parentSceneId', + // key: 'parentSceneId', // align: 'center', // width: '6%', // }, @@ -304,7 +304,7 @@ const subObject = ref({ sceneId: '', sceneName: '', - parentSceneCode: '', + parentSceneId: '', sceneType: 1, viewDistance: 0, duration: 0, @@ -345,7 +345,7 @@ const params = { pageIndex: 1, pageSize: 9999 }; // 添加查询条件 父场景编码=选中编码 if (filter.value && filter.value.length > 0) { - params.parentSceneCode = filter.value; + params.parentSceneId = filter.value; } // 查询返回数据 return querySceneList(params).then((res) => { @@ -371,7 +371,7 @@ // sceneCodes.push(sceneId); const sceneName = item.sceneName; const sceneType = item.sceneType; - const parentSceneCode = item.parentSceneCode; + const parentSceneId = item.parentSceneId; parentCodeArr.value.push(sceneId); const cxyz = [item.cameraLon, item.cameraLat, item.cameraAltitude]; const xyz = [item.lon, item.lat, item.altitude]; @@ -384,7 +384,7 @@ // 创建对象 const obj = { sceneId, - parentSceneCode, + parentSceneId, sceneType, sceneName, cxyz, @@ -396,7 +396,7 @@ icon, }; if (selectedKeys.value[0] == '00001') { - if (parentSceneCode == '00001') { + if (parentSceneId == '00001') { allData.push(obj); } } else { @@ -426,11 +426,11 @@ } } // 向dataByParentCode中放入数据 - if (dataByParentCode.has(parentSceneCode)) { - dataByParentCode.get(parentSceneCode).push(obj); + if (dataByParentCode.has(parentSceneId)) { + dataByParentCode.get(parentSceneId).push(obj); } else { const datas = [obj]; - dataByParentCode.set(parentSceneCode, datas); + dataByParentCode.set(parentSceneId, datas); } }); if (!isUpdateTree) { diff --git a/src/views/military/modules/earthMap/scene/model/Modal.vue b/src/views/military/modules/earthMap/scene/model/Modal.vue index c159af3..666e01f 100644 --- a/src/views/military/modules/earthMap/scene/model/Modal.vue +++ b/src/views/military/modules/earthMap/scene/model/Modal.vue @@ -36,7 +36,7 @@ const subObject = ref({ sceneId: '', sceneName: '', - parentSceneCode: '', + parentSceneId: '', sceneType: 1, viewDistance: 0, duration: 0, @@ -57,7 +57,7 @@ // 更新数据 if (editInfo.value && editInfo.value.id != null) { subObject.value.sceneId = editInfo.value.sceneId; - subObject.value.parentSceneCode = editInfo.value.parentSceneCode; + subObject.value.parentSceneId = editInfo.value.parentSceneId; subObject.value.sceneType = editInfo.value.sceneType; subObject.value.sceneName = editInfo.value.sceneName; subObject.value.viewDistance = editInfo.value.distance; @@ -96,7 +96,7 @@ subObject.value = { sceneId: '', sceneName: '', - parentSceneCode: '', + parentSceneId: '', sceneType: 1, viewDistance: 0.5, duration: 0, @@ -113,7 +113,7 @@ }; // 生成sceneCode subObject.value.sceneId = sceneInfo.value.createCode(); - subObject.value.parentSceneCode = parentNodeCode.value; + subObject.value.parentSceneId = parentNodeCode.value; } }); // 包装父组件方法 diff --git a/src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue b/src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue index 5115b27..bd40c44 100644 --- a/src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue +++ b/src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue @@ -37,7 +37,7 @@ diff --git a/src/views/system/user/user.data.ts b/src/views/system/user/user.data.ts index e25454e..744b4a4 100644 --- a/src/views/system/user/user.data.ts +++ b/src/views/system/user/user.data.ts @@ -234,7 +234,7 @@ export const formSchema: FormSchema[] = [ // required: true, componentProps: { api: (params?: Recordable) => defHttp.get({ url: "/military/msMapScene/queryTreeByCode", params }).then(res=>{ return [res];}), - // resultField: 'parentSceneCode', + // resultField: 'parentSceneId', }, }, {