Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a4932e02
authored
Feb 19, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
选择人员组件,添加禁用节点功能参数:disabledValues
1 parent
5a862e5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
linkwe-ui/src/components/SelectUser.vue
linkwe-ui/src/views/redPacketTool/staffManage.vue
linkwe-ui/src/components/SelectUser.vue
View file @
a4932e0
...
@@ -33,6 +33,11 @@ export default {
...
@@ -33,6 +33,11 @@ export default {
return
val
.
every
((
e
)
=>
e
.
userId
&&
e
.
name
)
return
val
.
every
((
e
)
=>
e
.
userId
&&
e
.
name
)
},
},
},
},
// 禁止选中的节点
disabledValues
:
{
type
:
Array
,
default
:
()
=>
[],
},
destroyOnClose
:
Boolean
,
destroyOnClose
:
Boolean
,
},
},
data
()
{
data
()
{
...
@@ -49,7 +54,7 @@ export default {
...
@@ -49,7 +54,7 @@ export default {
this
.
userList
=
[]
this
.
userList
=
[]
}
else
{
}
else
{
value
.
forEach
((
i
)
=>
{
value
.
forEach
((
i
)
=>
{
const
id
=
this
.
isOnlyLeaf
?
i
.
userId
:
i
.
userId
||
i
.
id
const
id
=
i
.
userId
||
i
.
id
if
(
id
)
{
if
(
id
)
{
checkedUserList
.
push
(
i
)
checkedUserList
.
push
(
i
)
}
}
...
@@ -60,9 +65,7 @@ export default {
...
@@ -60,9 +65,7 @@ export default {
Pvisible
(
val
)
{
Pvisible
(
val
)
{
val
&&
val
&&
this
.
$refs
.
tree
&&
this
.
$refs
.
tree
&&
this
.
$refs
.
tree
.
setCheckedKeys
(
this
.
$refs
.
tree
.
setCheckedKeys
(
this
.
defaultValues
.
map
((
e
)
=>
e
.
userId
||
e
.
id
))
this
.
defaultValues
.
map
((
e
)
=>
(
this
.
isOnlyLeaf
?
e
.
userId
:
e
.
userId
||
e
.
id
))
)
},
},
},
},
computed
:
{
computed
:
{
...
@@ -75,12 +78,15 @@ export default {
...
@@ -75,12 +78,15 @@ export default {
},
},
},
},
defaultProps
()
{
defaultProps
()
{
let
isOnlyLeaf
=
this
.
isOnlyLeaf
let
that
=
this
return
{
return
{
label
:
'name'
,
label
:
'name'
,
children
:
'children'
,
children
:
'children'
,
disabled
(
data
,
node
)
{
disabled
(
data
,
node
)
{
return
isOnlyLeaf
&&
data
.
isParty
return
(
(
that
.
isOnlyLeaf
&&
data
.
isParty
)
||
that
.
disabledValues
.
some
((
e
)
=>
e
==
(
data
.
userId
||
data
.
id
))
)
},
},
isLeaf
(
data
,
node
)
{
isLeaf
(
data
,
node
)
{
return
!
data
.
id
return
!
data
.
id
...
...
linkwe-ui/src/views/redPacketTool/staffManage.vue
View file @
a4932e0
...
@@ -130,6 +130,14 @@
...
@@ -130,6 +130,14 @@
:isOnlyLeaf=
"true"
:isOnlyLeaf=
"true"
:isSigleSelect=
"selectUserData.isSigleSelect"
:isSigleSelect=
"selectUserData.isSigleSelect"
:defaultValues=
"selectUserData.type == 1 ? queryUser : addMemberForm.users"
:defaultValues=
"selectUserData.type == 1 ? queryUser : addMemberForm.users"
:disabledValues=
"
selectUserData.type == 1
? queryUser
: list
.map((e) => e.userId)
.join()
.split(',')
"
destroyOnClose
destroyOnClose
@
success=
"submitSelectUser"
@
success=
"submitSelectUser"
></SelectUser>
></SelectUser>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment