Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
杨明
/
scrm-micro-config
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 6cc526c9
authored
Nov 05, 2021
by
李长胜
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
角色修改
1 parent
72c66bbb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
src/views/role/components/selectProduct.vue
src/views/role/create.vue
src/views/role/components/selectProduct.vue
View file @
6cc526c
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
util
from
"@/utils/util"
;
import
util
from
'@/utils/util'
export
default
{
export
default
{
name
:
'product'
,
name
:
'product'
,
props
:
{
props
:
{
...
@@ -76,10 +76,11 @@ export default {
...
@@ -76,10 +76,11 @@ export default {
this
.
productTab
=
this
.
tabMenu
.
find
(
i
=>
i
.
accounttypeId
==
tabId
).
productsArr
[
0
].
productId
this
.
productTab
=
this
.
tabMenu
.
find
(
i
=>
i
.
accounttypeId
==
tabId
).
productsArr
[
0
].
productId
},
},
selectPro
(
data
)
{
selectPro
(
data
)
{
this
.
$parent
.
roleRootRules
=
false
this
.
$parent
.
editStatus
=
true
this
.
$parent
.
editStatus
=
true
this
.
productTab
=
data
.
length
!=
0
?
data
[
data
.
length
-
1
].
productId
:
''
this
.
productTab
=
data
.
length
!=
0
?
data
[
data
.
length
-
1
].
productId
:
''
const
{
tabName
,
tabMenu
,
productTab
}
=
this
const
{
tabName
,
tabMenu
,
productTab
}
=
this
console
.
log
(
tabName
,
data
)
console
.
log
(
tabName
,
data
,
productTab
,
'选中'
)
// 设置全选
// 设置全选
var
arr
=
tabMenu
.
find
(
i
=>
i
.
accounttypeId
==
tabName
).
products
.
find
(
j
=>
j
.
productId
==
productTab
).
merchantProTreeResponses
var
arr
=
tabMenu
.
find
(
i
=>
i
.
accounttypeId
==
tabName
).
products
.
find
(
j
=>
j
.
productId
==
productTab
).
merchantProTreeResponses
this
.
$refs
[
`tree_
${
tabName
}
_
${
productTab
}
`
][
0
].
setCheckedKeys
(
this
.
getAllId
(
arr
))
this
.
$refs
[
`tree_
${
tabName
}
_
${
productTab
}
`
][
0
].
setCheckedKeys
(
this
.
getAllId
(
arr
))
...
@@ -90,13 +91,12 @@ export default {
...
@@ -90,13 +91,12 @@ export default {
},
},
findMenuFunTree
(
arr
)
{
findMenuFunTree
(
arr
)
{
let
tabMenu
=
util
.
deepClone
(
this
.
tabMenu_r
)
let
tabMenu
=
util
.
deepClone
(
this
.
tabMenu_r
)
this
.
tabMenu
=
tabMenu
.
filter
(
item
=>
arr
.
includes
(
item
.
accounttypeId
))
this
.
tabMenu
=
tabMenu
.
filter
(
item
=>
arr
.
includes
(
item
.
accounttypeId
))
},
},
// 获取当前的所有权限
// 获取当前的所有权限
async
findMenuFunTreeByMerId
(
params
)
{
async
findMenuFunTreeByMerId
(
params
)
{
let
tabMenu
=
await
this
.
$apis
.
store
.
findMenuFunTreeByMerId
(
params
)
let
tabMenu
=
await
this
.
$apis
.
store
.
findMenuFunTreeByMerId
(
params
)
tabMenu
=
tabMenu
tabMenu
=
tabMenu
.
map
(
item
=>
{
.
map
(
item
=>
{
return
{
return
{
productsArr
:
[],
productsArr
:
[],
products
:
item
.
products
,
products
:
item
.
products
,
...
@@ -141,7 +141,7 @@ export default {
...
@@ -141,7 +141,7 @@ export default {
accounttypeId
:
item
.
accounttypeId
accounttypeId
:
item
.
accounttypeId
}
}
})
})
this
.
tabMenu_s
=
util
.
deepClone
(
this
.
accountList
)
;
this
.
tabMenu_s
=
util
.
deepClone
(
this
.
accountList
)
// this.tabName = this.tabMenu[0].accounttypeId
// this.tabName = this.tabMenu[0].accounttypeId
this
.
findPermissionsByMerId
(
arr
)
this
.
findPermissionsByMerId
(
arr
)
this
.
tabMenu_r
=
util
.
deepClone
(
this
.
accountList
)
this
.
tabMenu_r
=
util
.
deepClone
(
this
.
accountList
)
...
@@ -170,8 +170,8 @@ export default {
...
@@ -170,8 +170,8 @@ export default {
this
.
productTab
=
this
.
tabMenu
[
0
].
productsArr
[
0
].
productId
this
.
productTab
=
this
.
tabMenu
[
0
].
productsArr
[
0
].
productId
},
},
resetView
()
{
resetView
()
{
this
.
tabMenu
=
[]
;
this
.
tabMenu
=
[]
this
.
accountList
=
util
.
deepClone
(
this
.
tabMenu_s
)
;
this
.
accountList
=
util
.
deepClone
(
this
.
tabMenu_s
)
this
.
tabMenu_x
.
forEach
(
item
=>
{
this
.
tabMenu_x
.
forEach
(
item
=>
{
this
.
accountList
.
forEach
(
itm
=>
{
this
.
accountList
.
forEach
(
itm
=>
{
console
.
log
(
itm
)
console
.
log
(
itm
)
...
...
src/views/role/create.vue
View file @
6cc526c
...
@@ -184,7 +184,7 @@ export default {
...
@@ -184,7 +184,7 @@ export default {
this
.
rootList
.
forEach
(
item
=>
{
this
.
rootList
.
forEach
(
item
=>
{
accounttypeId
.
push
(
item
.
accounttypeId
)
accounttypeId
.
push
(
item
.
accounttypeId
)
})
})
console
.
log
(
this
.
rootList
,
accounttypeId
,
'99999'
)
this
.
accounttypeIds
=
accounttypeId
this
.
accounttypeIds
=
accounttypeId
this
.
$refs
.
productFrom
.
findMenuFunTree
(
accounttypeId
)
this
.
$refs
.
productFrom
.
findMenuFunTree
(
accounttypeId
)
},
},
...
@@ -203,7 +203,7 @@ export default {
...
@@ -203,7 +203,7 @@ export default {
return
return
}
}
this
.
roleRootRules
=
false
this
.
roleRootRules
=
false
if
(
this
.
accounttypeIds
.
length
==
0
)
{
if
(
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
||
this
.
$refs
.
productFrom
.
productTab
===
''
)
{
this
.
roleRootRules
=
true
this
.
roleRootRules
=
true
return
return
}
}
...
@@ -226,9 +226,8 @@ export default {
...
@@ -226,9 +226,8 @@ export default {
if
(
valid
)
{
if
(
valid
)
{
let
accountTypes
=
JSON
.
stringify
(
this
.
$refs
.
productFrom
.
getSelectInfo
())
let
accountTypes
=
JSON
.
stringify
(
this
.
$refs
.
productFrom
.
getSelectInfo
())
this
.
roleRootRules
=
false
this
.
roleRootRules
=
false
if
(
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
)
{
if
(
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
||
this
.
$refs
.
productFrom
.
productTab
===
''
)
{
this
.
roleRootRules
=
true
this
.
roleRootRules
=
true
return
return
}
}
let
para
=
{
let
para
=
{
...
@@ -246,6 +245,12 @@ export default {
...
@@ -246,6 +245,12 @@ export default {
}
}
}
}
})
})
// console.log('外面', this.$refs.productFrom.getSelectInfo().length, this.$refs.productFrom.productTab)
this
.
roleRootRules
=
false
if
(
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
||
this
.
$refs
.
productFrom
.
productTab
===
''
)
{
this
.
roleRootRules
=
true
return
}
}
}
},
},
insertRole
(
para
)
{
insertRole
(
para
)
{
...
...
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