|
@@ -51,7 +51,7 @@
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" @click="getJson(scope.row)">导入</el-button>
|
|
|
- <!-- <el-button type="primary" @click="saveJson()">保存</el-button> -->
|
|
|
+ <el-button type="primary" @click="changeItemPosition()">保存</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -74,7 +74,6 @@ import fireController from "../../api/fireController";
|
|
|
import { getToken } from "@/utils";
|
|
|
import axios from "axios";
|
|
|
import Model from "@/views/situation/Model";
|
|
|
-import satelliteModel from '@/assets/model/satelite.glb';
|
|
|
export default {
|
|
|
components: {
|
|
|
Model
|
|
@@ -204,8 +203,23 @@ export default {
|
|
|
// }
|
|
|
|
|
|
},
|
|
|
- changeItemPosition(data) {
|
|
|
+ changeItemPosition() {
|
|
|
+ const requestParams = {
|
|
|
+ path: 'get_position_by_time',
|
|
|
+ params: {dateTime:'2023-07-06 00:00:10'},
|
|
|
+ }
|
|
|
+ if(this.websocket && this.websocket.readyState === WebSocket.OPEN){
|
|
|
+ console.log(' 发送请求');
|
|
|
+ console.log('requestParams :>> ', requestParams);
|
|
|
+ this.websocket.send(JSON.stringify(requestParams));
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.startWebSocket();
|
|
|
+ setTimeout(() => {
|
|
|
+ this.websocket.send(JSON.stringify(requestParams));
|
|
|
+ }, 2000);
|
|
|
|
|
|
+ }
|
|
|
},
|
|
|
async getJson(row) {
|
|
|
this.viewer2D.entities.removeAll();
|
|
@@ -214,18 +228,23 @@ export default {
|
|
|
this.nameIdList = []
|
|
|
this.jsonData = {}
|
|
|
const requestData = row
|
|
|
- //发发送websockte请求
|
|
|
- // if(this.websocket && this.websocket.readyState === WebSocket.OPEN){
|
|
|
- // console.log(' 发送请求');
|
|
|
- // this.websocket.send(JSON.stringify(requestData));
|
|
|
- // }
|
|
|
- // else{
|
|
|
- // this.startWebSocket();
|
|
|
- // setTimeout(() => {
|
|
|
- // this.websocket.send(JSON.stringify(requestData));
|
|
|
- // }, 2000);
|
|
|
+ const requestParams = {
|
|
|
+ path: 'init',
|
|
|
+ params: requestData,
|
|
|
+ }
|
|
|
+ // 发发送websockte请求
|
|
|
+ if(this.websocket && this.websocket.readyState === WebSocket.OPEN){
|
|
|
+ console.log(' 发送请求');
|
|
|
+ console.log('requestParams :>> ', requestParams);
|
|
|
+ this.websocket.send(JSON.stringify(requestParams));
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.startWebSocket();
|
|
|
+ setTimeout(() => {
|
|
|
+ this.websocket.send(JSON.stringify(requestParams));
|
|
|
+ }, 2000);
|
|
|
|
|
|
- // }
|
|
|
+ }
|
|
|
let redunit = [];
|
|
|
let blueunit = [];
|
|
|
let satellite = [];
|
|
@@ -881,7 +900,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
for(let i = 0;i<this.jsonData.redunit.length;i++){
|
|
|
- if(name == this.jsonData.redunit.name){
|
|
|
+ if(name == this.jsonData.redunit[i].name){
|
|
|
this.jsonData.redunit.component_movementjson.properties.launch_lon = position.longitude.toFixed(6)
|
|
|
this.jsonData.redunit.component_movementjson.properties.launch_lat = position.latitude.toFixed(6)
|
|
|
this.jsonData.redunit.component_movementjson.properties.launch_h = position.height.toFixed(2)
|