import {Vue} from 'vue-property-decorator'
import Vuex from 'vuex'

Vue.use(Vuex)
export default new Vuex.Store({
  state: {
    mapFun: null, // 封装了地图的方法
    mapInstance: null, // 地图实例
    dictionary: null, // 字典信息
    ship: null, // 船舶信息,
    showPort: false,
    shipFleet: null
  },
  mutations: {
    setData(state, data) {
      // @ts-ignore
      state[data.type] = data
    },
    setMapInstance(state, data) {
      state.mapInstance = data
    },
    setMapFun(state, data) {
      state.mapFun = data
    },
    setDataNull(state, data) {
      // @ts-ignore
      state[data.type] = data.data
    },
    setShowPort(state, data) {
      state.showPort = data
    },
    setShipFleet(state, data) {
      state.shipFleet = data
    }
  },
  actions: {},
  modules: {}
})
