Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e25e69c0
authored
Nov 11, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
c6f733b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
src/pages/home/device/group_detail/index.tsx
+6
-2
src/pages/home/device/group_list/index.tsx
+8
-3
src/pages/home/film/schedule_add/components/device/index.tsx
+10
-3
No files found.
src/pages/home/device/group_detail/index.tsx
View file @
e25e69c0
...
...
@@ -54,7 +54,7 @@ class DeviceGroup extends Component {
protected
page
=
1
constructor
(
props
:
any
)
{
super
(
props
)
const
{
id
}
=
this
.
$router
.
params
const
{
id
,
name
}
=
this
.
$router
.
params
this
.
state
=
{
deviceList
:
[],
showModal
:
false
,
...
...
@@ -63,7 +63,7 @@ class DeviceGroup extends Component {
}
this
.
selectAddDevice
=
this
.
selectAddDevice
.
bind
(
this
)
Taro
.
setNavigationBarTitle
({
title
:
'组详情'
title
:
String
(
name
+
'(0)'
)
})
}
...
...
@@ -76,8 +76,12 @@ class DeviceGroup extends Component {
this
.
getDate
()
}
async
getDate
()
{
const
{
name
}
=
this
.
$router
.
params
api
.
common
.
getGroupDevice
(
this
.
$router
.
params
.
id
).
then
(
res
=>
{
const
list
=
res
Taro
.
setNavigationBarTitle
({
title
:
String
(
name
+
`(
${
res
.
length
}
)`
)
})
this
.
setState
({
list
:
list
||
[]
})
...
...
src/pages/home/device/group_list/index.tsx
View file @
e25e69c0
...
...
@@ -138,8 +138,10 @@ class DeviceGroup extends Component {
},
500
)
}
goDetail
(
id
)
{
Taro
.
navigateTo
({
url
:
`/pages/home/device/group_detail/index?id=
${
id
}
`
})
goDetail
(
id
,
equipmentGroupName
)
{
Taro
.
navigateTo
({
url
:
`/pages/home/device/group_detail/index?id=
${
id
}
&name=
${
equipmentGroupName
}
`
})
}
inputConfirm
()
{
...
...
@@ -218,7 +220,10 @@ class DeviceGroup extends Component {
}
]
}
>
<
View
className=
"group-item"
onClick=
{
()
=>
this
.
goDetail
(
item
.
equipmentGroupId
)
}
>
<
View
className=
"group-item"
onClick=
{
()
=>
this
.
goDetail
(
item
.
equipmentGroupId
,
item
.
equipmentGroupName
)
}
>
<
View
className=
"group-item-content"
>
{
item
.
equipmentGroupName
}
(
{
item
.
equipmentCount
}
)
</
View
>
...
...
src/pages/home/film/schedule_add/components/device/index.tsx
View file @
e25e69c0
...
...
@@ -26,6 +26,7 @@ type PageState = {
groupList
:
any
[]
list
:
any
[]
activeIndex
:
number
allCount
:
string
}
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
...
...
@@ -51,7 +52,8 @@ class DeviceSelect extends Component {
groupList
:
[{
equipmentGroupName
:
'全部'
,
equipmentGroupId
:
''
,
equipmentCount
:
0
}],
activeIndex
:
0
,
searchName
:
''
,
list
:
[]
list
:
[],
allCount
:
''
}
this
.
updateBind
=
this
.
updateBind
.
bind
(
this
)
this
.
changeAllCheck
=
this
.
changeAllCheck
.
bind
(
this
)
...
...
@@ -86,6 +88,11 @@ class DeviceSelect extends Component {
getData
(
name
?:
string
|
''
)
{
const
groupId
=
this
.
state
.
groupList
[
this
.
state
.
activeIndex
][
'equipmentGroupId'
]
api
.
common
.
getGroupDevice
(
groupId
,
name
).
then
(
res
=>
{
if
(
!
groupId
)
{
this
.
setState
({
allCount
:
res
.
length
})
}
this
.
setState
({
list
:
res
||
[]
})
...
...
@@ -244,11 +251,11 @@ class DeviceSelect extends Component {
}
render
()
{
const
{
checked
,
showModal
,
groupList
,
list
,
activeIndex
}
=
this
.
state
const
{
checked
,
showModal
,
groupList
,
list
,
activeIndex
,
allCount
}
=
this
.
state
const
{
size
}
=
checked
let
items
=
groupList
.
map
(
item
=>
{
if
(
item
.
equipmentGroupName
===
'全部'
)
{
return
item
.
equipmentGroupName
+
` (
${
list
.
length
}
)`
return
item
.
equipmentGroupName
+
` (
${
allCount
}
)`
}
return
item
.
equipmentGroupName
+
` (
${
item
.
equipmentCount
}
)`
})
...
...
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