Commit 91208d23 authored by 郭铭瑶's avatar 郭铭瑶 🤘

公共环境下-给新江湾添加静态数据

parent c2c3683f
......@@ -25,7 +25,16 @@ export default {
dispatch('getDoneList')
dispatch('getHealthInfo')
},
async getGreenInfo({commit}) {
async getGreenInfo({state, commit}) {
if (state.currentStreetInfo.name === '新江湾城街道') {
const result = [
{name: '环卫公厕', value: 10},
{name: '生活垃圾收集', value: 98},
{name: '小型压缩站', value: 34},
]
commit('SET_GREEN_INFO', result)
return
}
const result = [
{name: '环卫公厕', value: await ajax.get({url: api.DATA_URL + api.GET_TOILET_COUNT, params: {street: curStreet}}) || 0},
{name: '生活垃圾收集', value: await ajax.get({url: api.DATA_URL + api.GET_GARBAGE_COUNT, params: {street: curStreet}}) || 0},
......@@ -75,7 +84,12 @@ export default {
commit('SET_CHECK_SUM', com.confirm(res, 'data.content', {}))
})
},
async getGridSum({commit}) {
async getGridSum({state, commit}) {
if (state.currentStreetInfo.name === '新江湾城街道') {
commit('SET_GRID_SUM', [0, 0, 0])
commit('SET_NOT_ALERT_SUM', [19, 0, 2571])
return
}
const start = moment().add(-10, 'days').format('YYYY-MM-DD')
const end = moment().format('YYYY-MM-DD')
const total = await ajax.get({url: api.DATA_URL + api.GET_GRID_TOTAL, params: {street: curStreet, start, end}})
......@@ -87,7 +101,25 @@ export default {
const overdue2 = await ajax.get({url: api.DATA_URL + api.GET_NOT_ALERT_OVERDUE, params: {street: curStreet, start, end}})
commit('SET_NOT_ALERT_SUM', [+overdue2 || 0, +solving2 || 0, +total2 || 0])
},
async getPopulationInfo({commit}) {
async getPopulationInfo({state, commit}) {
if (state.currentStreetInfo.name === '新江湾城街道') {
const result = [
{
year: '2018',
area: 60.61,
registered_population: 1074138,
population_density: 17722,
},
{
year: '2019',
area: 60.61,
registered_population: 1067017,
population_density: 17605,
},
]
commit('SET_LAND_POPULATION_INFO', result)
return
}
const year1 = await ajax.get({url: api.DATA_URL + api.GET_POPULATION_INFO, params: {year: moment().add(-2, 'y').format('YYYY')}})
const year2 = await ajax.get({url: api.DATA_URL + api.GET_POPULATION_INFO, params: {year: moment().add(-1, 'y').format('YYYY')}})
if (year1 && year2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment