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 72c66bbb
authored
Nov 04, 2021
by
李长胜
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
角色修改
1 parent
63d9111f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
15 deletions
src/views/role/create.vue
src/views/role/index.vue
src/views/role/look.vue
src/views/role/create.vue
View file @
72c66bb
...
...
@@ -20,7 +20,7 @@
<el-form-item
label=
"角色说明"
prop=
"roleDesc"
>
<el-input
size=
"small"
style=
"width: 40%"
v-model=
"ruleForm.roleDesc"
placeholder=
"请输入角色说明"
></el-input>
</el-form-item>
<el-form-item
label=
"角色权限"
prop=
"roleRoot"
>
<!--
<el-form-item
label=
"角色权限"
prop=
"roleRoot"
>
<div
class=
"custom_element"
>
<template
v-for=
"(item, index) in accountList"
>
<div
:key=
"index"
class=
"wrap"
>
...
...
@@ -28,7 +28,29 @@
</div>
</
template
>
</div>
</el-form-item>
</el-form-item>
-->
<el-row>
<el-col
:span=
"16"
>
<div
data-v-995a4ff0=
""
class=
"el-form-item is-required"
>
<label
for=
"roleName"
class=
"el-form-item__label"
style=
"width: 100px"
>
角色权限
</label>
<div
class=
"el-form-item__content"
style=
"margin-left: 100px"
>
<!-- <div data-v-995a4ff0="" class="el-input el-input--small">
<auto-button v-for="(item, index) in accountDetail.accountTypes" :key="index" :btnLabel="item.accounttypeName" :btnValue="item.accounttypeId" :stopClick="nextStatus" @getBtnStatus="getBtnStatus"></auto-button>
</div> -->
<div
class=
"custom_element"
>
<
template
v-for=
"(item, index) in accountList"
>
<div
:key=
"index"
class=
"wrap"
>
<AutoButton
@
getBtnStatus=
"selectCurAccount(item, index)"
:typeStatus=
"item.select"
:btnLabel=
"item.accounttypeName"
></AutoButton>
</div>
</
template
>
</div>
<div
class=
"el-form-item__error"
v-if=
"roleRootRules"
>
请选择角色权限
</div>
</div>
</div>
</el-col>
</el-row>
</el-form>
</div>
</div>
...
...
@@ -65,6 +87,8 @@ export default {
data
()
{
return
{
roleRootRules
:
false
,
accounttypeIds
:
[],
ruleForm
:
{
merchantId
:
''
,
roleName
:
''
,
...
...
@@ -100,7 +124,7 @@ export default {
merchantId
:
res
.
merchantId
}
this
.
getMerchantTree
(
id
,
res
.
responseList
)
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
:
res
.
merchantId
},
this
.
roleInfo
.
responseList
)
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
:
res
.
merchantId
},
this
.
roleInfo
.
responseList
)
})
},
// 获取商户树
...
...
@@ -144,6 +168,7 @@ export default {
},
// 选择商户权限
selectCurAccount
(
item
,
index
)
{
this
.
roleRootRules
=
false
this
.
accountList
[
index
].
select
=
!
item
.
select
this
.
curRootIndex
=
0
if
(
this
.
accountList
[
index
].
select
)
{
...
...
@@ -154,10 +179,13 @@ export default {
})
this
.
rootList
=
arr
}
let
accounttypeId
=
[];
this
.
rootList
.
forEach
(
item
=>
{
let
accounttypeId
=
[]
this
.
rootList
.
forEach
(
item
=>
{
accounttypeId
.
push
(
item
.
accounttypeId
)
})
this
.
accounttypeIds
=
accounttypeId
this
.
$refs
.
productFrom
.
findMenuFunTree
(
accounttypeId
)
},
...
...
@@ -169,10 +197,16 @@ export default {
this
.
$refs
.
ruleForm
.
validateField
(
'merchantId'
)
return
}
if
(
!
roleName
||
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
)
{
this
.
$message
.
error
(
'角色和权限至少选择一项'
)
return
}
this
.
roleRootRules
=
false
if
(
this
.
accounttypeIds
.
length
==
0
)
{
this
.
roleRootRules
=
true
return
}
let
accountTypes
=
JSON
.
stringify
(
this
.
$refs
.
productFrom
.
getSelectInfo
())
let
para
=
{
merchantId
:
merchantId
,
...
...
@@ -191,6 +225,12 @@ export default {
this
.
$refs
.
ruleForm
.
validate
(
valid
=>
{
if
(
valid
)
{
let
accountTypes
=
JSON
.
stringify
(
this
.
$refs
.
productFrom
.
getSelectInfo
())
this
.
roleRootRules
=
false
if
(
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
)
{
this
.
roleRootRules
=
true
return
}
let
para
=
{
merchantId
:
merchantId
,
roleName
:
roleName
,
...
...
@@ -247,7 +287,7 @@ export default {
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
}
}
;
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/role/index.vue
View file @
72c66bb
...
...
@@ -160,15 +160,15 @@ export default {
},
// 去创建角色页面
toCreatePage
()
{
this
.
$router
.
push
(
"/role/create/"
+
0
);
this
.
$router
.
push
(
'/role/create/'
+
0
)
},
// 去查看角色页面
toLookPage
(
row
)
{
this
.
$router
.
push
(
"/role/look/"
+
row
.
id
);
this
.
$router
.
push
(
'/role/look/'
+
row
.
id
)
},
// 去修改角色页面
toEditPage
(
row
)
{
this
.
$router
.
push
(
"/role/create/"
+
row
.
id
);
this
.
$router
.
push
(
'/role/create/'
+
row
.
id
)
},
// 去删除草稿
todelete
(
row
)
{
...
...
@@ -188,8 +188,7 @@ export default {
}
})
})
.
catch
(()
=>
{
})
.
catch
(()
=>
{})
}
},
...
...
@@ -206,7 +205,7 @@ export default {
mounted
()
{
this
.
getTableData
()
}
}
;
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/role/look.vue
View file @
72c66bb
...
...
@@ -31,7 +31,7 @@
<div
v-for=
"(item, index) in productList"
:key=
"index"
class=
"line_element_two"
:class=
"curProductIndex == index ? 'line_element_two_active' : ''"
@
click=
"selectProductItem(index)"
>
{{
item
.
productName
}}
</div>
</div>
<div
class=
"tree_widget"
>
<el-tree
v-if=
"productList.length"
:data=
"productList[curProductIndex].merchantProTreeResponses"
:props=
"defaultProps"
></el-tree>
<el-tree
v-if=
"productList.length"
default-expand-all
:data=
"productList[curProductIndex].merchantProTreeResponses"
:props=
"defaultProps"
></el-tree>
<div
v-if=
"productList.length == 0"
class=
"no_data_icon"
>
<div
class=
"nodata_wrap"
>
<img
class=
"icon"
src=
"../../assets/img/empty.png"
/>
...
...
@@ -43,7 +43,16 @@
</div>
</div>
<div
style=
"height: 84px"
></div>
<div
class=
"fixed_bottom"
>
<!--
<div
class=
"fixed_bottom"
>
<el-button
type=
"primary"
@
click=
"toBack"
>
关闭
</el-button>
</div>
-->
<div
class=
"footer-panel"
:style=
"
{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button
type=
"primary"
@
click=
"toBack"
>
关闭
</el-button>
</div>
</div>
...
...
@@ -68,10 +77,14 @@ export default {
}
},
created
()
{
let
id
=
this
.
$route
.
params
.
id
;
let
id
=
this
.
$route
.
params
.
id
this
.
getRoleData
(
id
)
this
.
getMerchantTree
(
id
)
},
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
},
methods
:
{
// 获取角色信息
getRoleData
(
id
)
{
...
...
@@ -166,6 +179,7 @@ export default {
.wrapper
{
box-sizing
:
border-box
;
padding
:
0
20px
;
padding-bottom
:
20px
;
.menu_line_one
{
width
:
100%
;
height
:
36px
;
...
...
@@ -223,6 +237,8 @@ export default {
//
height
:
calc
(
100%
-
40px
);
background
:
#ffffff
;
border-radius
:
0px
4px
4px
4px
;
//
height
:
200px
;
//
overflow
:
auto
;
}
.tree_widget
/
deep
/
.el-tree-node__expand-icon
{
//
content
:
"\e6d9"
;
...
...
@@ -272,4 +288,16 @@ export default {
margin
:
0
40px
;
}
}
.footer-panel
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
position
:
fixed
;
width
:
100%
;
bottom
:
0px
;
height
:
64px
;
background
:
#ffffff
;
z-index
:
999
;
box-shadow
:
0px
-1px
1px
0px
rgba
(
88
,
80
,
255
,
0.1
);
}
</
style
>
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