瀏覽代碼

取值方式

CzRger 1 周之前
父節點
當前提交
424f00b0ae
共有 3 個文件被更改,包括 14 次插入17 次删除
  1. 1 1
      src/stores/ship-map/map-style.ts
  2. 4 5
      src/stores/ship-map/ship-map.ts
  3. 9 11
      src/views/web/track/index.vue

+ 1 - 1
src/stores/ship-map/map-style.ts

@@ -62,7 +62,7 @@ const ShipNormalStyle = ({course = 0, speed = 0, head = null, color = '#01f200',
     _style.push(new style.Style({
         image: new style.Icon({
             color: color,
-            src: eval(`shipIcon.${mergeType}`),
+            src: shipIcon[mergeType],
             rotation: allRotation,
             scale: 1
         }),

+ 4 - 5
src/stores/ship-map/ship-map.ts

@@ -199,7 +199,7 @@ export const useShipMapStore = defineStore('shipMap', () => {
           showArchive: true,
           archiveLayout: {
             width: 480,
-            top: 10,
+            top: 110,
             left: state.mapFunc.mapWidth - 350 - 10
           },
           archiveParams: {
@@ -339,10 +339,9 @@ export const useShipMapStore = defineStore('shipMap', () => {
       param.cql = idCql
     } else {
       param.cql = getBBOX()
-      // if (idCql) {
-      //   param.cql += ` or (${idCql})`
-      // }
-      // param.realCql = idCql
+      if (idCql) {
+        param.cql += ` or (${idCql})`
+      }
     }
     return JSON.stringify(param)
   }

+ 9 - 11
src/views/web/track/index.vue

@@ -63,20 +63,18 @@ const props = defineProps({
 const state: any = reactive({
   layout: {
     width: 480,
-    left: 70,
-    top: 10
+    left: 85,
+    top: 110
   },
 })
 const getDuration = (value) => {
-  // let start = null
-  // const end = value.real[value.real.length - 1].mergeTime
-  // if (value.history.length > 0) {
-  //   start = value.history[0].mergeTime
-  // } else if (value.real.length > 0) {
-  //   start = value.real[0].mergeTime
-  // }
-  const end = new Date().getTime()
-  const start = end - 1000 * 60 * 60
+  let start = null
+  const end = value.real[value.real.length - 1].mergeTime
+  if (value.history.length > 0) {
+    start = value.history[0].mergeTime
+  } else if (value.real.length > 0) {
+    start = value.real[0].mergeTime
+  }
   return comTimeByArea(start, end, true)
 }
 const handleColor = (value) => {