Browse Source

地图修改

master
DIAMOND 9 months ago
parent
commit
5a91237a50
  1. 121
      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

121
src/views/earthMap/edit/EarthComp.vue

@ -925,7 +925,7 @@
let type = 1; //** let type = 1; //**
let models: any = { let models: any = {
ref: 'main', ref: this.sceneInfo[0].sceneId,
expand: true, expand: true,
title: this.sceneInfo[0].sceneName, title: this.sceneInfo[0].sceneName,
children: [], children: [],
@ -942,7 +942,7 @@
}); });
} }
console.log('models',models); // console.log('models',models);
// //
// console.log(""); // console.log("");
@ -1197,21 +1197,19 @@
// //
getLineInfo(models, type) { getLineInfo(models, type) {
const that = this; const that = this;
// console.log("type",type);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let submitData: any = { //线
defHttp.get({
url: this.url.queryLineList,
params: {
pageNo: 1, pageNo: 1,
pageSize: 99999, 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) { if (res.success) {
// //
let parentArea: any = [] let parentArea: any = []
@ -1225,21 +1223,16 @@
} }
}) })
parentArea.forEach((data) => { parentArea.forEach((data) => {
// data.sysOrgCode // console.log(data);
// data.sceneId
let updatedPositions: any = [] let updatedPositions: any = []
let positionsData = JSON.parse(data.positions) let positionsData = JSON.parse(data.positions)
if (!positionsData) { if (!positionsData) {
positionsData = [] positionsData = []
} }
updatedPositions = 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 = { let lineOptions: any = {
maxShowHeight: 30000, maxShowHeight: 30000,
customProp: data.lineCode, customProp: data.lineCode,
@ -1377,15 +1370,12 @@
} }
}); });
} }
//
if (type == 1) { //
const childs = models.children
for (const child of childs) {
if (child.ref == data.sysOrgCode) {
const node = { const node = {
ref: 'node_' + data.id, ref: 'node_' + data.id,
expand: false, expand: false,
title: data.name, title: "<防区>"+data.name,
children: [ children: [
{ {
expand: false, expand: false,
@ -1407,43 +1397,31 @@
}, },
], ],
} }
if(data.sceneId == models.ref){
// console.log("");
//
//
models.children.push(node)
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) child.children.push(node)
this.nodeConfigByRef.set(node.ref, node) this.nodeConfigByRef.set(node.ref, node)
this.areaByNodeId.set(node.ref, data.sysOrgCode) this.areaByNodeId.set(node.ref, data.sceneId)
} }
} }
} else {
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: [],
},
],
}
models.children.push(node)
this.areaByNodeId.set(node.ref, data.sysOrgCode)
} }
//
that._earth.sceneTree.root.children.push({ czmObject: lineOptions, ref: data.id }) 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) => { childArea.forEach((data) => {
@ -1463,20 +1441,20 @@
$(element).css('display', 'none') $(element).css('display', 'none')
}) })
}) })
// console.log("models",models);
resolve(models) resolve(models)
} }
}); });
}); });
} }
//
getCameraInfo(models, type) { getCameraInfo(models, type) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
//线 //线
defHttp.get({ url: this.url.queryCameraInfo }, { isTransformResponse: false }).then(async (res) => { defHttp.get({ url: this.url.queryCameraInfo }, { isTransformResponse: false }).then(async (res) => {
if (res.success) { if (res.success) {
// console.log("res",res); // console.log("res",res);
this.setCamera(res.result, models, type); this.setCamera(res.result, models, type);
this.cameraData = res.result; this.cameraData = res.result;
resolve(models); resolve(models);
@ -1484,7 +1462,6 @@
}); });
}); });
} }
async setCamera(res, models, type) { async setCamera(res, models, type) {
// //
let posArr: any = [], let posArr: any = [],
@ -1515,6 +1492,8 @@
//线 //线
res.forEach((data, index) => { res.forEach((data, index) => {
// console.log("data",data);
let siteConfig: any = null; let siteConfig: any = null;
const lineId = data.id; const lineId = data.id;
let childs: any = null; let childs: any = null;
@ -1532,6 +1511,7 @@
} }
childs = parentNode.children; childs = parentNode.children;
siteConfig = childs[0]; siteConfig = childs[0];
// console.log("parentNode",parentNode);
} }
if (!siteConfig) { if (!siteConfig) {
return; return;
@ -1643,11 +1623,12 @@
}); });
} }
//
async getLabelInfo(models, type) { async getLabelInfo(models, type) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// //
defHttp.get({ url: this.url.queryLabelList }, { isTransformResponse: false }).then(async (res) => { defHttp.get({ url: this.url.queryLabelList }, { isTransformResponse: false }).then(async (res) => {
console.log("请求地图标志信息",res); // console.log("",res);
if (res.success) { if (res.success) {
const labelItems = await this.setLabel(res.result, models, type); const labelItems = await this.setLabel(res.result, models, type);
@ -1656,19 +1637,27 @@
}); });
}); });
} }
//
async setLabel(res, models, type) { async setLabel(res, models, type) {
// console.log("res",res);
const that = this; const that = this;
const args = { pageNo: 1, pageSize: 999 }; 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) => { .then((reponse) => {
if (reponse.success) { if (reponse.success) {
// console.log("queryDeviceInfoList",reponse);
const hostDeviceList = reponse.result.records const hostDeviceList = reponse.result.records
for (const hostDevice of hostDeviceList) { for (const hostDevice of hostDeviceList) {
that.hostDeviceMapById.set(hostDevice.id, hostDevice); that.hostDeviceMapById.set(hostDevice.id, hostDevice);
} }
return that.hostDeviceMapById; return that.hostDeviceMapById;
} }
else{
console.error("获取主机信息错误",reponse);
}
}) })
.catch(() => { .catch(() => {
throw '获取主机信息错误'; throw '获取主机信息错误';
@ -1705,9 +1694,11 @@
}, },
}; };
if (item.labelAttr == 4) { if (item.labelAttr == 4) {
console.log("雷达",item);
that.statusByNodeId.set(item.id, 1); that.statusByNodeId.set(item.id, 1);
that.addLabelNodeToTree(item, models, objConfig3, type); that.addLabelNodeToTree(item, models, objConfig3, type);
} else { } else {
console.log("微波",item);
that.statusByNodeId.set(item.id, -10); that.statusByNodeId.set(item.id, -10);
that.addLabelNodeToTree(item, models, objConfig3, type); that.addLabelNodeToTree(item, models, objConfig3, type);
const device = that.hostDeviceMapById.get(data.deviceId); const device = that.hostDeviceMapById.get(data.deviceId);

20
src/views/military/modules/earthMap/scene/SceneManage.vue

@ -219,8 +219,8 @@
// }, // },
// { // {
// title: '', // title: '',
// dataIndex: 'parentSceneCode', // dataIndex: 'parentSceneId',
// key: 'parentSceneCode', // key: 'parentSceneId',
// align: 'center', // align: 'center',
// width: '6%', // width: '6%',
// }, // },
@ -304,7 +304,7 @@
const subObject = ref({ const subObject = ref({
sceneId: '', sceneId: '',
sceneName: '', sceneName: '',
parentSceneCode: '', parentSceneId: '',
sceneType: 1, sceneType: 1,
viewDistance: 0, viewDistance: 0,
duration: 0, duration: 0,
@ -345,7 +345,7 @@
const params = { pageIndex: 1, pageSize: 9999 }; const params = { pageIndex: 1, pageSize: 9999 };
// = // =
if (filter.value && filter.value.length > 0) { if (filter.value && filter.value.length > 0) {
params.parentSceneCode = filter.value; params.parentSceneId = filter.value;
} }
// //
return querySceneList(params).then((res) => { return querySceneList(params).then((res) => {
@ -371,7 +371,7 @@
// sceneCodes.push(sceneId); // sceneCodes.push(sceneId);
const sceneName = item.sceneName; const sceneName = item.sceneName;
const sceneType = item.sceneType; const sceneType = item.sceneType;
const parentSceneCode = item.parentSceneCode; const parentSceneId = item.parentSceneId;
parentCodeArr.value.push(sceneId); parentCodeArr.value.push(sceneId);
const cxyz = [item.cameraLon, item.cameraLat, item.cameraAltitude]; const cxyz = [item.cameraLon, item.cameraLat, item.cameraAltitude];
const xyz = [item.lon, item.lat, item.altitude]; const xyz = [item.lon, item.lat, item.altitude];
@ -384,7 +384,7 @@
// //
const obj = { const obj = {
sceneId, sceneId,
parentSceneCode, parentSceneId,
sceneType, sceneType,
sceneName, sceneName,
cxyz, cxyz,
@ -396,7 +396,7 @@
icon, icon,
}; };
if (selectedKeys.value[0] == '00001') { if (selectedKeys.value[0] == '00001') {
if (parentSceneCode == '00001') { if (parentSceneId == '00001') {
allData.push(obj); allData.push(obj);
} }
} else { } else {
@ -426,11 +426,11 @@
} }
} }
// dataByParentCode // dataByParentCode
if (dataByParentCode.has(parentSceneCode)) { if (dataByParentCode.has(parentSceneId)) {
dataByParentCode.get(parentSceneCode).push(obj); dataByParentCode.get(parentSceneId).push(obj);
} else { } else {
const datas = [obj]; const datas = [obj];
dataByParentCode.set(parentSceneCode, datas); dataByParentCode.set(parentSceneId, datas);
} }
}); });
if (!isUpdateTree) { if (!isUpdateTree) {

8
src/views/military/modules/earthMap/scene/model/Modal.vue

@ -36,7 +36,7 @@
const subObject = ref({ const subObject = ref({
sceneId: '', sceneId: '',
sceneName: '', sceneName: '',
parentSceneCode: '', parentSceneId: '',
sceneType: 1, sceneType: 1,
viewDistance: 0, viewDistance: 0,
duration: 0, duration: 0,
@ -57,7 +57,7 @@
// //
if (editInfo.value && editInfo.value.id != null) { if (editInfo.value && editInfo.value.id != null) {
subObject.value.sceneId = editInfo.value.sceneId; 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.sceneType = editInfo.value.sceneType;
subObject.value.sceneName = editInfo.value.sceneName; subObject.value.sceneName = editInfo.value.sceneName;
subObject.value.viewDistance = editInfo.value.distance; subObject.value.viewDistance = editInfo.value.distance;
@ -96,7 +96,7 @@
subObject.value = { subObject.value = {
sceneId: '', sceneId: '',
sceneName: '', sceneName: '',
parentSceneCode: '', parentSceneId: '',
sceneType: 1, sceneType: 1,
viewDistance: 0.5, viewDistance: 0.5,
duration: 0, duration: 0,
@ -113,7 +113,7 @@
}; };
// sceneCode // sceneCode
subObject.value.sceneId = sceneInfo.value.createCode(); 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"> <!-- <a-col :span="11" :offset="1">
<div>父场景编号:</div> <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-option :value="parentCode" v-for="parentCode in parentCodeArr">{{ parentCode }}</a-select-option>
</a-select> </a-select>
</a-col> --> </a-col> -->

2
src/views/system/user/user.data.ts

@ -234,7 +234,7 @@ export const formSchema: FormSchema[] = [
// required: true, // required: true,
componentProps: { componentProps: {
api: (params?: Recordable) => defHttp.get({ url: "/military/msMapScene/queryTreeByCode", params }).then(res=>{ return [res];}), api: (params?: Recordable) => defHttp.get({ url: "/military/msMapScene/queryTreeByCode", params }).then(res=>{ return [res];}),
// resultField: 'parentSceneCode', // resultField: 'parentSceneId',
}, },
}, },
{ {

Loading…
Cancel
Save