export default {
  getBankList: state => state.bankList,
  getBankName: state => bankId => {
    if (state.bankList !== null) {
      let res = ''
      state.bankList.forEach(item => {
        if (parseInt(item.bankId) === parseInt(bankId)) {
          res = item.bankName
        }
      })
      return res
    }
  },
  getBankFormSelect: state => {
    let result = []
    if (state.bankList !== null) {
      state.bankList.forEach(item => {
        result.push({
          value: item.bankId,
          text: item.bankName,
        })
      })
    }
    return result
  },
  getBankSwiftCode: state => bankId => {
    if (state.bankList !== null) {
      let res = ''
      state.bankList.forEach(item => {
        if (parseInt(item.bankId) === parseInt(bankId)) {
          res = item.bankSwiftCode
        }
      })
      return res
    }
  },
}
