Sfoglia il codice sorgente

预警参数据问题

CzRger 4 giorni fa
parent
commit
380af4b1cf
2 ha cambiato i file con 12 aggiunte e 7 eliminazioni
  1. 1 1
      src/views/web/warning/assistant.vue
  2. 11 6
      src/views/web/warning/index.vue

+ 1 - 1
src/views/web/warning/assistant.vue

@@ -22,7 +22,7 @@
         </div>
         <div class="infos">
           <div>预警时间</div>
-          <div>{{ infoCpt.warnTime }}</div>
+          <div>{{ $util.YMDHms(infoCpt.warnTime) }}</div>
           <template v-if="infoCpt.areaName">
             <div>预警区域</div>
             <div>{{ infoCpt.areaName }}</div>

+ 11 - 6
src/views/web/warning/index.vue

@@ -23,7 +23,7 @@
         <CusFormColumn
             :span="16"
             labelWidth="0px"
-            v-model:param="state.query.form.targetName"
+            v-model:param="state.query.form.mergeDynamicShip.targetName"
             class="search"
         >
           <template #append>
@@ -151,7 +151,7 @@ import {warnModelRuleTree} from "@/api/modules/web/model";
 import {useDictionaryStore, useShipMapStore} from "@/stores";
 import {warnRecordList} from "@/api/modules/web/record";
 import {ElMessage} from "element-plus";
-import {YMDHms} from "@/utils/util";
+import {YMD, YMDHms} from "@/utils/util";
 
 const emit = defineEmits(['update:show'])
 
@@ -237,15 +237,19 @@ const onSearch = () => {
   state.query.formReal = JSON.parse(JSON.stringify(state.query.form))
   onPage(1, state.query.page.pageSize)
 }
-const onReset = () => {
+const onReset = (init = true) => {
   state.query.page = {
     pageNum: 1,
     pageSize: 10
   }
   state.query.form = {
+    startTime: `${YMD(new Date())} 00:00:00`,
+    endTime: `${YMD(new Date().getTime() + 1000 * 60 * 60 * 24)} 00:00:00`,
     mergeDynamicShip: {}
   }
-  onSearch()
+  if (init) {
+    onSearch()
+  }
 }
 const onMore = () => {
   state.more.layout.top = state.layout.top
@@ -254,17 +258,18 @@ const onMore = () => {
 }
 watch(() => ShipMapStore.warningParams, (n) => {
   if (n) {
-    onReset()
+    onReset(false)
     state.query.form.ruleName = n.ruleName
     state.query.form.mergeDynamicShip.mergeTarget = n.mergeTarget
     state.query.form.startTime = YMDHms(n.warnTime)
-    state.query.form.endTime = YMDHms(n.warnTime)
+    state.query.form.endTime = YMDHms(new Date(n.warnTime).getTime() + 1000)
     emit('update:show', true)
     onMore()
     onSearch()
   }
 })
 onMounted(() => {
+  onReset()
   warnModelRuleTree().then(res => {
     DictionaryStore.initOtherDict('warningModel', res.data.map(v => {
       v.dictLabel = v.name