Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
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-3
Commits
5f0019c4
Commit
5f0019c4
authored
Oct 10, 2022
by
Jings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 权限添加新增code数组传参
parent
0f5d567d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
5 deletions
+33
-5
index.js
src/utils/index.js
+20
-0
guide-setting-new.vue
src/views/enterprise/guide-setting-new.vue
+13
-5
No files found.
src/utils/index.js
View file @
5f0019c4
...
@@ -590,4 +590,23 @@ export function getArrDifference(arr1,arr2) {
...
@@ -590,4 +590,23 @@ export function getArrDifference(arr1,arr2) {
}
}
})
})
return
result
;
return
result
;
}
// 过滤删除和新增
export
function
getDelOrAddDate
(
arr1
,
arr2
)
{
var
arr
=
[];
var
bool
=
false
;
for
(
var
i
=
0
;
i
<
arr1
.
length
;
i
++
){
for
(
var
j
=
0
;
j
<
arr2
.
length
;
j
++
){
//进行优化遇到相同直接跳出循环 同时支持对象比对
if
(
JSON
.
stringify
(
arr1
[
i
])
===
JSON
.
stringify
(
arr2
[
j
])){
bool
=
false
;
break
;
}
else
{
bool
=
i
;
}
}
if
(
bool
!==
false
)
arr
.
push
(
arr1
[
bool
]);
}
return
arr
;
}
}
\ No newline at end of file
src/views/enterprise/guide-setting-new.vue
View file @
5f0019c4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* @Author: Drama
* @Author: Drama
* @Date: 2022-09-14 11:09:43
* @Date: 2022-09-14 11:09:43
* @LastEditors: Drama
* @LastEditors: Drama
* @LastEditTime: 2022-10-
08 15:34:56
* @LastEditTime: 2022-10-
10 09:45:04
* @FilePath: /haoban-3/src/views/enterprise/guide-setting-new.vue
* @FilePath: /haoban-3/src/views/enterprise/guide-setting-new.vue
* Copyright (C) 2022 huzhenhong. All rights reserved.
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
-->
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
deepClone
,
arrToTree
,
getArrDifference
}
from
'@/utils'
;
import
{
deepClone
,
arrToTree
,
getArrDifference
,
getDelOrAddDate
}
from
'@/utils'
;
import
{
getRequest
,
postJsonRequest
}
from
'@/api/api'
;
import
{
getRequest
,
postJsonRequest
}
from
'@/api/api'
;
import
{
_debounce
}
from
'@/common/js/public'
;
import
{
_debounce
}
from
'@/common/js/public'
;
...
@@ -198,6 +198,11 @@ export default {
...
@@ -198,6 +198,11 @@ export default {
let
delMenu_0
=
getArrDifference
(
this
.
curMenuCode_0
,
this
.
saveWithoutParents_0
);
let
delMenu_0
=
getArrDifference
(
this
.
curMenuCode_0
,
this
.
saveWithoutParents_0
);
let
delMenu_1
=
getArrDifference
(
this
.
curMenuCode_1
,
this
.
saveWithoutParents_1
);
let
delMenu_1
=
getArrDifference
(
this
.
curMenuCode_1
,
this
.
saveWithoutParents_1
);
let
delMenu_2
=
getArrDifference
(
this
.
curMenuCode_2
,
this
.
saveWithoutParents_2
);
let
delMenu_2
=
getArrDifference
(
this
.
curMenuCode_2
,
this
.
saveWithoutParents_2
);
let
addMenu_0
=
getDelOrAddDate
(
this
.
saveWithoutParents_0
,
this
.
curMenuCode_0
);
let
addMenu_1
=
getDelOrAddDate
(
this
.
saveWithoutParents_1
,
this
.
curMenuCode_1
);
let
addMenu_2
=
getDelOrAddDate
(
this
.
saveWithoutParents_2
,
this
.
curMenuCode_2
);
if
(
!
errFlag_0
||
!
errFlag_1
||
!
errFlag_2
)
{
if
(
!
errFlag_0
||
!
errFlag_1
||
!
errFlag_2
)
{
this
.
$set
(
this
.
titleList
[
0
],
'isEmpty'
,
!
errFlag_0
);
this
.
$set
(
this
.
titleList
[
0
],
'isEmpty'
,
!
errFlag_0
);
this
.
$set
(
this
.
titleList
[
1
],
'isEmpty'
,
!
errFlag_1
);
this
.
$set
(
this
.
titleList
[
1
],
'isEmpty'
,
!
errFlag_1
);
...
@@ -211,21 +216,24 @@ export default {
...
@@ -211,21 +216,24 @@ export default {
clerkType
:
0
,
// 导购
clerkType
:
0
,
// 导购
// menuCodes: [...this.withoutParents_0], // 权限id
// menuCodes: [...this.withoutParents_0], // 权限id
menuCodes
:
[...
this
.
saveWithoutParents_0
],
// 权限id
menuCodes
:
[...
this
.
saveWithoutParents_0
],
// 权限id
delMenuCodes
:
delMenu_0
// 删除的code
delMenuCodes
:
delMenu_0
,
// 删除的code
addMenuCodes
:
addMenu_0
// 新增的code
},
},
manegeClerkMenus
:
{
manegeClerkMenus
:
{
roleId
:
this
.
roleId_1
,
roleId
:
this
.
roleId_1
,
clerkType
:
1
,
// 店长
clerkType
:
1
,
// 店长
// menuCodes: [...this.withoutParents_1],
// menuCodes: [...this.withoutParents_1],
menuCodes
:
[...
this
.
saveWithoutParents_1
],
menuCodes
:
[...
this
.
saveWithoutParents_1
],
delMenuCodes
:
delMenu_1
delMenuCodes
:
delMenu_1
,
addMenuCodes
:
addMenu_1
},
},
managerMenus
:
{
managerMenus
:
{
roleId
:
this
.
roleId_2
,
roleId
:
this
.
roleId_2
,
clerkType
:
2
,
// 区经
clerkType
:
2
,
// 区经
// menuCodes: [...this.withoutParents_2],
// menuCodes: [...this.withoutParents_2],
menuCodes
:
[...
this
.
saveWithoutParents_2
],
menuCodes
:
[...
this
.
saveWithoutParents_2
],
delMenuCodes
:
delMenu_2
delMenuCodes
:
delMenu_2
,
addMenuCodes
:
addMenu_2
}
}
};
};
postJsonRequest
(
'/haoban-manage3-web/role/edit'
,
para
).
then
(
async
res
=>
{
postJsonRequest
(
'/haoban-manage3-web/role/edit'
,
para
).
then
(
async
res
=>
{
...
...
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