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
a4b4a9b9
Commit
a4b4a9b9
authored
Aug 07, 2020
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口联调
parent
c1de60f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
30 deletions
+9
-30
edit-store-role.vue
src/views/enterprise/edit-store-role.vue
+9
-30
No files found.
src/views/enterprise/edit-store-role.vue
View file @
a4b4a9b9
...
...
@@ -102,29 +102,7 @@ export default {
initData
()
{
const
params
=
{
wxEnterpriseId
:
this
.
wxEnterpriseId
}
const
prom
=
[];
// eslint-disable-next-line
function
setMenu
(
label
,
parentId
,
level
)
{
let
result
=
[];
let
menu
=
[];
while
(
menu
.
length
<
3
)
{
const
item
=
{
menuId
:
`
${
parentId
}
-
${
menu
.
length
}
`
,
// 菜单id
menuName
:
`
${
label
}${
parentId
}
-
${
menu
.
length
}
`
,
// 菜单名称
level
,
// 层级
parentId
,
}
menu
.
push
(
item
);
if
(
level
<
2
)
{
result
=
result
.
concat
(
setMenu
(
label
,
item
.
menuId
,
level
+
1
));
}
}
return
menu
.
concat
(
result
);
}
this
.
tabList
.
forEach
(
el
=>
{
// el.menuList = this.flatDataToTree(setMenu(el.label, 0, 0));
// el.menuList.forEach(item => {
// this.$set(el.checkedId, item.menuId, []);
// });
// appType 1好办后台2应用后台3好办小程序4小程序应用
// roleType 1管理员角色 2门店角色
prom
.
push
(
menuList
(
Object
.
assign
({},
params
,
{
appType
:
el
.
appType
,
roleType
:
2
})).
then
(
res
=>
{
...
...
@@ -145,16 +123,17 @@ export default {
},
getRoleDetail
(
roleId
)
{
roleDetail
({
roleId
}).
then
(
res
=>
{
const
{
roleId
,
roleName
,
menuIds
,
resourceCode
}
=
res
.
result
||
{};
Object
.
assign
(
this
.
roleData
,
{
roleId
,
roleName
,
menuIds
:
JSON
.
parse
(
menuIds
||
'[]'
)
});
let
{
roleId
,
roleName
,
menuIds
,
resourceCode
}
=
res
.
result
||
{};
menuIds
=
typeof
menuIds
==
'string'
?
menuIds
.
split
(
','
)
:
[]
Object
.
assign
(
this
.
roleData
,
{
roleId
,
roleName
});
// 将menuIds分配到相应同的tab下的checkedId中
this
.
roleData
.
menuIds
.
forEach
(
el
=>
{
this
.
tabList
.
some
(
item
=>
{
item
.
menuList
.
forEach
(
menu
=>
{
item
.
checkedId
[
menu
.
menuId
]
=
getAllMenuId
([
menu
],
el
.
menuIds
||
[]);
})
return
item
.
appType
==
el
.
appType
;
this
.
tabList
.
forEach
(
el
=>
{
let
checkedId
=
[];
el
.
menuList
.
forEach
(
item
=>
{
el
.
checkedId
[
item
.
menuId
]
=
getAllMenuId
([
item
],
menuIds
);
checkedId
=
checkedId
.
concat
(
el
.
checkedId
[
item
.
menuId
]);
})
this
.
roleData
.
menuIds
.
push
({
appType
:
el
.
appType
,
menuIds
:
checkedId
});
})
if
(
typeof
resourceCode
==
'string'
&&
resourceCode
.
length
>
0
)
{
resourceCode
.
split
(
','
).
forEach
(
el
=>
{
...
...
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