const station = {
  state: {
    stationIp: sessionStorage.getItem('stationIp') ? sessionStorage.getItem('stationIp') : '',
    stationNumber: sessionStorage.getItem('stationNumber') ? sessionStorage.getItem('stationNumber') : '',
    stationName: sessionStorage.getItem('stationName') ? sessionStorage.getItem('stationName') : '',
    classesID: sessionStorage.getItem('classesID') ? sessionStorage.getItem('classesID') : '',
    MesWebCode: sessionStorage.getItem('MesWebCode') ? sessionStorage.getItem('MesWebCode') : '',
    classes: sessionStorage.getItem('classes') ? sessionStorage.getItem('classes') : '',
    engineValue: JSON.parse(sessionStorage.getItem('engineValue')) ? JSON.parse(sessionStorage.getItem('engineValue')) : {},
    stationStatus: 0,
    plcStatus: 0,
    stationUserCount: sessionStorage.getItem('stationUserCount') ? sessionStorage.getItem('stationUserCount') : '',
    stationUserName: sessionStorage.getItem('stationUserName') ? sessionStorage.getItem('stationUserName') : '',
    stationNameUsed: sessionStorage.getItem('stationNameUsed') ? sessionStorage.getItem('stationNameUsed') : ''
  },
  mutations: {
    set_stationIp(state, stationIp) {
      sessionStorage.setItem('stationIp', stationIp)
      state.stationIp = stationIp
    },
    set_stationNumber(state, stationNumber) {
      sessionStorage.setItem('stationNumber', stationNumber)
      state.stationNumber = stationNumber
    },
    set_stationName(state, stationName) {
      sessionStorage.setItem('stationName', stationName)
      state.stationName = stationName
    },
    set_classesID(state, classesID) {
      sessionStorage.setItem('classesID', classesID)
      state.classesID = classesID
    },
    set_stationUserName(state, stationUserName) {
      sessionStorage.setItem('stationUserName', stationUserName)
      state.stationUserName = stationUserName
    },
    set_stationUserCount(state, stationUserCount) {
      sessionStorage.setItem('stationUserCount', stationUserCount)
      state.stationUserCount = stationUserCount
    },
    set_classes(state, classes) {
      sessionStorage.setItem('classes', classes)
      state.classes = classes
    },
    set_MesWebCode(state, MesWebCode) {
      sessionStorage.setItem('MesWebCode', MesWebCode)
      state.MesWebCode = MesWebCode
    },
    set_engineValue(state, engineValue) {
      sessionStorage.setItem('engineValue', JSON.stringify(engineValue))
      state.engineValue = engineValue
    },
    set_stationStatus(state, stationStatus) {
      state.stationStatus = stationStatus
    },
    set_plcStatus(state, plcStatus) {
      state.plcStatus = plcStatus
    }
  }
}
export default station
