From 6efe63bb2a94ea2f3093a7408dfb7254a6dbb240 Mon Sep 17 00:00:00 2001
From: DIAMOND <276397553@qq.com>
Date: Mon, 25 Dec 2023 16:05:37 +0800
Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5SceneId?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
2.地球edit 暂时无法使用
---
src/views/earthMap/edit/EarthComp.vue | 160 +-
src/views/earthMap/edit/EarthComp20231225.vue | 4707 +++++++++++++++++
src/views/earthMap/show/EarthComp.vue | 10 +-
.../components/DtAiMonitorAreaForm.vue | 4 +-
.../monitorArea/components/VCEarthViewer.vue | 2 +-
.../earthMap/mapManage/modal/MapModel.vue | 6 +-
.../modules/earthMap/scene/SceneManage.vue | 48 +-
.../modules/earthMap/scene/model/Modal.vue | 8 +-
.../scene/model/sceneInfo/SenceInfo.vue | 10 +-
.../mapScene/components/MsMapSceneForm.vue | 6 +-
10 files changed, 4772 insertions(+), 189 deletions(-)
create mode 100644 src/views/earthMap/edit/EarthComp20231225.vue
diff --git a/src/views/earthMap/edit/EarthComp.vue b/src/views/earthMap/edit/EarthComp.vue
index 9e50e40..61558a5 100644
--- a/src/views/earthMap/edit/EarthComp.vue
+++ b/src/views/earthMap/edit/EarthComp.vue
@@ -814,40 +814,19 @@
//监听鼠标事件
this.listenMouseHandler(earthUI);
-
- // 获取部门信息 //已弃用
- // await this.getSceneInfo();
- // 新的飞入方法
- await this.newfly();
+ // 飞入方法
+ await this.fly();
//加载地图线路资源
await this.createBBHLine(earthUI);
-
- //飞入地点 //已弃用
- // await this.fly();
-
-
+
//创建工具栏
- // console.log("earthUI",earthUI);
-
this.toolbarShow = true
- // window.$flyTo = this.flyTo
- // console.log("window.$flyTo",window);
- // console.log("this.flyTo",this);
- // earthUI.showPropertyWindow(
- // {
- // flyTo: this.flyTo,
- // setLabelStatus: this.setLabelStatus,
- // },
- // {
- // component: Toolbar,
- // }
- // );
-
+
});
}
- //新的飞入方法 20231222
- async newfly(){
+ //飞入方法 20231222
+ async fly(){
let position, rotation, viewDistance, duration;
const sceneId = this.userStore.userInfo?.sceneId;
await defHttp.get({
@@ -855,8 +834,8 @@
params: {
pageNo: 1,
pageSize: 999,
- sceneCode: sceneId + "*",
- column: 'sceneCode',
+ sceneId: sceneId + "*",
+ column: 'sceneId',
order: 'asc',
}
}, { isTransformResponse: false }).then((response) => {
@@ -879,63 +858,6 @@
}
- //已弃用
- async fly() {
- let position, rotation, viewDistance, duration;
- //
- let parentData =
- this.sceneInfo instanceof Array
- ? this.sceneInfo.filter((item, index) => {
- return item.sceneCode == "00001-00001";
- })
- : this.sceneInfo;
- //过滤掉总部层级的
- let data = this.sceneInfo instanceof Array ?
- this.sceneInfo.filter((item, index) => {
- return item.sceneCode.length > 3;
- })
- : this.sceneInfo;
- // console.log("data",data);
- // console.log("this.sceneInfo",this.sceneInfo);
- if (data) {
- if (!(data instanceof Array)) {
- // debugger;
- // 各岛礁
- // position = [data.lon, data.lat, data.altitude];
- position = [data.cameraLon, data.cameraLat, data.cameraAltitude];
- rotation = [data.rotationX, data.rotationY, data.rotationZ];
- viewDistance = data.viewDistance;
- duration = data.duration ? data.duration : 0;
- this._earth.camera.flyTo(position, viewDistance, rotation, duration);
- // 地图复原事件
- window.$flyTo = this.flyTo = () => {
- this._earth.camera.flyTo(position, viewDistance, rotation, duration);
- };
- } else {
- // 总指挥中心
- // position = [parentData[0].lon, parentData[0].lat, parentData[0].altitude];
- position = [parentData[0].cameraLon, parentData[0].cameraLat, parentData[0].cameraAltitude];
- rotation = [parentData[0].rotationX, parentData[0].rotationY, parentData[0].rotationZ];
- viewDistance = parentData[0].viewDistance;
- duration = parentData[0].duration;
- // 先飞入到能看见红旗
- this._earth.camera.flyTo(position, viewDistance, rotation, duration);
- // 地图复原事件
- window.$flyTo = this.flyTo = () => {
- this._earth.camera.flyTo(position, viewDistance, rotation, duration);
- };
- for (let record of data) {
- if (record.sceneCode.length == 11) {
- continue;
- }
- // 设置红旗
- this.setLoginPoint(record);
- }
- }
- } else {
- // 没权限人员控制
- }
- }
setLoginPoint(data) {
let position = [data.lon, data.lat, 0];
@@ -974,45 +896,6 @@
};
}
- //已弃用
- async getSceneInfo() {
- // 登录人部门信息
- // const orgCode = Vue.ls.get(USER_INFO).orgCode;
- // const userStore = useUserStore()
- const orgCode = this.userStore.userInfo?.orgCode;
- this.orgCode = orgCode;
- // console.log("orgCode",orgCode);
-
- // 登录人部门信息长度为3则为总部,否则为岛屿
- if (orgCode.length == 3) {
- // 总部
- await defHttp.get({
- url: '/military/msMapScene/list',
- params: {
- pageNo: 1,
- pageSize: 999,
- sceneCode: "00001-00001*",
- column: 'sysOrgCode',
- order: 'asc',
- }
- }, { isTransformResponse: false }).then((response) => {
- console.log("总部",response);
-
- const records = response.result.records
- // 设置岛屿信息为数组
- this.sceneInfo = records;
- return records;
- });
- } else {
- await defHttp.get({ url: '/military/msMapScene/queryByOrgCode', params: { orgCode: orgCode } }, { isTransformResponse: false }).then((response) => {
- console.log("岛屿",response);
- const data = response.result;
- // 设置岛屿信息为Object
- this.sceneInfo = data;
- return data;
- });
- }
- }
//设置按钮颜色状态
setIconByRef(ref, el) {
@@ -1039,36 +922,27 @@
}
/* 使用async/await 处理异步方法顺序执行。成功的操作放到try里,失败的放在catch里 */
async createBBHLine(earthUI= null) {
- let models: any = null;
- let type = 0;
- if (!(this.sceneInfo instanceof Array)) {
- type = 2;
- models = {
- ref: 'areas',
- expand: true,
- title: '岛礁',
- children: [],
- };
- } else {
- type = 1;
- models = {
+ console.log("MyScene",this.userStore.userInfo?.sceneId);
+ let type = 1; //**
+
+ let models: any = {
ref: 'main',
expand: true,
title: this.sceneInfo[0].sceneName,
children: [],
- };
+ }
for (let record of this.sceneInfo) {
- if (record.parentSceneCode.length == 5) {
+ if (record.sceneId == this.userStore.userInfo?.sceneId) {
continue;
}
models.children.push({
- ref: record.sysOrgCode,
+ ref: record.sceneId,
expand: false,
title: record.sceneName,
children: [],
});
}
- }
+
console.log('models',models);
// 加载区域
@@ -1774,6 +1648,8 @@
return new Promise((resolve, reject) => {
//请求地图标志信息
defHttp.get({ url: this.url.queryLabelList }, { isTransformResponse: false }).then(async (res) => {
+ console.log("请求地图标志信息",res);
+
if (res.success) {
const labelItems = await this.setLabel(res.result, models, type);
resolve(labelItems);
diff --git a/src/views/earthMap/edit/EarthComp20231225.vue b/src/views/earthMap/edit/EarthComp20231225.vue
new file mode 100644
index 0000000..b5fd18e
--- /dev/null
+++ b/src/views/earthMap/edit/EarthComp20231225.vue
@@ -0,0 +1,4707 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/earthMap/show/EarthComp.vue b/src/views/earthMap/show/EarthComp.vue
index 93686bc..86d1a7f 100644
--- a/src/views/earthMap/show/EarthComp.vue
+++ b/src/views/earthMap/show/EarthComp.vue
@@ -813,13 +813,13 @@
let parentData =
this.sceneInfo instanceof Array
? this.sceneInfo.filter((item, index) => {
- return item.sceneCode == "00001-00001";
+ return item.sceneId == "00001-00001";
})
: this.sceneInfo;
//过滤掉总部层级的
let data = this.sceneInfo instanceof Array ?
this.sceneInfo.filter((item, index) => {
- return item.sceneCode.length > 3;
+ return item.sceneId.length > 3;
})
: this.sceneInfo;
// console.log("data",data);
@@ -850,7 +850,7 @@
this._earth.camera.flyTo(position, viewDistance, rotation, duration);
};
for (let record of data) {
- if (record.sceneCode.length == 11) {
+ if (record.sceneId.length == 11) {
continue;
}
// 设置红旗
@@ -915,7 +915,7 @@
params: {
pageNo: 1,
pageSize: 999,
- sceneCode: "00001-00001*",
+ sceneId: "00001-00001*",
column: 'sysOrgCode',
order: 'asc',
}
@@ -982,7 +982,7 @@
children: [],
};
for (let record of this.sceneInfo) {
- if (record.parentSceneCode.length == 5) {
+ if (record.parentSceneId.length == 5) {
continue;
}
models.children.push({
diff --git a/src/views/military/modules/ai/aiMonitorArea/components/DtAiMonitorAreaForm.vue b/src/views/military/modules/ai/aiMonitorArea/components/DtAiMonitorAreaForm.vue
index aef63cb..289d0ab 100644
--- a/src/views/military/modules/ai/aiMonitorArea/components/DtAiMonitorAreaForm.vue
+++ b/src/views/military/modules/ai/aiMonitorArea/components/DtAiMonitorAreaForm.vue
@@ -64,8 +64,8 @@
-
- {{ code.sceneName }}
+
+ {{ code.sceneName }}
diff --git a/src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue b/src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue
index 9f60a29..0c8ab6b 100644
--- a/src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue
+++ b/src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue
@@ -469,7 +469,7 @@ async function fly(viewer: any = null) {
await defHttp.get({
url: '/military/msMapScene/list',
params: {
- sceneCode: sceneId,
+ sceneId: sceneId,
}
}, { isTransformResponse: false }).then((response) => {
let res = response.result.records[0]
diff --git a/src/views/military/modules/earthMap/mapManage/modal/MapModel.vue b/src/views/military/modules/earthMap/mapManage/modal/MapModel.vue
index 6ae385d..305a1db 100644
--- a/src/views/military/modules/earthMap/mapManage/modal/MapModel.vue
+++ b/src/views/military/modules/earthMap/mapManage/modal/MapModel.vue
@@ -85,7 +85,7 @@
绑定飞入点:
- {{
+ {{
flyPointer.sceneName
}}
@@ -215,7 +215,7 @@
const records = res.result.records;
flyPointers.value = [];
records.forEach((item) => {
- const sceneCode = item.sceneCode;
+ const sceneId = item.sceneId;
const sceneName = item.sceneName;
const xyz = [item.lon, item.lat, item.altitude];
const rxyz = [item.rotationX, item.rotationY, item.rotationZ];
@@ -224,7 +224,7 @@
const builds = [item.rArea, item.rBuilder, item.rStock, item.rParkade];
const id = item.id;
const obj = {
- sceneCode,
+ sceneId,
sceneName,
xyz,
rxyz,
diff --git a/src/views/military/modules/earthMap/scene/SceneManage.vue b/src/views/military/modules/earthMap/scene/SceneManage.vue
index 436cf4a..114c416 100644
--- a/src/views/military/modules/earthMap/scene/SceneManage.vue
+++ b/src/views/military/modules/earthMap/scene/SceneManage.vue
@@ -69,7 +69,7 @@
-->
-
+
@@ -212,8 +212,8 @@
const columns = [
// {
// title: '场景编号',
- // dataIndex: 'sceneCode',
- // key: 'sceneCode',
+ // dataIndex: 'sceneId',
+ // key: 'sceneId',
// align: 'center',
// width: '6%',
// },
@@ -302,7 +302,7 @@
let currentSelectNode = null;
// 传入弹窗数据
const subObject = ref({
- sceneCode: '',
+ sceneId: '',
sceneName: '',
parentSceneCode: '',
sceneType: 1,
@@ -367,12 +367,12 @@
}
let addRootNode = null;
records.forEach((item) => {
- const sceneCode = item.sceneCode;
- // sceneCodes.push(sceneCode);
+ const sceneId = item.sceneId;
+ // sceneCodes.push(sceneId);
const sceneName = item.sceneName;
const sceneType = item.sceneType;
const parentSceneCode = item.parentSceneCode;
- parentCodeArr.value.push(sceneCode);
+ parentCodeArr.value.push(sceneId);
const cxyz = [item.cameraLon, item.cameraLat, item.cameraAltitude];
const xyz = [item.lon, item.lat, item.altitude];
const rxyz = [item.rotationX, item.rotationY, item.rotationZ];
@@ -383,7 +383,7 @@
// 创建对象
const obj = {
- sceneCode,
+ sceneId,
parentSceneCode,
sceneType,
sceneName,
@@ -401,25 +401,25 @@
}
} else {
// 在表格中排除根节点
- if (sceneCode != '00001') {
+ if (sceneId != '00001') {
allData.push(obj);
}
}
- // dataByCode.set(sceneCode, subObject);
+ // dataByCode.set(sceneId, subObject);
if (!isUpdateTree) {
// 全量加载的所有根节点
- if (sceneCode.indexOf('-') == -1) {
+ if (sceneId.indexOf('-') == -1) {
rootNodes.value.push({
- key: sceneCode,
+ key: sceneId,
title: sceneName,
children: [],
});
}
} else {
// 增量新增的根节点
- if (sceneCode.indexOf('-') == -1) {
+ if (sceneId.indexOf('-') == -1) {
addRootNode = {
- key: sceneCode,
+ key: sceneId,
title: sceneName,
children: [],
};
@@ -473,7 +473,7 @@
const params = { pageIndex: 1, pageSize: 9999 };
if (filter.value && filter.value.length > 0) {
// 新增查询条件
- params.sceneCode = filter.value;
+ params.sceneId = filter.value;
}
querySceneList(params).then((res) => {
if (res.code == 200) {
@@ -483,7 +483,7 @@
// 成功请求时,修改该节点标题
currentSelectNode.title = record.sceneName;
// 更新原始数据
- dataByCode.set(record.sceneCode, record);
+ dataByCode.set(record.sceneId, record);
// 更新树
treeData.value = [...treeData.value];
}
@@ -502,7 +502,7 @@
if (childDatas != null) {
for (const childData of childDatas) {
const childNode = {
- key: childData.sceneCode,
+ key: childData.sceneId,
title: childData.sceneName,
children: [],
};
@@ -526,13 +526,13 @@
//当原始数据大于等于节点数时,走更新和新增逻辑
if (childDatas.length >= childNodes.length) {
for (const childData of childDatas) {
- const found = childNodes.find((element) => element.key == childData.sceneCode);
+ const found = childNodes.find((element) => element.key == childData.sceneId);
// 更新节点
if (found) {
found.title = childData.sceneName;
} else {
const childNode = {
- key: childData.sceneCode,
+ key: childData.sceneId,
title: childData.sceneName,
children: [],
};
@@ -545,7 +545,7 @@
// index要删除的下标
let index = 0;
for (const childNode of childNodes) {
- const findIndex = childDatas.findIndex((element) => element.sceneCode == childNode.key);
+ const findIndex = childDatas.findIndex((element) => element.sceneId == childNode.key);
index++;
if (findIndex > -1) {
continue;
@@ -602,7 +602,7 @@
visible.value = true;
} else if (doType === 'delete') {
const formData = new FormData();
- formData.append('sceneCode', item.sceneCode + '*');
+ formData.append('sceneId', item.sceneId + '*');
deleteScene(formData).then((res) => {
if (res.code == 200) {
message.info('删除成功');
@@ -657,13 +657,13 @@
if (datas.length > 0) {
// 排序
datas.sort((a, b) => {
- const pathA = a.sceneCode.split('-');
+ const pathA = a.sceneId.split('-');
const aIndex = pathA[pathA.length - 1];
- const pathB = b.sceneCode.split('-');
+ const pathB = b.sceneId.split('-');
const bIndex = pathB[pathB.length - 1];
return Number(bIndex) - Number(aIndex);
});
- const maxPath = datas[0].sceneCode.split('-');
+ const maxPath = datas[0].sceneId.split('-');
// 更新下个新增子节点的作弊
nextNodeIndex.value = Number(maxPath[maxPath.length - 1]) + 1;
} else {
diff --git a/src/views/military/modules/earthMap/scene/model/Modal.vue b/src/views/military/modules/earthMap/scene/model/Modal.vue
index 2ad6b1b..c159af3 100644
--- a/src/views/military/modules/earthMap/scene/model/Modal.vue
+++ b/src/views/military/modules/earthMap/scene/model/Modal.vue
@@ -34,7 +34,7 @@
};
// 模态框绑定对象
const subObject = ref({
- sceneCode: '',
+ sceneId: '',
sceneName: '',
parentSceneCode: '',
sceneType: 1,
@@ -56,7 +56,7 @@
await nextTick();
// 更新数据
if (editInfo.value && editInfo.value.id != null) {
- subObject.value.sceneCode = editInfo.value.sceneCode;
+ subObject.value.sceneId = editInfo.value.sceneId;
subObject.value.parentSceneCode = editInfo.value.parentSceneCode;
subObject.value.sceneType = editInfo.value.sceneType;
subObject.value.sceneName = editInfo.value.sceneName;
@@ -94,7 +94,7 @@
} else {
// 新增数据
subObject.value = {
- sceneCode: '',
+ sceneId: '',
sceneName: '',
parentSceneCode: '',
sceneType: 1,
@@ -112,7 +112,7 @@
icon: '',
};
// 生成sceneCode
- subObject.value.sceneCode = sceneInfo.value.createCode();
+ subObject.value.sceneId = sceneInfo.value.createCode();
subObject.value.parentSceneCode = 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 b4ffdd3..5115b27 100644
--- a/src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue
+++ b/src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue
@@ -3,7 +3,7 @@
@@ -139,13 +139,13 @@
currentCode += '0';
}
currentCode += nextNodeIndexStr;
- let sceneCode = null;
+ let sceneId = null;
if (parentNodeCode.value.length > 0) {
- sceneCode = parentNodeCode.value + '-' + currentCode;
+ sceneId = parentNodeCode.value + '-' + currentCode;
} else {
- sceneCode = currentCode;
+ sceneId = currentCode;
}
- return sceneCode;
+ return sceneId;
};
// 提交
const handleOk = function () {
diff --git a/src/views/military/modules/mapScene/components/MsMapSceneForm.vue b/src/views/military/modules/mapScene/components/MsMapSceneForm.vue
index 2c1b679..ca718ef 100644
--- a/src/views/military/modules/mapScene/components/MsMapSceneForm.vue
+++ b/src/views/military/modules/mapScene/components/MsMapSceneForm.vue
@@ -8,7 +8,7 @@
-->
-
+
{{ department.departName }}
@@ -103,7 +103,7 @@ const formData = reactive>({
rotationZ: undefined,
viewDistance: undefined,
duration: undefined,
- sceneCode: undefined,
+ sceneId: undefined,
sysOrgCode: undefined,
});
const { createMessage } = useMessage();
@@ -205,7 +205,7 @@ function handleChange(value, option) {
console.log(depart);
formData.sysOrgCode = depart.orgCode
- formData.sceneCode = depart.orgCode
+ formData.sceneId = depart.orgCode
formData.sceneName = depart.departName
}