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
22d855a6
authored
Aug 16, 2019
by
lirandong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复参数错误问题
parent
4e92c456
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
src/api/common.ts
+2
-2
src/app.tsx
+1
-1
src/pages/home/device/device_select/index.tsx
+6
-4
No files found.
src/api/common.ts
View file @
22d855a6
...
@@ -71,10 +71,10 @@ class UsersApi extends ApiClient {
...
@@ -71,10 +71,10 @@ class UsersApi extends ApiClient {
}
}
/** 更改设备绑定显示 */
/** 更改设备绑定显示 */
updateEquipmentBinding
(
filmIds
:
string
[],
filmId
:
string
)
{
updateEquipmentBinding
(
equipmentId
:
string
[],
filmId
:
string
)
{
return
this
.
request
({
return
this
.
request
({
url
:
`/template/update/equipment/binding/filmid`
,
url
:
`/template/update/equipment/binding/filmid`
,
data
:
{
equipmentId
:
filmId
,
filmId
:
filmIds
}
data
:
{
equipmentId
,
filmId
}
})
})
}
}
}
}
...
...
src/app.tsx
View file @
22d855a6
...
@@ -35,8 +35,8 @@ class App extends Component {
...
@@ -35,8 +35,8 @@ class App extends Component {
config
:
Config
=
{
config
:
Config
=
{
pages
:
[
pages
:
[
'pages/home/tempaltes/index'
,
'pages/home/tempaltes/index'
,
'pages/home/device/index'
,
'pages/home/device/device_select/index'
,
'pages/home/device/device_select/index'
,
'pages/home/device/index'
,
'pages/home/user/index'
,
'pages/home/user/index'
,
'pages/home/device/my_device/index'
,
'pages/home/device/my_device/index'
,
'pages/home/device/add/index'
,
'pages/home/device/add/index'
,
...
...
src/pages/home/device/device_select/index.tsx
View file @
22d855a6
...
@@ -70,16 +70,16 @@ class DeviceSelect extends Component {
...
@@ -70,16 +70,16 @@ class DeviceSelect extends Component {
}
}
}
}
changeItem
({
film
Id
})
{
changeItem
({
equipment
Id
})
{
if
(
this
.
state
.
checked
.
has
(
film
Id
))
{
if
(
this
.
state
.
checked
.
has
(
equipment
Id
))
{
this
.
state
.
checked
.
delete
(
film
Id
)
this
.
state
.
checked
.
delete
(
equipment
Id
)
const
newSet
=
this
.
state
.
checked
const
newSet
=
this
.
state
.
checked
this
.
setState
({
this
.
setState
({
checked
:
new
Set
([...
newSet
])
checked
:
new
Set
([...
newSet
])
})
})
}
else
{
}
else
{
this
.
setState
({
this
.
setState
({
checked
:
new
Set
([...
this
.
state
.
checked
,
film
Id
])
checked
:
new
Set
([...
this
.
state
.
checked
,
equipment
Id
])
})
})
}
}
// console.log({ item })
// console.log({ item })
...
@@ -87,7 +87,9 @@ class DeviceSelect extends Component {
...
@@ -87,7 +87,9 @@ class DeviceSelect extends Component {
async
updateBind
()
{
async
updateBind
()
{
const
{
checked
,
filmId
}
=
this
.
state
const
{
checked
,
filmId
}
=
this
.
state
if
(
!
filmId
)
return
try
{
try
{
// console.log({ filmId })
await
api
.
common
.
updateEquipmentBinding
([...
checked
],
filmId
)
await
api
.
common
.
updateEquipmentBinding
([...
checked
],
filmId
)
showMyToast
({
tips
:
'修改成功~'
})
showMyToast
({
tips
:
'修改成功~'
})
Taro
.
navigateBack
()
Taro
.
navigateBack
()
...
...
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