export default {
  initData({dispatch}) {
    dispatch('getLandPopulationInfo')
    dispatch('getGreenInfo')
  },
  getLandPopulationInfo({commit}) {
    setTimeout(() => {
      const result = [
        {
          label: '2018年末',
          data: [
            {value: 8.69, unit: 'k㎡', dec: 2},
            {value: 29182, unit: '人'},
            {value: 3358, unit: 'k㎡'},
            {value: 1.08, unit: '%', dec: 2},
          ],
        },
        {
          label: '2019年末',
          data: [
            {value: 8.69, unit: 'k㎡', dec: 2},
            {value: 31676, unit: '人', up: true},
            {value: 3645, unit: 'k㎡', up: true},
            {value: 1.18, unit: '%', dec: 2, up: true},
          ],
        },
      ]
      commit('SET_LAND_POPULATION_INFO', result)
    }, 1000)
  },
  getGreenInfo({commit}) {
    setTimeout(() => {
      const result = [
        {name: '环卫公厕', value: 9},
        {name: '生活垃圾收集', value: 98},
        {name: '小型压缩站', value: 34},
      ]
      commit('SET_GREEN_INFO', result)
    }, 1000)
  },
}
