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 a1fe995d
authored
Dec 22, 2021
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
角色管理创建/修改/企微关联绑定添加二次确认框/更换权限按钮
1 parent
f2150c38
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
29 deletions
package.json
src/setup/qiankun.js
src/views/baseInfo/relevance.vue
src/views/role/create.vue
src/views/role/index.vue
package.json
View file @
a1fe995
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
"el-tree-transfer"
:
"^2.2.6"
,
"el-tree-transfer"
:
"^2.2.6"
,
"element-ui"
:
"^2.4.5"
,
"element-ui"
:
"^2.4.5"
,
"glsx-common"
:
"^1.4.6"
,
"glsx-common"
:
"^1.4.6"
,
"glsx-components"
:
"^1.2.
2
"
,
"glsx-components"
:
"^1.2.
5
"
,
"lodash"
:
"^4.17.21"
,
"lodash"
:
"^4.17.21"
,
"vue"
:
"^2.6.10"
,
"vue"
:
"^2.6.10"
,
"vue-amap"
:
"^0.5.10"
,
"vue-amap"
:
"^0.5.10"
,
...
...
src/setup/qiankun.js
View file @
a1fe995
...
@@ -2,19 +2,19 @@ import Vue from 'vue'
...
@@ -2,19 +2,19 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js'
// import { message } from '@/plugins/element.js'
import
{
fetchConfig
}
from
'@/config'
import
{
fetchConfig
}
from
'@/config'
import
ElementUI
from
'element-ui'
import
ElementUI
from
'element-ui'
import
{
GLButton
,
GLTable
}
from
'glsx-components'
//权限按钮 (根据权限动态创建)
import
{
GLButton
,
GLTable
}
from
'glsx-components'
//权限按钮 (根据权限动态创建)
import
{
getRoutes
}
from
'@/router'
import
{
getRoutes
}
from
'@/router'
import
render
from
'./render'
import
render
from
'./render'
Vue
.
use
(
ElementUI
)
Vue
.
use
(
ElementUI
)
Vue
.
use
(
GLTable
)
Vue
.
use
(
GLTable
)
// import GLTable from '@/components/glsx-table/index'
// import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
// Vue.component('GLTable', GLTable)
import
'glsx-components/dist/glsx-components.css'
import
'glsx-components/dist/glsx-components.css'
import
'@/assets/css/common.scss'
import
'@/assets/css/common.scss'
let
routes
=
[]
let
routes
=
[]
let
router
=
null
let
router
=
null
let
instance
=
null
let
instance
=
null
export
async
function
bootstrap
({
name
,
id
,
history
,
common
,
messenger
,
globalState
})
{
export
async
function
bootstrap
({
name
,
id
,
history
,
common
,
messenger
,
globalState
,
routerBase
})
{
const
{
response
,
request
,
sign
,
secret
,
request_common
,
request_config
,
sign_common
}
=
await
fetchConfig
()
const
{
response
,
request
,
sign
,
secret
,
request_common
,
request_config
,
sign_common
}
=
await
fetchConfig
()
console
.
log
(
request
)
console
.
log
(
request
)
Vue
.
prototype
.
$history
=
history
Vue
.
prototype
.
$history
=
history
...
@@ -26,14 +26,14 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
...
@@ -26,14 +26,14 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue
.
prototype
.
$http_common
=
new
common
.
Http
({
response
,
signWay
:
"md5"
,
request
:
request_common
,
sign
:
sign_common
,
secret
,
alert
:
ElementUI
.
Message
.
error
,
headers
:
{
TGT
:
globalState
.
session
.
token
}
})
Vue
.
prototype
.
$http_common
=
new
common
.
Http
({
response
,
signWay
:
"md5"
,
request
:
request_common
,
sign
:
sign_common
,
secret
,
alert
:
ElementUI
.
Message
.
error
,
headers
:
{
TGT
:
globalState
.
session
.
token
}
})
Vue
.
prototype
.
$http_config
=
new
common
.
Http
({
response
,
request
:
request_config
,
sign
,
secret
,
alert
:
ElementUI
.
Message
.
error
,
headers
:
{
token
:
globalState
.
session
.
token
}
})
Vue
.
prototype
.
$http_config
=
new
common
.
Http
({
response
,
request
:
request_config
,
sign
,
secret
,
alert
:
ElementUI
.
Message
.
error
,
headers
:
{
token
:
globalState
.
session
.
token
}
})
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
Vue
.
use
(
GLButton
,
{
permissions
:
globalState
.
permissions
||
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
const
routesData
=
common
.
utils
.
deepClone
(
globalState
.
routers
)
const
routesData
=
common
.
utils
.
deepClone
(
globalState
.
routers
)
routes
=
getRoutes
(
routesData
)
routes
=
getRoutes
(
routesData
)
subscribe
({
messenger
})
subscribe
({
messenger
})
Vue
.
use
(
GLButton
,
{
routes
,
routerBase
})
}
}
export
async
function
mount
(
props
)
{
export
async
function
mount
({
routerBase
})
{
console
.
log
(
'11111'
,
props
)
const
insts
=
render
(
routerBase
,
routes
)
const
insts
=
render
(
props
.
routerBase
,
routes
)
router
=
insts
.
router
router
=
insts
.
router
instance
=
insts
.
vm
instance
=
insts
.
vm
}
}
...
...
src/views/baseInfo/relevance.vue
View file @
a1fe995
...
@@ -270,6 +270,12 @@ export default {
...
@@ -270,6 +270,12 @@ export default {
})
})
let
all
=
[...
arrpara1
,
...
arrpara2
,
...
arrpara3
]
let
all
=
[...
arrpara1
,
...
arrpara2
,
...
arrpara3
]
let
para
=
Object
.
assign
({},
...
all
)
let
para
=
Object
.
assign
({},
...
all
)
this
.
$confirm
(
' 请确认是否关联当前信息?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$apis
.
baseInfo
.
toGL
(
para
).
then
(
res
=>
{
this
.
$apis
.
baseInfo
.
toGL
(
para
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
$message
({
this
.
$message
({
...
@@ -279,6 +285,7 @@ export default {
...
@@ -279,6 +285,7 @@ export default {
this
.
$router
.
push
({
path
:
'/account/index'
})
this
.
$router
.
push
({
path
:
'/account/index'
})
}
}
})
})
})
},
},
deleteLine
(
row
)
{
deleteLine
(
row
)
{
let
tempindex
=
0
let
tempindex
=
0
...
...
src/views/role/create.vue
View file @
a1fe995
...
@@ -18,10 +18,10 @@
...
@@ -18,10 +18,10 @@
<el-input
size=
"small"
disabled
style=
"width: 40%"
v-model=
"ruleForm.merchantName"
></el-input>
<el-input
size=
"small"
disabled
style=
"width: 40%"
v-model=
"ruleForm.merchantName"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"角色名称"
prop=
"roleName"
>
<el-form-item
label=
"角色名称"
prop=
"roleName"
>
<el-input
size=
"small"
maxlength=
"20"
style=
"width: 40%;
padding-right:
50px"
v-model=
"ruleForm.roleName"
placeholder=
"请输入角色名称"
></el-input>
<el-input
size=
"small"
maxlength=
"20"
style=
"width: 40%;
padding-right:
50px"
v-model=
"ruleForm.roleName"
placeholder=
"请输入角色名称"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"角色说明"
prop=
"roleDesc"
>
<el-form-item
label=
"角色说明"
prop=
"roleDesc"
>
<el-input
size=
"small"
maxlength=
"50"
style=
"width: 40%;
padding-right:
50px"
v-model=
"ruleForm.roleDesc"
placeholder=
"请输入角色说明"
></el-input>
<el-input
size=
"small"
maxlength=
"50"
style=
"width: 40%;
padding-right:
50px"
v-model=
"ruleForm.roleDesc"
placeholder=
"请输入角色说明"
></el-input>
</el-form-item>
</el-form-item>
<!--
<el-form-item
label=
"角色权限"
prop=
"roleRoot"
>
<!--
<el-form-item
label=
"角色权限"
prop=
"roleRoot"
>
<div
class=
"custom_element"
>
<div
class=
"custom_element"
>
...
@@ -101,7 +101,7 @@ export default {
...
@@ -101,7 +101,7 @@ export default {
},
},
rootList
:
[],
rootList
:
[],
curRootIndex
:
0
,
curRootIndex
:
0
,
pageName
:
'
新增
角色'
,
pageName
:
'
创建
角色'
,
roleInfo
:
null
,
roleInfo
:
null
,
pageType
:
'create'
,
pageType
:
'create'
,
accountListSelect
:
[],
accountListSelect
:
[],
...
@@ -109,10 +109,18 @@ export default {
...
@@ -109,10 +109,18 @@ export default {
merchantList
:
[],
merchantList
:
[],
// tree数据
// tree数据
treeDataList
:
[],
treeDataList
:
[],
accountLevel
:
1
accountLevel
:
1
,
isHaveEdit
:
false
}
},
watch
:
{
ruleForm
:
{
handler
()
{
this
.
isHaveEdit
=
true
},
deep
:
true
}
}
},
},
methods
:
{
methods
:
{
// 获取角色信息
// 获取角色信息
getRoleData
(
id
)
{
getRoleData
(
id
)
{
...
@@ -124,7 +132,7 @@ export default {
...
@@ -124,7 +132,7 @@ export default {
roleDesc
:
res
.
roleDescription
,
roleDesc
:
res
.
roleDescription
,
merchantId
:
res
.
merchantId
merchantId
:
res
.
merchantId
}
}
this
.
selectMerchant
(
res
.
merchantId
,
res
.
responseList
)
this
.
selectMerchant
(
res
.
merchantId
,
res
.
responseList
)
// this.getMerchantTree(id, res.responseList)
// this.getMerchantTree(id, res.responseList)
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
:
res
.
merchantId
},
res
.
responseList
)
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
:
res
.
merchantId
},
res
.
responseList
)
this
.
rootList
=
res
.
responseList
||
[]
this
.
rootList
=
res
.
responseList
||
[]
...
@@ -170,16 +178,16 @@ export default {
...
@@ -170,16 +178,16 @@ export default {
// }
// }
// },
// },
// 选择商户----获取权限
// 选择商户----获取权限
async
selectMerchant
(
id
,
list
)
{
async
selectMerchant
(
id
,
list
)
{
let
res
=
await
this
.
$refs
.
productFrom
.
findMenuFunTreeByMerId
({
id
})
let
res
=
await
this
.
$refs
.
productFrom
.
findMenuFunTreeByMerId
({
id
})
this
.
accountListSelect
=
res
.
map
(
item
=>
{
this
.
accountListSelect
=
res
.
map
(
item
=>
{
item
.
select
=
false
item
.
select
=
false
return
item
return
item
})
})
if
(
this
.
pageType
==
'edit'
)
{
if
(
this
.
pageType
==
'edit'
)
{
this
.
accountListSelect
=
this
.
accountListSelect
.
map
(
item
=>
{
this
.
accountListSelect
=
this
.
accountListSelect
.
map
(
item
=>
{
list
.
forEach
(
key
=>
{
list
.
forEach
(
key
=>
{
if
(
item
.
accounttypeId
==
key
.
accounttypeId
)
{
if
(
item
.
accounttypeId
==
key
.
accounttypeId
)
{
item
.
select
=
true
item
.
select
=
true
}
}
})
})
...
@@ -290,20 +298,42 @@ export default {
...
@@ -290,20 +298,42 @@ export default {
}
}
},
},
insertRole
(
para
)
{
insertRole
(
para
)
{
this
.
$confirm
(
'是否确定当前信息?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$apis
.
role
.
createRole
(
para
).
then
(
res
=>
{
this
.
$apis
.
role
.
createRole
(
para
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
toBack
(
)
this
.
$router
.
push
(
'/role/index'
)
}
}
})
})
})
},
},
updateRole
(
para
)
{
updateRole
(
para
)
{
this
.
$confirm
(
'是否更改当前信息?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$apis
.
role
.
updateRole
(
para
).
then
(
res
=>
{
this
.
$apis
.
role
.
updateRole
(
para
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
toBack
(
)
this
.
$router
.
push
(
'/role/index'
)
}
}
})
})
})
},
},
toBack
()
{
toBack
()
{
if
(
this
.
isHaveEdit
&&
this
.
pageType
==
'create'
)
{
this
.
$confirm
(
'当前页面有更改,是否继续退出?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$router
.
push
(
'/role/index'
)
})
return
}
this
.
$router
.
push
(
'/role/index'
)
this
.
$router
.
push
(
'/role/index'
)
}
}
},
},
...
@@ -316,7 +346,7 @@ export default {
...
@@ -316,7 +346,7 @@ export default {
}
}
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
{
...
@@ -375,9 +405,9 @@ export default {
...
@@ -375,9 +405,9 @@ export default {
background
:
#ffffff
;
background
:
#ffffff
;
z-index
:
999
;
z-index
:
999
;
box-shadow
:
0px
-1px
1px
0px
rgba
(
88
,
80
,
255
,
0.1
);
box-shadow
:
0px
-1px
1px
0px
rgba
(
88
,
80
,
255
,
0.1
);
.custtom{
.custtom
{
background
:
#ffffff
;
background
:
#ffffff
;
color
:
#5850
FF
;
color
:
#5850
ff
;
}
}
.wrap_driver
{
.wrap_driver
{
margin
:
0
20px
;
margin
:
0
20px
;
...
...
src/views/role/index.vue
View file @
a1fe995
<
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>
<!--
<el-button
size=
"small"
icon=
"el-icon-plus"
type=
"primary"
@
click=
"toCreatePage"
>
创建角色
</el-button>
-->
<GLButton
type=
"primary"
size=
"small"
@
click=
"toCreatePage"
fn=
"创建角色"
icon=
"el-icon-plus"
>
创建角色
</GLButton>
</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>
<!--
<el-button
v-if=
"scope.scope.roleName!='超级管理员'"
type=
"text"
@
click=
"toEditPage(scope.scope)"
>
修改
</el-button>
-->
<GLButton
type=
"text"
fn=
"查看"
display=
"disabled"
@
click=
"toLookPage(scope.scope)"
>
查看
</GLButton>
<GLButton
v-if=
"scope.scope.roleName!='超级管理员'"
display=
"disabled"
type=
"text"
fn=
"修改"
@
click=
"toEditPage(scope.scope)"
>
修改
</GLButton>
<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>
...
@@ -217,7 +220,6 @@ export default {
...
@@ -217,7 +220,6 @@ 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