소스 검색

更新 运输安全管理搜索逻辑

wzh 4 년 전
부모
커밋
ed12c2cb7e
1개의 변경된 파일18개의 추가작업 그리고 1개의 파일을 삭제
  1. 18 1
      src/views/transportationSafetyCenter.vue

+ 18 - 1
src/views/transportationSafetyCenter.vue

@@ -3,6 +3,9 @@
     <div id="bmap"></div>
     <ShipSearch
       class="ship-search z20"
+      :api="'searchShipSelect'"
+      v-model="shipStr"
+      @selectItem="selectShip"
       style="position: absolute; top: 40px; right: 524px"
     ></ShipSearch>
     <NumberVue
@@ -39,6 +42,7 @@
 import ShipSearch from "comps/ShipSearch.vue";
 import router from "router/index";
 import store from "store/index";
+import api from "apis/fetch";
 import { ref, onMounted, watch } from "vue";
 export default {
   components: {
@@ -66,14 +70,27 @@ export default {
         arr.value = e;
       });
     }
+    let shipStr = ref("");
+
+    function selectShip(item) {
+      if (store.state.currentTabText == "运输安全管理中心") {
+        store.dispatch("GetManageShipDetail", item.key);
+      }
+      if (store.state.currentTabText == "智能交易中心") {
+        getTradeShipDetail(item.key);
+      }
+    }
 
     onMounted(() => {
-      initMap();
+      // initMap();
+      // store.dispatch("GetManageShipDetail", 51710);
       getNumbers(store.state.currentTabText == "运输安全管理中心");
     });
     return {
       initMap,
       arr,
+      shipStr,
+      selectShip,
     };
   },
 };