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
0a9b8640
Commit
0a9b8640
authored
Jul 30, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
智能发现获取方法更新
parent
d6fd6ce0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
10 deletions
+28
-10
actions.js
src/store/actions.js
+1
-1
common.js
src/util/common.js
+7
-0
smart-discover.vue
src/views/components/smart-discover.vue
+20
-9
No files found.
src/store/actions.js
View file @
0a9b8640
...
@@ -133,7 +133,7 @@ export default {
...
@@ -133,7 +133,7 @@ export default {
}).
then
(
res
=>
{
}).
then
(
res
=>
{
const
sum
=
{
done
:
0
,
today
:
0
}
const
sum
=
{
done
:
0
,
today
:
0
}
const
data
=
com
.
confirm
(
res
,
'data.content'
,
[])
const
data
=
com
.
confirm
(
res
,
'data.content'
,
[])
const
keys
=
[
'accCtl'
,
'heap'
,
'nonVehicleCharg'
,
'streetMonitor'
]
const
keys
=
com
.
getTypesByStreetName
(
curStreet
)
// const keys = ['heap', 'parkFireExit', 'nonVehicleCharg', 'buildingVibration', 'trash', 'manholeCover', 'waterTank', 'roofWater', 'hermeticSpace', 'accCtl', 'streetMonitor']
// const keys = ['heap', 'parkFireExit', 'nonVehicleCharg', 'buildingVibration', 'trash', 'manholeCover', 'waterTank', 'roofWater', 'hermeticSpace', 'accCtl', 'streetMonitor']
const
result
=
data
.
filter
(
item
=>
keys
.
indexOf
(
item
.
types
)
>=
0
)
const
result
=
data
.
filter
(
item
=>
keys
.
indexOf
(
item
.
types
)
>=
0
)
result
.
forEach
(
e
=>
{
result
.
forEach
(
e
=>
{
...
...
src/util/common.js
View file @
0a9b8640
...
@@ -60,4 +60,11 @@ export default {
...
@@ -60,4 +60,11 @@ export default {
}
}
return
data
[
type
]
return
data
[
type
]
},
},
getTypesByStreetName
(
name
)
{
let
keys
=
[
'accCtl'
,
'heap'
,
'nonVehicleCharg'
,
'streetMonitor'
]
if
(
name
===
'长白新村街道'
)
{
keys
=
[
'accCtl'
,
'heap'
,
'nonVehicleCharg'
,
'fire'
]
}
return
keys
},
}
}
src/views/components/smart-discover.vue
View file @
0a9b8640
...
@@ -67,6 +67,9 @@ export default {
...
@@ -67,6 +67,9 @@ export default {
curSmartType
()
{
curSmartType
()
{
return
this
.
$store
.
state
.
curSmartType
return
this
.
$store
.
state
.
curSmartType
},
},
curStreetName
()
{
return
this
.
$store
.
state
.
currentStreetInfo
.
name
},
sum
()
{
sum
()
{
const
{
done
,
today
}
=
this
.
$store
.
state
.
discoverSum
const
{
done
,
today
}
=
this
.
$store
.
state
.
discoverSum
return
[
return
[
...
@@ -76,17 +79,25 @@ export default {
...
@@ -76,17 +79,25 @@ export default {
},
},
list
()
{
list
()
{
const
{
discoverInfo
}
=
this
.
$store
.
state
const
{
discoverInfo
}
=
this
.
$store
.
state
const
keys
=
[
'accCtl'
,
'heap'
,
'nonVehicleCharg'
,
'streetMonitor'
]
const
keys
=
this
.
$com
.
getTypesByStreetName
(
this
.
curStreetName
)
const
result
=
[]
const
result
=
[]
for
(
let
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
const
item
=
discoverInfo
.
find
(
e
=>
e
&&
e
.
types
===
keys
[
i
])
const
item
=
discoverInfo
.
find
(
e
=>
e
&&
e
.
types
===
keys
[
i
])
if
(
!
item
)
return
if
(
!
item
)
{
result
.
push
({
result
.
push
({
name
:
this
.
$com
.
transType
(
item
.
types
),
name
:
this
.
$com
.
transType
(
keys
[
i
]),
value
:
+
item
.
numbers
||
0
,
value
:
0
,
types
:
item
.
types
,
types
:
keys
[
i
],
visible
:
this
.
calcVisible
(
item
.
types
),
visible
:
this
.
calcVisible
(
keys
[
i
]),
})
})
}
else
{
result
.
push
({
name
:
this
.
$com
.
transType
(
item
.
types
),
value
:
+
item
.
numbers
||
0
,
types
:
item
.
types
,
visible
:
this
.
calcVisible
(
item
.
types
),
})
}
}
}
return
result
return
result
}
}
...
@@ -98,7 +109,7 @@ export default {
...
@@ -98,7 +109,7 @@ export default {
}
}
},
},
calcVisible
(
type
)
{
calcVisible
(
type
)
{
const
{
name
}
=
this
.
$store
.
state
.
currentStreetInfo
const
name
=
this
.
curStreetName
const
keys
=
[
const
keys
=
[
'平凉路街道'
,
'平凉路街道'
,
'控江路街道'
,
'控江路街道'
,
...
...
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