Browse Source

额外参数

CzRger 2 years ago
parent
commit
0da9f8b570
2 changed files with 23 additions and 2 deletions
  1. 4 0
      src/out/config.js
  2. 19 2
      src/views/init-speed-track/index.vue

+ 4 - 0
src/out/config.js

@@ -12,5 +12,9 @@ window.cusConfig = {
       label: '全球AIS',
       color: '#409eff'
     }],
+  ],
+  trackParams: [
+    {value: 'delay', label: '延时', init: 0},
+    {value: 'batchNum', label: '批次号', init: 0},
   ]
 }

+ 19 - 2
src/views/init-speed-track/index.vue

@@ -39,6 +39,11 @@
           </div>
         </template>
         <div class="track-point">
+          <template v-for="item in formParams">
+            <div class="item">
+              <span>{{item.label}}:</span><el-input v-model="form[item.value]" clearable/>
+            </div>
+          </template>
           <template v-for="(item, index) in trackPointList">
             <div class="point">
               <div class="position">
@@ -92,6 +97,7 @@ export default defineComponent({
     const store = useStore()
     const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
     const SourceMap = new Map(window.cusConfig.trackSource)
+    const formParams = window.cusConfig.trackParams
     const state = reactive({
       map: <any>null,
       mapFunc: null,
@@ -103,8 +109,12 @@ export default defineComponent({
       initTrackPointStartCount: 0,
       initTrackPointEndCount: 0,
       initTrackPointList: [],
-      loading: false
+      loading: false,
+      form: {}
     });
+    formParams.forEach(v => {
+      state.form[v.value] = v.init
+    })
     const mapLoad = (map: null, func: null) => {
       state.map = map
       state.mapFunc = func
@@ -359,6 +369,7 @@ export default defineComponent({
           }
         })
       }
+      Object.assign(obj, state.form)
       const result = JSON.parse(JSON.stringify(obj))
       console.log(result)
       state.loading = true
@@ -467,7 +478,8 @@ export default defineComponent({
       onPointFocus,
       SourceMap,
       onSubmit,
-      handleShow
+      handleShow,
+      formParams
     }
   }
 })
@@ -503,6 +515,11 @@ export default defineComponent({
     .track-point {
       overflow-y: auto;
       max-height: 600px;
+      .item {
+        display: flex;
+        align-items: center;
+        white-space: nowrap;
+      }
       .point {
         display: flex;
         .position {