const state = {
  // searchValue: '', // 企业/车场树搜索数据
  // selectNodeInfo: {} // 企业/车场树选中项
  treeData: [],
  proTreeData: []
}

const mutations = {
  updateTreeData: (state, value) => {
    state.treeData = value
  },
  updateProTreeData: (state, value) => {
    state.proTreeData = value
  }
  // UPDATE_SEARCH_VALUE: (state, value) => {
  //   state.searchValue = value
  // },
  // UPDATE_SELECT_NODE_INFO: (state, value) => {
  //   state.selectNodeInfo = value
  // }
}

const actions = {
  changeTreeData({ commit }) {
    request({
      url: '/tenterprises/getEntAndParkList',
      method: 'get'
    }).then((res) => {
      if (res.success) {
        commit('updateTreeData', res.data)
      }
    })
  }
}

import request from '@/utils/request'

export default {
  state,
  mutations,
  actions
}
