瀏覽代碼

预警记录参数

CzRger 5 天之前
父節點
當前提交
04f9e87d1c
共有 2 個文件被更改,包括 25 次插入10 次删除
  1. 5 2
      src/stores/ship-map/ship-map.ts
  2. 20 8
      src/views/web/warning/index.vue

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

@@ -1,6 +1,6 @@
 import {defineStore} from "pinia";
 import {ElMessage} from "element-plus";
-import {computed, reactive, toRefs} from "vue";
+import {computed, reactive, toRefs, watch} from "vue";
 import * as format from "ol/format";
 import * as layer from "ol/layer";
 import * as source from "ol/source";
@@ -13,7 +13,7 @@ import {shipArchiveDetail} from "@/api/modules/web/archive";
 
 export const useShipMapStore = defineStore('shipMap', () => {
   const state: any = reactive({
-    warningOpen: true,
+    warningOpen: localStorage.getItem('warningOpen') ? JSON.parse(localStorage.getItem('warningOpen')) : true,
     warningInfo: {},
     warningParams: {},
     map: null,
@@ -453,6 +453,9 @@ export const useShipMapStore = defineStore('shipMap', () => {
       }
     }
   }
+  watch(() => state.warningOpen, (n) => {
+    localStorage.setItem('warningOpen', n)
+  }, {immediate: true})
   return {
     ...toRefs(state),
     initMap,

+ 20 - 8
src/views/web/warning/index.vue

@@ -112,27 +112,27 @@
           <CusFormColumn
               :span="24"
               label="船名号"
-              v-model:param="state.query.form.targetName"
+              v-model:param="state.query.form.mergeDynamicShip.targetName"
           />
           <CusFormColumn
               :span="24"
               label="融合批次号"
-              v-model:param="state.query.form.mergeTarget"
+              v-model:param="state.query.form.mergeDynamicShip.mergeTarget"
           />
           <CusFormColumn
               :span="24"
               label="北斗终端号"
-              v-model:param="state.query.form.beidouId"
+              v-model:param="state.query.form.mergeDynamicShip.beidouId"
           />
           <CusFormColumn
               :span="24"
               label="MMSI"
-              v-model:param="state.query.form.mmsi"
+              v-model:param="state.query.form.mergeDynamicShip.mmsi"
           />
           <CusFormColumn
               :span="24"
               label="雷达批次号"
-              v-model:param="state.query.form.radarTargetId"
+              v-model:param="state.query.form.mergeDynamicShip.radarTargetId"
           />
         </CusForm>
       </div>
@@ -175,6 +175,7 @@ const state: any = reactive({
       pageSize: 10
     },
     form: {
+      mergeDynamicShip: {}
     },
     formReal: {},
     result: {
@@ -208,7 +209,16 @@ const onPage = (pageNum, pageSize) => {
   }
   //  添加表单参数
   for (const [k, v] of Object.entries(state.query.formReal)) {
-    if (proxy.$util.isValue(v)) {
+    if (k == 'mergeDynamicShip') {
+      for (const [k1, v1] of Object.entries(v)) {
+        if (proxy.$util.isValue(v1)) {
+          if (!params[k]) {
+            params[k] = {}
+          }
+          params[k][k1] = v1
+        }
+      }
+    } else if (proxy.$util.isValue(v)) {
       params[k] = v
     }
   }
@@ -232,7 +242,9 @@ const onReset = () => {
     pageNum: 1,
     pageSize: 10
   }
-  state.query.form = {}
+  state.query.form = {
+    mergeDynamicShip: {}
+  }
   onSearch()
 }
 const onMore = () => {
@@ -244,7 +256,7 @@ watch(() => ShipMapStore.warningParams, (n) => {
   if (n) {
     onReset()
     state.query.form.ruleName = n.ruleName
-    state.query.form.mergeTarget = n.mergeTarget
+    state.query.form.mergeDynamicShip.mergeTarget = n.mergeTarget
     state.query.form.startTime = YMDHms(n.warnTime)
     state.query.form.endTime = YMDHms(n.warnTime)
     emit('update:show', true)