Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
east-nanjing-new
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
郭铭瑶
east-nanjing-new
Commits
aef8515a
Commit
aef8515a
authored
Apr 13, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据年份更改数据
parent
9a2581fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
index.ts
src/store/index.ts
+1
-1
public-safety.vue
src/view/right/public-safety.vue
+15
-2
No files found.
src/store/index.ts
View file @
aef8515a
...
@@ -30,7 +30,7 @@ export interface GlobalStateProps {
...
@@ -30,7 +30,7 @@ export interface GlobalStateProps {
pubulicSafeBuildings
:
unknown
[]
pubulicSafeBuildings
:
unknown
[]
pubulicSafePieData
:
unknown
[]
pubulicSafePieData
:
unknown
[]
pubulicSafeNewFindNum
:
{
[
key
:
string
]:
number
}
pubulicSafeNewFindNum
:
{
[
key
:
string
]:
number
}
pubulicSafeOutHouseWall
:
unknown
[]
pubulicSafeOutHouseWall
:
any
[]
}
}
export
default
createStore
<
GlobalStateProps
>
({
export
default
createStore
<
GlobalStateProps
>
({
state
,
state
,
...
...
src/view/right/public-safety.vue
View file @
aef8515a
...
@@ -146,12 +146,26 @@ export default defineComponent({
...
@@ -146,12 +146,26 @@ export default defineComponent({
const
year
=
ref
(
'2020'
)
//年份
const
year
=
ref
(
'2020'
)
//年份
const
yearOptions
=
ref
([
'2020'
,
'2019'
])
//年份option
const
yearOptions
=
ref
([
'2020'
,
'2019'
])
//年份option
const
houseSum
=
ref
([
const
houseSum
=
ref
([
{
name
:
'检查楼数'
,
value
:
0
},
{
name
:
'检查楼数'
,
value
:
0
},
{
name
:
'隐患点数'
,
value
:
0
},
{
name
:
'隐患点数'
,
value
:
0
},
{
name
:
'危险点数'
,
value
:
0
},
{
name
:
'危险点数'
,
value
:
0
},
])
])
watch
(
[()
=>
outHouseWall
.
value
,
()
=>
year
.
value
],
([
data
,
year
])
=>
{
if
(
data
.
length
===
0
)
return
const
{
checkNum
=
0
,
hiddenPoint
=
0
,
dangerPoint
=
0
}
=
data
.
find
(
(
e
:
any
)
=>
e
.
year
===
year
)
houseSum
.
value
=
[
{
name
:
'检查楼数'
,
value
:
checkNum
},
{
name
:
'隐患点数'
,
value
:
hiddenPoint
},
{
name
:
'危险点数'
,
value
:
dangerPoint
},
]
},
{
immediate
:
true
}
)
// { name: '检查楼数', value: outHouseWall.value.checkNum },
// { name: '检查楼数', value: outHouseWall.value.checkNum },
// { name: '隐患点数', value: outHouseWall.value.hiddenPoint },
// { name: '隐患点数', value: outHouseWall.value.hiddenPoint },
// { name: '危险点数', value: outHouseWall.value.dangerPoint },
// { name: '危险点数', value: outHouseWall.value.dangerPoint },
...
@@ -159,7 +173,6 @@ export default defineComponent({
...
@@ -159,7 +173,6 @@ export default defineComponent({
//切换年份
//切换年份
const
changeYear
=
(
value
:
string
)
=>
{
const
changeYear
=
(
value
:
string
)
=>
{
year
.
value
=
value
year
.
value
=
value
console
.
log
(
outHouseWall
.
value
)
// houseSum.value = [
// houseSum.value = [
// { name: '检查楼数', value: outHouseWall.value.checkNum },
// { name: '检查楼数', value: outHouseWall.value.checkNum },
// ]
// ]
...
...
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