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 e2e6348d
authored
Nov 02, 2021
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
角色管理模块
1 parent
8515a437
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
24 deletions
src/setup/single.js
src/views/account/components/selectProduct.vue
src/views/role/create.vue
src/views/role/index.vue
src/setup/single.js
View file @
e2e6348
...
@@ -17,7 +17,7 @@ import { routes } from '@/router'
...
@@ -17,7 +17,7 @@ import { routes } from '@/router'
export
async
function
start
()
{
export
async
function
start
()
{
if
(
window
.
__POWERED_BY_QIANKUN__
)
return
if
(
window
.
__POWERED_BY_QIANKUN__
)
return
const
{
response
,
request
,
sign
,
secret
}
=
await
fetchConfig
()
const
{
response
,
request
,
sign
,
secret
}
=
await
fetchConfig
()
Vue
.
prototype
.
$http
=
new
Http
({
response
,
request
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
TGT
:
'scrm-base-
57a2c9a4-42bd-4821-8af0-02e98a473594
-rop'
}
})
Vue
.
prototype
.
$http
=
new
Http
({
response
,
request
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
TGT
:
'scrm-base-
61a28f77-294f-4510-aa1c-6a35cff86f25
-rop'
}
})
Vue
.
use
(
GLButton
,
{
permissions
:
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
Vue
.
use
(
GLButton
,
{
permissions
:
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
render
(
'/'
,
routes
)
render
(
'/'
,
routes
)
}
}
\ No newline at end of file
\ No newline at end of file
src/views/account/components/selectProduct.vue
View file @
e2e6348
This diff is collapsed.
Click to expand it.
src/views/role/create.vue
View file @
e2e6348
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
</div>
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<SelectProduct
ref=
"productFrom"
:roleType=
"true"
:parentId=
"41712"
:accountlevel=
"accountLevel"
:pId=
"41713
"
></SelectProduct>
<SelectProduct
ref=
"productFrom"
:roleType=
"true"
title=
"
"
></SelectProduct>
</div>
</div>
<div
style=
"height: 84px"
></div>
<div
style=
"height: 84px"
></div>
<div
class=
"fixed_bottom"
>
<div
class=
"fixed_bottom"
>
...
@@ -73,18 +73,18 @@ export default {
...
@@ -73,18 +73,18 @@ export default {
list
:
[],
list
:
[],
// tree数据
// tree数据
treeDataList
:
[],
treeDataList
:
[],
accountLevel
:
1
accountLevel
:
1
}
}
},
},
created
()
{
created
()
{
let
id
=
Number
(
this
.
$route
.
params
.
id
)
;
let
id
=
Number
(
this
.
$route
.
params
.
id
)
if
(
!
id
)
{
if
(
!
id
)
{
this
.
pageName
=
'新增角色'
this
.
pageName
=
'新增角色'
this
.
pageType
=
'create'
this
.
pageType
=
'create'
this
.
getMerchantName
()
this
.
getMerchantName
()
}
else
{
}
else
{
this
.
pageName
=
'修改角色'
this
.
pageName
=
'修改角色'
this
.
pageType
=
'edit'
this
.
pageType
=
'edit'
this
.
getRoleData
(
id
)
this
.
getRoleData
(
id
)
this
.
editId
=
id
this
.
editId
=
id
}
}
...
@@ -100,9 +100,10 @@ export default {
...
@@ -100,9 +100,10 @@ export default {
merchantName
:
res
.
merchantName
,
merchantName
:
res
.
merchantName
,
roleName
:
res
.
roleName
,
roleName
:
res
.
roleName
,
roleDesc
:
res
.
roleDescription
,
roleDesc
:
res
.
roleDescription
,
merchantId
:
res
.
merchantId
merchantId
:
res
.
merchantId
}
}
this
.
getMerchantTree
(
id
,
res
.
responseList
)
this
.
getMerchantTree
(
id
,
res
.
responseList
)
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
:
res
.
merchantId
},
'edit'
)
})
})
},
},
// 获取商户树
// 获取商户树
...
@@ -136,13 +137,12 @@ export default {
...
@@ -136,13 +137,12 @@ export default {
}
}
},
},
// 选择商户----获取权限
// 选择商户----获取权限
selectMerchant
(
id
)
{
async
selectMerchant
(
id
)
{
this
.
$apis
.
role
.
merchantRootById
({
id
}).
then
(
res
=>
{
let
res
=
await
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
},
'create'
)
this
.
accountList
=
res
.
map
(
item
=>
{
this
.
accountList
=
res
.
map
(
item
=>
{
item
.
select
=
fals
e
item
.
select
=
tru
e
return
item
return
item
})
})
})
},
},
// 选择商户权限
// 选择商户权限
selectCurAccount
(
item
,
index
)
{
selectCurAccount
(
item
,
index
)
{
...
@@ -158,21 +158,20 @@ export default {
...
@@ -158,21 +158,20 @@ export default {
}
}
},
},
// 确定按钮---处理参数---提交数据---创建为0---草稿为1
// 确定按钮---处理参数---提交数据---创建为0---草稿为1
toCreateRole
(
delFlag
)
{
toCreateRole
(
delFlag
)
{
let
{
merchantId
,
roleDesc
,
roleName
}
=
this
.
ruleForm
let
{
merchantId
,
roleDesc
,
roleName
}
=
this
.
ruleForm
if
(
!
merchantId
)
{
if
(
!
merchantId
)
{
this
.
$message
.
error
(
"请选择所属商户"
);
this
.
$message
.
error
(
'请选择所属商户'
)
return
return
}
}
if
(
!
roleName
)
{
if
(
!
roleName
)
{
this
.
$message
.
error
(
"请输入角色名称"
);
this
.
$message
.
error
(
'请输入角色名称'
)
return
return
}
}
if
(
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
)
{
if
(
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
)
{
this
.
$message
.
error
(
"请选择产品"
);
this
.
$message
.
error
(
'请选择产品'
)
return
;
return
}
}
let
accountTypes
=
JSON
.
stringify
(
this
.
$refs
.
productFrom
.
getSelectInfo
())
let
accountTypes
=
JSON
.
stringify
(
this
.
$refs
.
productFrom
.
getSelectInfo
())
let
para
=
{
let
para
=
{
...
@@ -180,12 +179,12 @@ export default {
...
@@ -180,12 +179,12 @@ export default {
roleName
:
roleName
,
roleName
:
roleName
,
roleDescription
:
roleDesc
,
roleDescription
:
roleDesc
,
delFlag
,
delFlag
,
requestList
:
accountTypes
,
requestList
:
accountTypes
}
}
if
(
this
.
pageType
==
'edit'
)
{
if
(
this
.
pageType
==
'edit'
)
{
para
.
id
=
this
.
editId
para
.
id
=
this
.
editId
this
.
updateRole
(
para
)
this
.
updateRole
(
para
)
}
else
{
}
else
{
this
.
insertRole
(
para
)
this
.
insertRole
(
para
)
}
}
},
},
...
@@ -204,7 +203,7 @@ export default {
...
@@ -204,7 +203,7 @@ export default {
})
})
},
},
toBack
()
{
toBack
()
{
this
.
$router
.
push
(
"/role/index"
);
this
.
$router
.
push
(
'/role/index'
)
}
}
}
}
}
}
...
@@ -246,6 +245,7 @@ export default {
...
@@ -246,6 +245,7 @@ export default {
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
z-index
:
20
;
.wrap_driver
{
.wrap_driver
{
margin
:
0
40px
;
margin
:
0
40px
;
}
}
...
@@ -258,5 +258,4 @@ export default {
...
@@ -258,5 +258,4 @@ export default {
margin-right
:
15px
;
margin-right
:
15px
;
}
}
}
}
</
style
>
</
style
>
src/views/role/index.vue
View file @
e2e6348
...
@@ -137,7 +137,7 @@ export default {
...
@@ -137,7 +137,7 @@ export default {
this
.
$apis
.
role
.
roleDataList
(
para
).
then
(
res
=>
{
this
.
$apis
.
role
.
roleDataList
(
para
).
then
(
res
=>
{
this
.
tableData
=
res
.
data
this
.
tableData
=
res
.
data
this
.
tableTotal
=
res
.
count
this
.
tableTotal
=
res
.
count
if
(
!
res
.
data
.
length
)
{
if
(
!
res
.
data
.
length
||
!
res
)
{
this
.
$refs
.
table
.
setTableHeightFun
()
this
.
$refs
.
table
.
setTableHeightFun
()
}
}
// this.$nextTick(() => {
// this.$nextTick(() => {
...
...
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