فهرست منبع

更新 store数据

wzh 3 سال پیش
والد
کامیت
9e295e69c0
2فایلهای تغییر یافته به همراه17 افزوده شده و 7 حذف شده
  1. 2 2
      src/components/ShipSearch.vue
  2. 15 5
      src/store/index.js

+ 2 - 2
src/components/ShipSearch.vue

@@ -30,7 +30,7 @@ export default {
       type: Boolean,
       default: true,
     },
-    api: String,
+    searchapi: String,
     params: Object,
     value: String,
   },
@@ -40,7 +40,7 @@ export default {
     const getSelectList = _.debounce(
       async (queryString, cb) => {
         if (queryString.length < 2) return;
-        let res = await api[props.api]({
+        let res = await api[props.searchapi]({
           term: queryString,
         });
         if (res.data.status == 0) {

+ 15 - 5
src/store/index.js

@@ -97,8 +97,9 @@ const store = createStore({
       { name: "议价能力评分", score: 156, level: "高" },
     ],
     voyages: [
-      // { dischargePort: "沙市", loadPort: "张家港" },
-      // { dischargePort: "沙市", loadPort: "张家港" },
+      { dischargePort: "南昌", loadPort: "南通" },
+      { dischargePort: "阳逻", loadPort: "南通" },
+      { dischargePort: "浠水", loadPort: "南通" },
     ],
     shipsCache: [],
   },
@@ -141,7 +142,7 @@ const store = createStore({
       state.shipInfo.data[0].text = data.shipMmsi;
       state.shipInfo.data[1].text = data.shipLength;
       state.shipInfo.data[2].text = data.shipBreadth;
-      state.voyages = data.historyVoyages;
+      // state.voyages = data.historyVoyages;
       state.certificates = data.certificates;
     },
     setShipsCache(state, ships) {
@@ -181,12 +182,12 @@ const store = createStore({
 
       state.capacity = {};
 
-      state.voyages = [];
+      // state.voyages = [];
 
       state.certificates = [];
     },
     clearCargoOwnerInfo(state) {
-      cargoOwnerInfo = {
+      state.cargoOwnerInfo = {
         cargoOwnerName: "",
         contractId: 1,
         data: [
@@ -209,6 +210,15 @@ const store = createStore({
         ],
       };
     },
+    setAiCenterShipInfo(state, data) {
+      state.shipInfo.shipName = data.shipName;
+      state.shipInfo.shipOwnerName = data.shipownerName;
+      state.shipInfo.shipOwnerId = data.shipownerIdcard;
+      state.shipInfo.data[0].text = data.shipMmsi;
+      state.shipInfo.data[1].text = data.shipLength;
+      state.shipInfo.data[2].text = data.shipBreadth;
+      state.certificates = data.certificates;
+    },
   },
   actions: {
     Login({ commit }, userInfo) {