Browse Source

1.修改字段SceneId

2.地球edit 暂时无法使用
master
DIAMOND 1 year ago
parent
commit
6efe63bb2a
  1. 160
      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

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

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 =
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({

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-input v-model:value="formData.sceneId" placeholder="请输入所属场景" :disabled="disabled"></a-input> -->
<a-select v-model:value="formData.sceneId" placeholder="请选择所属场景" :disabled="disabled">
<template :key="code.sceneCode" v-for="code in sceneCodeList">
<a-select-option :value="code.sceneCode">{{ code.sceneName }}</a-select-option>
<template :key="code.sceneId" v-for="code in sceneCodeList">
<a-select-option :value="code.sceneId">{{ code.sceneName }}</a-select-option>
</template>
</a-select>
</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({
url: '/military/msMapScene/list',
params: {
sceneCode: sceneId,
sceneId: sceneId,
}
}, { isTransformResponse: false }).then((response) => {
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="20">
<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
}}</a-select-option>
</a-select>
@ -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,

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

@ -69,7 +69,7 @@
</scene-info>
</a-tab-pane> -->
<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 }">
<div class="action-div">
<a-tooltip placement="top">
@ -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 {

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

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

@ -3,7 +3,7 @@
<a-row :gutter="[0, 16]">
<!-- <a-col :span="11" :offset="1">
<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 :span="23">
<slot name="header"></slot>
@ -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 () {

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

@ -8,7 +8,7 @@
</a-form-item> -->
<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">
{{ department.departName }}
</a-select-option>
@ -103,7 +103,7 @@ const formData = reactive<Record<string, any>>({
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
}

Loading…
Cancel
Save