Browse Source

1.修改字段SceneId

2.地球edit 暂时无法使用
master
DIAMOND 1 year ago
parent
commit
6efe63bb2a
  1. 156
      src/views/earthMap/edit/EarthComp.vue
  2. 4707
      src/views/earthMap/edit/EarthComp20231225.vue
  3. 10
      src/views/earthMap/show/EarthComp.vue
  4. 4
      src/views/military/modules/ai/aiMonitorArea/components/DtAiMonitorAreaForm.vue
  5. 2
      src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue
  6. 6
      src/views/military/modules/earthMap/mapManage/modal/MapModel.vue
  7. 48
      src/views/military/modules/earthMap/scene/SceneManage.vue
  8. 8
      src/views/military/modules/earthMap/scene/model/Modal.vue
  9. 10
      src/views/military/modules/earthMap/scene/model/sceneInfo/SenceInfo.vue
  10. 6
      src/views/military/modules/mapScene/components/MsMapSceneForm.vue

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

@ -814,40 +814,19 @@
// //
this.listenMouseHandler(earthUI); this.listenMouseHandler(earthUI);
//
// // await this.fly();
// await this.getSceneInfo();
//
await this.newfly();
//线 //线
await this.createBBHLine(earthUI); await this.createBBHLine(earthUI);
// //
// await this.fly();
// //
// console.log("earthUI",earthUI);
this.toolbarShow = true 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 // 20231222
async newfly(){ async fly(){
let position, rotation, viewDistance, duration; let position, rotation, viewDistance, duration;
const sceneId = this.userStore.userInfo?.sceneId; const sceneId = this.userStore.userInfo?.sceneId;
await defHttp.get({ await defHttp.get({
@ -855,8 +834,8 @@
params: { params: {
pageNo: 1, pageNo: 1,
pageSize: 999, pageSize: 999,
sceneCode: sceneId + "*", sceneId: sceneId + "*",
column: 'sceneCode', column: 'sceneId',
order: 'asc', order: 'asc',
} }
}, { isTransformResponse: false }).then((response) => { }, { 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) { setLoginPoint(data) {
let position = [data.lon, data.lat, 0]; 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) { setIconByRef(ref, el) {
@ -1039,36 +922,27 @@
} }
/* 使用async/await 处理异步方法顺序执行。成功的操作放到try里,失败的放在catch里 */ /* 使用async/await 处理异步方法顺序执行。成功的操作放到try里,失败的放在catch里 */
async createBBHLine(earthUI= null) { async createBBHLine(earthUI= null) {
let models: any = null; console.log("MyScene",this.userStore.userInfo?.sceneId);
let type = 0; let type = 1; //**
if (!(this.sceneInfo instanceof Array)) {
type = 2; let models: any = {
models = {
ref: 'areas',
expand: true,
title: '岛礁',
children: [],
};
} else {
type = 1;
models = {
ref: 'main', ref: 'main',
expand: true, expand: true,
title: this.sceneInfo[0].sceneName, title: this.sceneInfo[0].sceneName,
children: [], children: [],
}; }
for (let record of this.sceneInfo) { for (let record of this.sceneInfo) {
if (record.parentSceneCode.length == 5) { if (record.sceneId == this.userStore.userInfo?.sceneId) {
continue; continue;
} }
models.children.push({ models.children.push({
ref: record.sysOrgCode, ref: record.sceneId,
expand: false, expand: false,
title: record.sceneName, title: record.sceneName,
children: [], children: [],
}); });
} }
}
console.log('models',models); console.log('models',models);
// //
@ -1774,6 +1648,8 @@
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);
if (res.success) { if (res.success) {
const labelItems = await this.setLabel(res.result, models, type); const labelItems = await this.setLabel(res.result, models, type);
resolve(labelItems); resolve(labelItems);

4707
src/views/earthMap/edit/EarthComp20231225.vue

File diff suppressed because it is too large

10
src/views/earthMap/show/EarthComp.vue

@ -813,13 +813,13 @@
let parentData = let parentData =
this.sceneInfo instanceof Array this.sceneInfo instanceof Array
? this.sceneInfo.filter((item, index) => { ? this.sceneInfo.filter((item, index) => {
return item.sceneCode == "00001-00001"; return item.sceneId == "00001-00001";
}) })
: this.sceneInfo; : this.sceneInfo;
// //
let data = this.sceneInfo instanceof Array ? let data = this.sceneInfo instanceof Array ?
this.sceneInfo.filter((item, index) => { this.sceneInfo.filter((item, index) => {
return item.sceneCode.length > 3; return item.sceneId.length > 3;
}) })
: this.sceneInfo; : this.sceneInfo;
// console.log("data",data); // console.log("data",data);
@ -850,7 +850,7 @@
this._earth.camera.flyTo(position, viewDistance, rotation, duration); this._earth.camera.flyTo(position, viewDistance, rotation, duration);
}; };
for (let record of data) { for (let record of data) {
if (record.sceneCode.length == 11) { if (record.sceneId.length == 11) {
continue; continue;
} }
// //
@ -915,7 +915,7 @@
params: { params: {
pageNo: 1, pageNo: 1,
pageSize: 999, pageSize: 999,
sceneCode: "00001-00001*", sceneId: "00001-00001*",
column: 'sysOrgCode', column: 'sysOrgCode',
order: 'asc', order: 'asc',
} }
@ -982,7 +982,7 @@
children: [], children: [],
}; };
for (let record of this.sceneInfo) { for (let record of this.sceneInfo) {
if (record.parentSceneCode.length == 5) { if (record.parentSceneId.length == 5) {
continue; continue;
} }
models.children.push({ models.children.push({

4
src/views/military/modules/ai/aiMonitorArea/components/DtAiMonitorAreaForm.vue

@ -64,8 +64,8 @@
<a-form-item label="所属场景" v-bind="validateInfos.sceneId" name="sceneId"> <a-form-item label="所属场景" v-bind="validateInfos.sceneId" name="sceneId">
<!-- <a-input v-model:value="formData.sceneId" placeholder="请输入所属场景" :disabled="disabled"></a-input> --> <!-- <a-input v-model:value="formData.sceneId" placeholder="请输入所属场景" :disabled="disabled"></a-input> -->
<a-select v-model:value="formData.sceneId" placeholder="请选择所属场景" :disabled="disabled"> <a-select v-model:value="formData.sceneId" placeholder="请选择所属场景" :disabled="disabled">
<template :key="code.sceneCode" v-for="code in sceneCodeList"> <template :key="code.sceneId" v-for="code in sceneCodeList">
<a-select-option :value="code.sceneCode">{{ code.sceneName }}</a-select-option> <a-select-option :value="code.sceneId">{{ code.sceneName }}</a-select-option>
</template> </template>
</a-select> </a-select>
</a-form-item> </a-form-item>

2
src/views/military/modules/ai/monitorArea/components/VCEarthViewer.vue

@ -469,7 +469,7 @@ async function fly(viewer: any = null) {
await defHttp.get({ await defHttp.get({
url: '/military/msMapScene/list', url: '/military/msMapScene/list',
params: { params: {
sceneCode: sceneId, sceneId: sceneId,
} }
}, { isTransformResponse: false }).then((response) => { }, { isTransformResponse: false }).then((response) => {
let res = response.result.records[0] let res = response.result.records[0]

6
src/views/military/modules/earthMap/mapManage/modal/MapModel.vue

@ -85,7 +85,7 @@
<a-col :span="4">绑定飞入点</a-col> <a-col :span="4">绑定飞入点</a-col>
<a-col :span="20"> <a-col :span="20">
<a-select class="map-fill" @change="flyPointerChange"> <a-select class="map-fill" @change="flyPointerChange">
<a-select-option :key="flyPointer.sceneCode" :value="index" v-for="(flyPointer, index) in flyPointers">{{ <a-select-option :key="flyPointer.sceneId" :value="index" v-for="(flyPointer, index) in flyPointers">{{
flyPointer.sceneName flyPointer.sceneName
}}</a-select-option> }}</a-select-option>
</a-select> </a-select>
@ -215,7 +215,7 @@
const records = res.result.records; const records = res.result.records;
flyPointers.value = []; flyPointers.value = [];
records.forEach((item) => { records.forEach((item) => {
const sceneCode = item.sceneCode; const sceneId = item.sceneId;
const sceneName = item.sceneName; const sceneName = item.sceneName;
const xyz = [item.lon, item.lat, item.altitude]; const xyz = [item.lon, item.lat, item.altitude];
const rxyz = [item.rotationX, item.rotationY, item.rotationZ]; const rxyz = [item.rotationX, item.rotationY, item.rotationZ];
@ -224,7 +224,7 @@
const builds = [item.rArea, item.rBuilder, item.rStock, item.rParkade]; const builds = [item.rArea, item.rBuilder, item.rStock, item.rParkade];
const id = item.id; const id = item.id;
const obj = { const obj = {
sceneCode, sceneId,
sceneName, sceneName,
xyz, xyz,
rxyz, rxyz,

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

@ -69,7 +69,7 @@
</scene-info> </scene-info>
</a-tab-pane> --> </a-tab-pane> -->
<a-tab-pane key="1" tab="子节点信息" :force-render="true"> <a-tab-pane key="1" tab="子节点信息" :force-render="true">
<a-table :columns="columns" :dataSource="dataSource" :pagination="{ defaultPageSize: 5 }" rowKey="sceneCode"> <a-table :columns="columns" :dataSource="dataSource" :pagination="{ defaultPageSize: 5 }" rowKey="sceneId">
<template #action="{ text, record }"> <template #action="{ text, record }">
<div class="action-div"> <div class="action-div">
<a-tooltip placement="top"> <a-tooltip placement="top">
@ -212,8 +212,8 @@
const columns = [ const columns = [
// { // {
// title: '', // title: '',
// dataIndex: 'sceneCode', // dataIndex: 'sceneId',
// key: 'sceneCode', // key: 'sceneId',
// align: 'center', // align: 'center',
// width: '6%', // width: '6%',
// }, // },
@ -302,7 +302,7 @@
let currentSelectNode = null; let currentSelectNode = null;
// //
const subObject = ref({ const subObject = ref({
sceneCode: '', sceneId: '',
sceneName: '', sceneName: '',
parentSceneCode: '', parentSceneCode: '',
sceneType: 1, sceneType: 1,
@ -367,12 +367,12 @@
} }
let addRootNode = null; let addRootNode = null;
records.forEach((item) => { records.forEach((item) => {
const sceneCode = item.sceneCode; const sceneId = item.sceneId;
// sceneCodes.push(sceneCode); // sceneCodes.push(sceneId);
const sceneName = item.sceneName; const sceneName = item.sceneName;
const sceneType = item.sceneType; const sceneType = item.sceneType;
const parentSceneCode = item.parentSceneCode; const parentSceneCode = item.parentSceneCode;
parentCodeArr.value.push(sceneCode); 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];
const rxyz = [item.rotationX, item.rotationY, item.rotationZ]; const rxyz = [item.rotationX, item.rotationY, item.rotationZ];
@ -383,7 +383,7 @@
// //
const obj = { const obj = {
sceneCode, sceneId,
parentSceneCode, parentSceneCode,
sceneType, sceneType,
sceneName, sceneName,
@ -401,25 +401,25 @@
} }
} else { } else {
// //
if (sceneCode != '00001') { if (sceneId != '00001') {
allData.push(obj); allData.push(obj);
} }
} }
// dataByCode.set(sceneCode, subObject); // dataByCode.set(sceneId, subObject);
if (!isUpdateTree) { if (!isUpdateTree) {
// //
if (sceneCode.indexOf('-') == -1) { if (sceneId.indexOf('-') == -1) {
rootNodes.value.push({ rootNodes.value.push({
key: sceneCode, key: sceneId,
title: sceneName, title: sceneName,
children: [], children: [],
}); });
} }
} else { } else {
// //
if (sceneCode.indexOf('-') == -1) { if (sceneId.indexOf('-') == -1) {
addRootNode = { addRootNode = {
key: sceneCode, key: sceneId,
title: sceneName, title: sceneName,
children: [], children: [],
}; };
@ -473,7 +473,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.sceneCode = filter.value; params.sceneId = filter.value;
} }
querySceneList(params).then((res) => { querySceneList(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -483,7 +483,7 @@
// //
currentSelectNode.title = record.sceneName; currentSelectNode.title = record.sceneName;
// //
dataByCode.set(record.sceneCode, record); dataByCode.set(record.sceneId, record);
// //
treeData.value = [...treeData.value]; treeData.value = [...treeData.value];
} }
@ -502,7 +502,7 @@
if (childDatas != null) { if (childDatas != null) {
for (const childData of childDatas) { for (const childData of childDatas) {
const childNode = { const childNode = {
key: childData.sceneCode, key: childData.sceneId,
title: childData.sceneName, title: childData.sceneName,
children: [], children: [],
}; };
@ -526,13 +526,13 @@
// //
if (childDatas.length >= childNodes.length) { if (childDatas.length >= childNodes.length) {
for (const childData of childDatas) { 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) { if (found) {
found.title = childData.sceneName; found.title = childData.sceneName;
} else { } else {
const childNode = { const childNode = {
key: childData.sceneCode, key: childData.sceneId,
title: childData.sceneName, title: childData.sceneName,
children: [], children: [],
}; };
@ -545,7 +545,7 @@
// index // index
let index = 0; let index = 0;
for (const childNode of childNodes) { for (const childNode of childNodes) {
const findIndex = childDatas.findIndex((element) => element.sceneCode == childNode.key); const findIndex = childDatas.findIndex((element) => element.sceneId == childNode.key);
index++; index++;
if (findIndex > -1) { if (findIndex > -1) {
continue; continue;
@ -602,7 +602,7 @@
visible.value = true; visible.value = true;
} else if (doType === 'delete') { } else if (doType === 'delete') {
const formData = new FormData(); const formData = new FormData();
formData.append('sceneCode', item.sceneCode + '*'); formData.append('sceneId', item.sceneId + '*');
deleteScene(formData).then((res) => { deleteScene(formData).then((res) => {
if (res.code == 200) { if (res.code == 200) {
message.info('删除成功'); message.info('删除成功');
@ -657,13 +657,13 @@
if (datas.length > 0) { if (datas.length > 0) {
// //
datas.sort((a, b) => { datas.sort((a, b) => {
const pathA = a.sceneCode.split('-'); const pathA = a.sceneId.split('-');
const aIndex = pathA[pathA.length - 1]; const aIndex = pathA[pathA.length - 1];
const pathB = b.sceneCode.split('-'); const pathB = b.sceneId.split('-');
const bIndex = pathB[pathB.length - 1]; const bIndex = pathB[pathB.length - 1];
return Number(bIndex) - Number(aIndex); 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; nextNodeIndex.value = Number(maxPath[maxPath.length - 1]) + 1;
} else { } else {

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

@ -34,7 +34,7 @@
}; };
// //
const subObject = ref({ const subObject = ref({
sceneCode: '', sceneId: '',
sceneName: '', sceneName: '',
parentSceneCode: '', parentSceneCode: '',
sceneType: 1, sceneType: 1,
@ -56,7 +56,7 @@
await nextTick(); await nextTick();
// //
if (editInfo.value && editInfo.value.id != null) { 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.parentSceneCode = editInfo.value.parentSceneCode;
subObject.value.sceneType = editInfo.value.sceneType; subObject.value.sceneType = editInfo.value.sceneType;
subObject.value.sceneName = editInfo.value.sceneName; subObject.value.sceneName = editInfo.value.sceneName;
@ -94,7 +94,7 @@
} else { } else {
// //
subObject.value = { subObject.value = {
sceneCode: '', sceneId: '',
sceneName: '', sceneName: '',
parentSceneCode: '', parentSceneCode: '',
sceneType: 1, sceneType: 1,
@ -112,7 +112,7 @@
icon: '', icon: '',
}; };
// sceneCode // sceneCode
subObject.value.sceneCode = sceneInfo.value.createCode(); subObject.value.sceneId = sceneInfo.value.createCode();
subObject.value.parentSceneCode = parentNodeCode.value; subObject.value.parentSceneCode = parentNodeCode.value;
} }
}); });

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

@ -3,7 +3,7 @@
<a-row :gutter="[0, 16]"> <a-row :gutter="[0, 16]">
<!-- <a-col :span="11" :offset="1"> <!-- <a-col :span="11" :offset="1">
<div>场景编号:</div> <div>场景编号:</div>
<a-input class="inputWidthCss1" v-model:value="subObject.sceneCode" :disabled="true"></a-input> <a-input class="inputWidthCss1" v-model:value="subObject.sceneId" :disabled="true"></a-input>
</a-col> --> </a-col> -->
<a-col :span="23"> <a-col :span="23">
<slot name="header"></slot> <slot name="header"></slot>
@ -139,13 +139,13 @@
currentCode += '0'; currentCode += '0';
} }
currentCode += nextNodeIndexStr; currentCode += nextNodeIndexStr;
let sceneCode = null; let sceneId = null;
if (parentNodeCode.value.length > 0) { if (parentNodeCode.value.length > 0) {
sceneCode = parentNodeCode.value + '-' + currentCode; sceneId = parentNodeCode.value + '-' + currentCode;
} else { } else {
sceneCode = currentCode; sceneId = currentCode;
} }
return sceneCode; return sceneId;
}; };
// //
const handleOk = function () { const handleOk = function () {

6
src/views/military/modules/mapScene/components/MsMapSceneForm.vue

@ -8,7 +8,7 @@
</a-form-item> --> </a-form-item> -->
<a-form-item label="场景名称" v-bind="validateInfos.sceneName"> <a-form-item label="场景名称" v-bind="validateInfos.sceneName">
<a-select v-model="formData.sceneCode" style="width: 100%" @change="handleChange" placeholder="请选择场景"> <a-select v-model="formData.sceneId" style="width: 100%" @change="handleChange" placeholder="请选择场景">
<a-select-option v-for="department in departments" :key="department.id" :value="department.orgCode"> <a-select-option v-for="department in departments" :key="department.id" :value="department.orgCode">
{{ department.departName }} {{ department.departName }}
</a-select-option> </a-select-option>
@ -103,7 +103,7 @@ const formData = reactive<Record<string, any>>({
rotationZ: undefined, rotationZ: undefined,
viewDistance: undefined, viewDistance: undefined,
duration: undefined, duration: undefined,
sceneCode: undefined, sceneId: undefined,
sysOrgCode: undefined, sysOrgCode: undefined,
}); });
const { createMessage } = useMessage(); const { createMessage } = useMessage();
@ -205,7 +205,7 @@ function handleChange(value, option) {
console.log(depart); console.log(depart);
formData.sysOrgCode = depart.orgCode formData.sysOrgCode = depart.orgCode
formData.sceneCode = depart.orgCode formData.sceneId = depart.orgCode
formData.sceneName = depart.departName formData.sceneName = depart.departName
} }

Loading…
Cancel
Save