@@ -25,562 +27,542 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/utils/earthMap/listenMouseHandler.ts b/src/utils/earthMap/listenMouseHandler.ts
index a18d0ce..df00d12 100644
--- a/src/utils/earthMap/listenMouseHandler.ts
+++ b/src/utils/earthMap/listenMouseHandler.ts
@@ -103,7 +103,12 @@ export default function listenMouseHandler(that) {
} else {
that.windowTitle = 'AIS信息';
}
+ // 打开信息窗口
that.AISInfoWindowShow = true;
+ // 关闭追踪窗口
+ that.TailAfterWindowShow = false;
+ // 同时隐藏场景树状结构
+ window.$uia.tools.sceneTree.show = false;
// 赋值船只场景id - 唯一标识 可通过该字段获取其余信息
that.ship_guid = pickedFeature.id.guid;
}
diff --git a/src/utils/earthMap/shipDraw.ts b/src/utils/earthMap/shipDraw.ts
index 117b2da..6f45c8a 100644
--- a/src/utils/earthMap/shipDraw.ts
+++ b/src/utils/earthMap/shipDraw.ts
@@ -2,7 +2,7 @@
* @Author: Fuyuu 1805498209@qq.com
* @Date: 2024-01-03 17:42:49
* @LastEditors: Fuyuu 1805498209@qq.com
- * @LastEditTime: 2024-01-26 16:30:29
+ * @LastEditTime: 2024-01-30 10:29:34
* @FilePath: \dt-admin-pc-v2\src\utils\earthMap\shipDraw.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -30,6 +30,23 @@ function toRadians(point) {
return window.Cesium.Math.toRadians(point);
}
+/**
+ * 时间戳转化为年月日时分秒
+ * @param timestamp 时间戳
+ */
+function toStringTime(timestamp) {
+ let date = new Date(timestamp);
+ let year = date.getFullYear();
+ let month = ('0' + (date.getMonth() + 1)).slice(-2);
+ let day = ('0' + date.getDate()).slice(-2);
+ let hour = ('0' + date.getHours()).slice(-2);
+ let minute = ('0' + date.getMinutes()).slice(-2);
+ let second = ('0' + date.getSeconds()).slice(-2);
+
+ let datetime = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
+ return datetime;
+}
+
/**
* 绘制船只
* @param shipItem 船只数据
@@ -70,6 +87,7 @@ export const drawRadarShipsList = function (radarItem, isShowRadarTrack, isShowR
// 是否已经存在
let existingShip = radarShipList.find((shipItem) => shipItem.trackId === radarData.trackId);
if (existingShip) {
+ console.log('新增轨迹...');
// 添加新的轨迹点
window.$earth.getObject(existingShip.track_guid).positions.push([toRadians(radarData.longitude), toRadians(radarData.latitude), 0]);
// 获取场景中的船只信息
@@ -78,7 +96,17 @@ export const drawRadarShipsList = function (radarItem, isShowRadarTrack, isShowR
shipData.xbsjPosition = [toRadians(radarData.longitude), toRadians(radarData.latitude), 0];
// 航向需要后续调整。。。
shipData.xbsjRotation = [(Math.PI / 180) * (radarData.course - 90), 0, 0];
+ // 更新船只数据(store)
+ existingShip.timestamp = toStringTime(radarData.timestamp);
+ existingShip.azimuth = radarData.azimuth;
+ existingShip.course = radarData.course;
+ existingShip.longitude = radarData.longitude;
+ existingShip.latitude = radarData.latitude;
+ existingShip.dis = radarData.dis;
+ existingShip.speed = radarData.speed;
+ existingShip.altitude = radarData.altitude;
} else {
+ console.log('新增船只...');
// 新增船只轨迹信息
let trackData = addShipTrack([[toRadians(radarData.longitude), toRadians(radarData.latitude), 0]], 1);
// 根据按钮状态决定轨迹显隐
@@ -87,8 +115,6 @@ export const drawRadarShipsList = function (radarItem, isShowRadarTrack, isShowR
let modelData = drawShips(radarData, 1);
// 根据按钮状态决定模型显隐
modelData.show = isShowRadarShip;
- // 将时间戳转换
- let time = new Date(Math.floor(radarData.timestamp / 1000) * 1000);
// 添加新的雷达船只
radarShipList.push({
name: `${radarData.trackId}号船_radar`, // 名称
@@ -96,7 +122,7 @@ export const drawRadarShipsList = function (radarItem, isShowRadarTrack, isShowR
guid: modelData.xbsjGuid, // 船只场景id
track_guid: trackData.xbsjGuid, // 根据不同的数据类型绘制不同的轨迹线 轨迹线guid,用于轨迹显隐
radarId: radarData.radarId, // 雷达ID
- timestamp: `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()} ${time.getHours()}:${time.getMinutes()}:${time.getSeconds()}`, // 时间
+ timestamp: toStringTime(radarData.timestamp), // 时间
azimuth: radarData.azimuth, // 方位角
course: radarData.course, // 航向
latitude: radarData.latitude, // 纬度
diff --git a/src/views/earthMap/edit/EarthComp.vue b/src/views/earthMap/edit/EarthComp.vue
index 0589fb2..0ed87f7 100644
--- a/src/views/earthMap/edit/EarthComp.vue
+++ b/src/views/earthMap/edit/EarthComp.vue
@@ -88,7 +88,7 @@
-
+
@@ -333,7 +333,7 @@
store = useEarthMapStore();
setLabelStatus: any = setLabelStatus;
setIconByRef: any = setIconByRef;
- earthTitle = '态势监控一张图';
+ earthTitle = '横琴新区环岛电子围网系统';
realTime = '……';
// 注意:Earth和Cesium的相关变量放在vue中,必须使用下划线作为前缀!
// _earth = undefined;
@@ -673,6 +673,7 @@
let sceneTree = earthUI.tools.sceneTree;
// 显示图层管理
sceneTree.show = this.PropsSceneTreeShow;
+ // sceneTree.show = false;
// 设置图层管理 ref 输入框的 回车 事件
// ref 输入框的
let sceneTreeInput = sceneTree._comp.$el.getElementsByClassName('xbsj-model-content-box')[0].children[1];