|
|
@ -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 '获取主机信息错误'; |
|
|
@ -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); |
|
|
|