Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yangpu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭铭瑶
yangpu
Commits
91208d23
Commit
91208d23
authored
Nov 24, 2020
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公共环境下-给新江湾添加静态数据
parent
c2c3683f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
3 deletions
+35
-3
actions.js
src/store/actions.js
+35
-3
No files found.
src/store/actions.js
View file @
91208d23
...
@@ -25,7 +25,16 @@ export default {
...
@@ -25,7 +25,16 @@ export default {
dispatch
(
'getDoneList'
)
dispatch
(
'getDoneList'
)
dispatch
(
'getHealthInfo'
)
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
=
[
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_TOILET_COUNT
,
params
:
{
street
:
curStreet
}})
||
0
},
{
name
:
'生活垃圾收集'
,
value
:
await
ajax
.
get
({
url
:
api
.
DATA_URL
+
api
.
GET_GARBAGE_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 {
...
@@ -75,7 +84,12 @@ export default {
commit
(
'SET_CHECK_SUM'
,
com
.
confirm
(
res
,
'data.content'
,
{}))
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
start
=
moment
().
add
(
-
10
,
'days'
).
format
(
'YYYY-MM-DD'
)
const
end
=
moment
().
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
}})
const
total
=
await
ajax
.
get
({
url
:
api
.
DATA_URL
+
api
.
GET_GRID_TOTAL
,
params
:
{
street
:
curStreet
,
start
,
end
}})
...
@@ -87,7 +101,25 @@ export default {
...
@@ -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
}})
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
])
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
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'
)}})
const
year2
=
await
ajax
.
get
({
url
:
api
.
DATA_URL
+
api
.
GET_POPULATION_INFO
,
params
:
{
year
:
moment
().
add
(
-
1
,
'y'
).
format
(
'YYYY'
)}})
if
(
year1
&&
year2
)
{
if
(
year1
&&
year2
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment