Browse Source

地图修改

master
DIAMOND 9 months ago
parent
commit
5a91237a50
  1. 131
      src/views/earthMap/edit/EarthComp.vue
  2. 20
      src/views/military/modules/earthMap/scene/SceneManage.vue
  3. 8
      src/views/military/modules/earthMap/scene/model/Modal.vue
  4. 2
      src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue
  5. 2
      src/views/system/user/user.data.ts

131
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);

20
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) {

8
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;
}
});
//

2
src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue

@ -37,7 +37,7 @@
<!-- <a-col :span="11" :offset="1">
<div>父场景编号:</div>
<a-select v-model:value="subObject.parentSceneCode" :show-search="true" :filterOption="filterOption">
<a-select v-model:value="subObject.parentSceneId" :show-search="true" :filterOption="filterOption">
<a-select-option :value="parentCode" v-for="parentCode in parentCodeArr">{{ parentCode }}</a-select-option>
</a-select>
</a-col> -->

2
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',
},
},
{

Loading…
Cancel
Save