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 b0ee8f5e
authored
Oct 28, 2021
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改角色修改页面
1 parent
4d5cc538
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
60 deletions
src/api/modules/role.js
src/views/role/create/index.vue
src/api/modules/role.js
View file @
b0ee8f5
...
@@ -52,10 +52,20 @@ const merchantRootById = params => {
...
@@ -52,10 +52,20 @@ const merchantRootById = params => {
sign
:
true
sign
:
true
})
})
}
}
const
createRole
=
params
=>
{
params
.
method
=
'org.ore.api.role.insert'
return
http
({
url
:
'/rop-merchants/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
export
default
{
roleDataList
,
roleDataList
,
merchantDataList
,
merchantDataList
,
roleInfoData
,
roleInfoData
,
roleTreeDataById
,
roleTreeDataById
,
merchantRootById
merchantRootById
,
createRole
}
}
\ No newline at end of file
\ No newline at end of file
src/views/role/create/index.vue
View file @
b0ee8f5
...
@@ -5,18 +5,14 @@
...
@@ -5,18 +5,14 @@
</div>
</div>
<div
class=
"main_widget"
>
<div
class=
"main_widget"
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"所属商户"
prop=
"merchantId"
>
<el-form-item
v-if=
"pageType == 'create'"
label=
"所属商户"
prop=
"merchantId"
>
<el-select
size=
"small"
:disabled=
"pageType == 'edit' ? true : false"
style=
"width: 40%"
<el-select
size=
"small"
style=
"width: 40%"
v-model=
"ruleForm.merchantId"
:filter-method=
"filterList"
clearable
filterable
placeholder=
"请选择"
@
change=
"selectMerchant"
>
v-model=
"ruleForm.merchantId"
:filter-method=
"filterList"
clearable
filterable
placeholder=
"请选择"
@
change=
"selectMerchant"
>
<el-option
v-for=
"item in list"
:key=
"item.id"
:label=
"item.merchantName"
:value=
"item.id"
></el-option>
<el-option
v-for=
"item in list"
:key=
"item.id"
:label=
"item.merchantName"
:value=
"item.id"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"所属商户"
prop=
"merchantName"
v-if=
"pageType == 'edit'"
>
<el-input
disabled
style=
"width: 40%"
v-model=
"ruleForm.merchantName"
></el-input>
</el-form-item>
<el-form-item
label=
"角色名称"
prop=
"roleName"
>
<el-form-item
label=
"角色名称"
prop=
"roleName"
>
<el-input
style=
"width: 40%"
v-model=
"ruleForm.roleName"
></el-input>
<el-input
style=
"width: 40%"
v-model=
"ruleForm.roleName"
></el-input>
</el-form-item>
</el-form-item>
...
@@ -27,7 +23,7 @@
...
@@ -27,7 +23,7 @@
<div
class=
"custom_element"
>
<div
class=
"custom_element"
>
<template
v-for=
"(item, index) in accountList"
>
<template
v-for=
"(item, index) in accountList"
>
<div
:key=
"index"
class=
"wrap"
>
<div
:key=
"index"
class=
"wrap"
>
<AutoButton
@
getBtnStatus=
"selectCurAccount(item,index)"
:typeStatus=
"item.select"
:btnLabel=
"item.accounttypeName"
></AutoButton>
<AutoButton
@
getBtnStatus=
"selectCurAccount(item,
index)"
:typeStatus=
"item.select"
:btnLabel=
"item.accounttypeName"
></AutoButton>
</div>
</div>
</
template
>
</
template
>
</div>
</div>
...
@@ -44,7 +40,7 @@
...
@@ -44,7 +40,7 @@
<div
class=
"label_title"
>
选择产品
</div>
<div
class=
"label_title"
>
选择产品
</div>
<div
class=
"product_con"
>
<div
class=
"product_con"
>
<el-checkbox
v-for=
"(item, index) in productList"
:key=
"index"
:false-label=
"item.productId"
:true-label=
"item"
@
change=
"selectProductItem"
>
<el-checkbox
v-for=
"(item, index) in productList"
:key=
"index"
:false-label=
"item.productId"
:true-label=
"item"
@
change=
"selectProductItem"
>
<div
class=
"check_text"
>
{{
item.productName
}}
</div>
<div
class=
"check_text"
>
{{
item.productName
}}
</div>
</el-checkbox>
</el-checkbox>
</div>
</div>
</div>
</div>
...
@@ -56,13 +52,13 @@
...
@@ -56,13 +52,13 @@
<div
v-for=
"(item, index) in storeList"
:key=
"index"
class=
"menu_line_item"
:class=
"curMenuIndex == index ? 'menu_line_item_active' : ''"
@
click=
"selectMenuItem(index)"
>
{{ item.productName }}
</div>
<div
v-for=
"(item, index) in storeList"
:key=
"index"
class=
"menu_line_item"
:class=
"curMenuIndex == index ? 'menu_line_item_active' : ''"
@
click=
"selectMenuItem(index)"
>
{{ item.productName }}
</div>
</div>
</div>
<div
class=
"content_menu_con"
>
<div
class=
"content_menu_con"
>
<el-tree
v-if=
"treeDataList.length"
:data=
"treeDataList"
:props=
"defaultProps"
></el-tree>
<el-tree
v-if=
"treeDataList.length"
:data=
"treeDataList"
:props=
"defaultProps"
></el-tree>
<div
v-if=
"treeDataList.length == 0"
class=
"no_data_icon"
>
<div
v-if=
"treeDataList.length == 0"
class=
"no_data_icon"
>
<div
class=
"nodata_wrap"
>
<div
class=
"nodata_wrap"
>
<img
class=
"icon"
src=
"../../../assets/img/empty.png"
/>
<img
class=
"icon"
src=
"../../../assets/img/empty.png"
/>
<span
class=
"text"
>
暂无数据
</span>
<span
class=
"text"
>
暂无数据
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -70,7 +66,7 @@
...
@@ -70,7 +66,7 @@
<div
class=
"fixed_bottom"
>
<div
class=
"fixed_bottom"
>
<el-button
v-if=
"pageType == 'create'"
type=
"primary"
>
草稿
</el-button>
<el-button
v-if=
"pageType == 'create'"
type=
"primary"
>
草稿
</el-button>
<div
class=
"wrap_driver"
>
<div
class=
"wrap_driver"
>
<el-button
type=
"primary"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"toCreateRole"
>
确定
</el-button>
</div>
</div>
<el-button
type=
"primary"
@
click=
"toBack"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"toBack"
>
取消
</el-button>
</div>
</div>
...
@@ -108,7 +104,7 @@ export default {
...
@@ -108,7 +104,7 @@ export default {
//商户
//商户
list
:
[],
list
:
[],
// tree数据
// tree数据
treeDataList
:[]
treeDataList
:
[]
}
}
},
},
created
()
{
created
()
{
...
@@ -167,9 +163,9 @@ export default {
...
@@ -167,9 +163,9 @@ export default {
}
}
},
},
// 选择商户----获取权限
// 选择商户----获取权限
selectMerchant
(
id
){
selectMerchant
(
id
)
{
this
.
$apis
.
role
.
merchantRootById
({
id
}).
then
(
res
=>
{
this
.
$apis
.
role
.
merchantRootById
({
id
}).
then
(
res
=>
{
this
.
accountList
=
res
.
map
(
item
=>
{
this
.
accountList
=
res
.
map
(
item
=>
{
item
.
select
=
false
item
.
select
=
false
return
item
return
item
})
})
...
@@ -178,30 +174,29 @@ export default {
...
@@ -178,30 +174,29 @@ export default {
this
.
productList
=
[]
this
.
productList
=
[]
},
},
// 选择商户权限
// 选择商户权限
selectCurAccount
(
item
,
index
)
{
selectCurAccount
(
item
,
index
)
{
this
.
accountList
[
index
].
select
=
!
item
.
select
this
.
accountList
[
index
].
select
=
!
item
.
select
this
.
curRootIndex
=
0
this
.
curRootIndex
=
0
if
(
this
.
accountList
[
index
].
select
)
{
if
(
this
.
accountList
[
index
].
select
)
{
this
.
rootList
.
push
(
item
)
this
.
rootList
.
push
(
item
)
}
else
{
}
else
{
let
arr
=
this
.
rootList
.
filter
(
el
=>
{
let
arr
=
this
.
rootList
.
filter
(
el
=>
{
return
item
.
accounttypeId
!=
el
.
accounttypeId
return
item
.
accounttypeId
!=
el
.
accounttypeId
})
})
this
.
rootList
=
arr
this
.
rootList
=
arr
}
}
this
.
productList
=
this
.
rootList
[
0
].
products
||
[]
this
.
productList
=
this
.
rootList
[
0
].
products
||
[]
},
},
// 选择产品的值
// 选择产品的值
selectProductItem
(
val
){
selectProductItem
(
val
)
{
console
.
log
(
val
)
;
console
.
log
(
val
)
this
.
curMenuIndex
=
0
this
.
curMenuIndex
=
0
if
(
typeof
(
val
)
===
'number'
)
{
if
(
typeof
val
===
'number'
)
{
let
arr
=
this
.
storeList
.
filter
(
el
=>
{
let
arr
=
this
.
storeList
.
filter
(
el
=>
{
return
val
!=
el
.
productId
return
val
!=
el
.
productId
})
})
this
.
storeList
=
arr
this
.
storeList
=
arr
}
else
{
}
else
{
this
.
storeList
.
push
(
val
)
this
.
storeList
.
push
(
val
)
}
}
},
},
...
@@ -216,6 +211,26 @@ export default {
...
@@ -216,6 +211,26 @@ export default {
this
.
curMenuIndex
=
index
this
.
curMenuIndex
=
index
this
.
treeDataList
=
this
.
storeList
[
index
].
merchantProTreeResponses
this
.
treeDataList
=
this
.
storeList
[
index
].
merchantProTreeResponses
},
},
// 创建角色
toCreateRole
()
{
let
{
merchantId
,
roleDesc
,
roleName
}
=
this
.
ruleForm
let
para
=
{
merchantId
:
merchantId
,
roleName
:
roleName
,
roleDescription
:
roleDesc
,
accounttypeId
:
0
,
'check[29]'
:
44
,
delFlag
:
0
,
requestList
:
[]
}
console
.
log
(
this
.
ruleForm
)
console
.
log
(
para
)
// this.$apis.role.roleInfoData(para).then(res => {
// if (res) {
// history.go(-1)
// }
// })
},
toBack
()
{
toBack
()
{
history
.
go
(
-
1
)
history
.
go
(
-
1
)
}
}
...
@@ -349,27 +364,27 @@ export default {
...
@@ -349,27 +364,27 @@ export default {
border-radius
:
0px
4px
4px
4px
;
border-radius
:
0px
4px
4px
4px
;
}
}
.no_data_icon
{
.no_data_icon
{
height
:
150px
;
height
:
150px
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
.nodata_wrap
{
.nodata_wrap
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
.icon
{
.icon
{
width
:
64px
;
width
:
64px
;
height
:
41px
;
height
:
41px
;
}
}
.text
{
.text
{
font-size
:
14px
;
font-size
:
14px
;
font-weight
:
400
;
font-weight
:
400
;
color
:
#262626
;
color
:
#262626
;
margin-top
:
10px
;
margin-top
:
10px
;
}
}
}
}
}
}
}
}
.fixed_bottom
{
.fixed_bottom
{
position
:
fixed
;
position
:
fixed
;
...
...
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