import { buildingTreeList } from '@/api/buildingTree'

const transaction = {
  namespaced: true,
  state: {
    total: '',
    billList: []
  },

  mutations: {
    SET_LIST: (state, list) => {
      state.billList = list
    },
    SET_TOTAL: (state, total) => {
      state.total = total
    }
  },

  actions: {
    // 获取收费组列表
    BuildingTreeList({ commit }, listQuery) {
      return new Promise((resolve, reject) => {
        buildingTreeList(listQuery).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default transaction
