Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-4
Overview
Overview
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
office
haoban-4
Commits
9fadac41
Commit
9fadac41
authored
Aug 12, 2020
by
无尘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修改授权回显禁用
parent
3fbcce36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
store-auth-group.vue
src/components/set/store-auth-group.vue
+25
-2
No files found.
src/components/set/store-auth-group.vue
View file @
9fadac41
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-07-21 10:10:57
* @LastEditors: 无尘
* @LastEditTime: 2020-08-1
0 13:56:23
* @LastEditTime: 2020-08-1
2 10:06:00
-->
<!--
门店绑定-选择分组(仅展示)
...
...
@@ -93,6 +93,7 @@ export default {
arr
.
children
.
forEach
(
ele
=>
{
that
.
$refs
.
groupTree
.
setChecked
(
ele
.
storeGroupId
,
checkFlag
,
true
);
// 递归子级禁用和选中
ele
.
disabled
=
true
;
if
(
!!
ele
.
children
&&
!!
ele
.
children
.
length
)
{
that
.
checkChild
(
ele
,
checkFlag
);
}
...
...
@@ -123,10 +124,32 @@ export default {
const
that
=
this
;
const
ids
=
that
.
selectGroup
.
map
(
ele
=>
ele
.
storeGroupId
);
that
.
groupData
.
forEach
(
ele
=>
{
ele
.
disabled
=
true
;
// 如果父级选中了,设置子级禁用
if
(
ids
.
includes
(
ele
.
storeGroupId
)
&&
!!
ele
.
children
.
length
)
{
that
.
checkChild
(
ele
,
true
);
}
// 如果父级没有选中,查找子级,再判断父级有没有禁用
if
(
!
ids
.
includes
(
ele
.
storeGroupId
))
{
that
.
disableChild
(
ele
,
ids
);
}
})
},
/**
* disableChild
*/
disableChild
(
arr
,
ids
)
{
const
that
=
this
;
arr
.
children
.
forEach
(
ele
=>
{
ele
.
disabled
=
true
;
// 如果父级选中了,设置子级禁用
if
(
ids
.
includes
(
ele
.
storeGroupId
)
&&
!!
ele
.
children
.
length
)
{
that
.
checkChild
(
ele
,
true
);
}
// 如果父级没有选中,查找子级,再判断父级有没有禁用
if
(
!
ids
.
includes
(
ele
.
storeGroupId
)
&&
!!
ele
.
children
.
length
)
{
that
.
disableChild
(
ele
,
ids
);
}
})
},
...
...
@@ -146,7 +169,7 @@ export default {
res
.
result
.
forEach
(
ele
=>
{
ele
.
expand
=
false
;
ele
.
children
=
[];
ele
.
disabled
=
tru
e
;
ele
.
disabled
=
fals
e
;
ele
.
label
=
ele
.
storeGroupName
;
});
}
...
...
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