Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-settings
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 74c3aada
authored
Dec 24, 2021
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
角色管理
1 parent
5a177f0e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
src/views/role/create.vue
src/views/role/index.vue
src/views/role/create.vue
View file @
74c3aad
...
@@ -65,27 +65,24 @@
...
@@ -65,27 +65,24 @@
width: footerWidth + 'px'
width: footerWidth + 'px'
}"
}"
>
>
<el-button
class=
"custtom"
size=
"small"
v-if=
"pageType == 'create'"
type=
"primary"
@
click=
"toCreateRole(1)"
>
草稿
</el-button>
<el-button
class=
"custtom"
v-if=
"pageType == 'create'"
type=
"primary"
@
click=
"toCreateRole(1)"
>
草稿
</el-button>
<div
class=
"wrap_driver"
>
<div
class=
"wrap_driver"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"toCreateRole(0)"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"toCreateRole(0)"
>
确定
</el-button>
</div>
</div>
<el-button
size=
"small"
@
click=
"toBack"
>
取消
</el-button>
<el-button
@
click=
"toBack"
>
取消
</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
AutoButton
from
'../../components/auto-button/index.vue'
import
AutoButton
from
'../../components/auto-button/index.vue'
import
SelectProduct
from
'./components/selectProduct.vue'
import
SelectProduct
from
'./components/selectProduct.vue'
export
default
{
export
default
{
name
:
''
,
name
:
''
,
components
:
{
components
:
{
AutoButton
,
AutoButton
,
SelectProduct
SelectProduct
},
},
data
()
{
data
()
{
return
{
return
{
roleRootRules
:
false
,
roleRootRules
:
false
,
...
@@ -210,7 +207,6 @@ export default {
...
@@ -210,7 +207,6 @@ export default {
this
.
rootList
=
arr
this
.
rootList
=
arr
}
}
let
accounttypeId
=
[]
let
accounttypeId
=
[]
this
.
rootList
.
forEach
(
item
=>
{
this
.
rootList
.
forEach
(
item
=>
{
accounttypeId
.
push
(
item
.
accounttypeId
)
accounttypeId
.
push
(
item
.
accounttypeId
)
})
})
...
@@ -218,7 +214,6 @@ export default {
...
@@ -218,7 +214,6 @@ export default {
this
.
accounttypeIds
=
accounttypeId
this
.
accounttypeIds
=
accounttypeId
this
.
$refs
.
productFrom
.
findMenuFunTree
(
item
.
accounttypeId
,
item
.
select
)
this
.
$refs
.
productFrom
.
findMenuFunTree
(
item
.
accounttypeId
,
item
.
select
)
},
},
// 确定按钮---处理参数---提交数据---创建为0---草稿为1
// 确定按钮---处理参数---提交数据---创建为0---草稿为1
toCreateRole
(
delFlag
)
{
toCreateRole
(
delFlag
)
{
let
{
merchantId
,
roleDesc
,
roleName
}
=
this
.
ruleForm
let
{
merchantId
,
roleDesc
,
roleName
}
=
this
.
ruleForm
...
@@ -227,7 +222,6 @@ export default {
...
@@ -227,7 +222,6 @@ export default {
this
.
$refs
.
ruleForm
.
validateField
(
'merchantId'
)
this
.
$refs
.
ruleForm
.
validateField
(
'merchantId'
)
return
return
}
}
if
(
!
roleName
&&
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
)
{
if
(
!
roleName
&&
this
.
$refs
.
productFrom
.
getSelectInfo
().
length
==
0
)
{
this
.
$message
.
error
(
'角色和权限至少选择一项'
)
this
.
$message
.
error
(
'角色和权限至少选择一项'
)
return
return
...
@@ -337,7 +331,6 @@ export default {
...
@@ -337,7 +331,6 @@ export default {
this
.
$router
.
push
(
'/role/index'
)
this
.
$router
.
push
(
'/role/index'
)
}
}
},
},
async
created
()
{
async
created
()
{
const
{
session
}
=
this
.
$globalState
const
{
session
}
=
this
.
$globalState
this
.
accountLevel
=
session
.
accountLevel
this
.
accountLevel
=
session
.
accountLevel
...
@@ -358,7 +351,6 @@ export default {
...
@@ -358,7 +351,6 @@ export default {
// document.getElementById('tab-/account/role/create').innerHTML='修改角色'
// document.getElementById('tab-/account/role/create').innerHTML='修改角色'
}
}
},
},
mounted
()
{
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
...
@@ -368,7 +360,6 @@ export default {
...
@@ -368,7 +360,6 @@ export default {
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.role-create-page
{
.role-create-page
{
height
:
100%
;
height
:
100%
;
...
...
src/views/role/index.vue
View file @
74c3aad
<
template
>
<
template
>
<div
class=
"role-home-page"
>
<div
class=
"role-home-page"
>
<div
class=
"top_widget"
>
<div
class=
"top_widget"
>
<el-button
size=
"small"
icon=
"el-icon-plus"
type=
"primary"
@
click=
"toCreatePage"
>
创建角色
</el-button>
<!--
<GLButton
size=
"small"
fn=
"创建角色"
icon=
"el-icon-plus"
type=
"primary"
display=
"disabled"
@
click=
"toCreatePage"
>
创建角色
</GLButton>
-->
<!--
<el-button
size=
"small"
icon=
"el-icon-plus"
type=
"primary"
@
click=
"toCreatePage"
>
创建角色
</el-button>
-->
</div>
</div>
<div
class=
"table_widget"
>
<div
class=
"table_widget"
>
<div
class=
"search_widget"
>
<div
class=
"search_widget"
>
...
@@ -30,8 +31,10 @@
...
@@ -30,8 +31,10 @@
</div>
</div>
<GLTable
v-if=
"distoryTable"
ref=
"table"
:layout=
"layout"
:tableData=
"tableData"
:tableTotal=
"tableTotal"
:pageConf=
"pageConf"
:tableParams=
"tableParams"
@
refreshTable=
"getTableData"
>
<GLTable
v-if=
"distoryTable"
ref=
"table"
:layout=
"layout"
:tableData=
"tableData"
:tableTotal=
"tableTotal"
:pageConf=
"pageConf"
:tableParams=
"tableParams"
@
refreshTable=
"getTableData"
>
<template
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
>
<template
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
>
<el-button
type=
"text"
@
click=
"toLookPage(scope.scope)"
>
查看
</el-button>
<!--
<el-button
type=
"text"
@
click=
"toLookPage(scope.scope)"
>
查看
</el-button>
-->
<el-button
v-if=
"scope.scope.roleName!='超级管理员'"
type=
"text"
@
click=
"toEditPage(scope.scope)"
>
修改
</el-button>
<GLButton
type=
"text"
@
click=
"toLookPage(scope.scope)"
fn=
"查看"
>
查看
</GLButton>
<GLButton
v-if=
"!scope.scope.defalutRole"
fn=
"修改"
type=
"text"
display=
"disabled"
@
click=
"toEditPage(scope.scope)"
>
修改
</GLButton>
<!--
<el-button
v-if=
"scope.scope.roleName!='超级管理员'"
type=
"text"
@
click=
"toEditPage(scope.scope)"
>
修改
</el-button>
-->
<el-button
v-if=
"scope.scope.delFlag"
type=
"text"
@
click=
"todelete(scope.scope)"
>
删除
</el-button>
<el-button
v-if=
"scope.scope.delFlag"
type=
"text"
@
click=
"todelete(scope.scope)"
>
删除
</el-button>
</
template
>
</
template
>
</GLTable>
</GLTable>
...
@@ -118,7 +121,8 @@ export default {
...
@@ -118,7 +121,8 @@ export default {
let
{
delFlag
,
roleName
,
merchantId
}
=
this
.
searchForm
let
{
delFlag
,
roleName
,
merchantId
}
=
this
.
searchForm
let
para
=
{}
let
para
=
{}
console
.
log
(
merchantId
)
console
.
log
(
merchantId
)
if
(
!
this
.
distoryTable
)
{
//代表重置
if
(
!
this
.
distoryTable
)
{
//代表重置
para
=
{
para
=
{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
pageSize
:
10
...
@@ -217,6 +221,7 @@ export default {
...
@@ -217,6 +221,7 @@ export default {
}
}
})
})
})
})
.
catch
(()
=>
{})
}
}
},
},
...
...
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