Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
authority
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6f66f7f3
authored
Sep 14, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
接口
1 parent
4d660e50
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
53 deletions
src/api/api.js
src/api/roleApi.js
src/api/userApi.js
src/config/common.conf.js
src/views/customer/role/index.vue
src/views/customer/user/index.vue
src/api/api.js
View file @
6f66f7f
import
{
import
{
roleTest
,
deleteRoleById
,
deleteRoleById
,
deleteUserRoleById
,
deleteUserRoleById
,
getRoleDetail
,
getRoleDetail
,
...
@@ -12,10 +11,9 @@ import {
...
@@ -12,10 +11,9 @@ import {
}
from
'./roleApi'
}
from
'./roleApi'
import
{
import
{
getUser
,
batcheDelUser
,
batcheDelUser
,
find
UserList
,
find
All
,
getUser
Info
,
getUser
,
getWithRoles
,
getWithRoles
,
operatUser
,
operatUser
,
updateUser
updateUser
...
@@ -41,7 +39,6 @@ import {
...
@@ -41,7 +39,6 @@ import {
export
{
export
{
// role接口
// role接口
roleTest
,
deleteRoleById
,
deleteRoleById
,
deleteUserRoleById
,
deleteUserRoleById
,
getRoleDetail
,
getRoleDetail
,
...
@@ -52,10 +49,9 @@ export {
...
@@ -52,10 +49,9 @@ export {
selectUserRoleByRoleId
,
selectUserRoleByRoleId
,
updateRole
,
updateRole
,
// user接口
// user接口
getUser
,
batcheDelUser
,
batcheDelUser
,
find
UserList
,
find
All
,
getUser
Info
,
getUser
,
getWithRoles
,
getWithRoles
,
operatUser
,
operatUser
,
updateUser
,
updateUser
,
...
...
src/api/roleApi.js
View file @
6f66f7f
...
@@ -2,7 +2,6 @@ import {
...
@@ -2,7 +2,6 @@ import {
GlAxios
GlAxios
}
from
'glsx-vue-common'
}
from
'glsx-vue-common'
const
path
=
'role'
const
path
=
'role'
const
__sTest
=
`
${
path
}
/roleList`
const
__sDeleteRole
=
`
${
path
}
/deleteRoleById`
const
__sDeleteRole
=
`
${
path
}
/deleteRoleById`
const
__sDeleteUserRole
=
`
${
path
}
/deleteUserRoleById`
const
__sDeleteUserRole
=
`
${
path
}
/deleteUserRoleById`
const
__sGetRoleDetail
=
`
${
path
}
/getRoleDetail`
const
__sGetRoleDetail
=
`
${
path
}
/getRoleDetail`
...
@@ -13,11 +12,6 @@ const __sSelectMenuTreeRoleId = `${path}/selectMenuTreeRoleId`
...
@@ -13,11 +12,6 @@ const __sSelectMenuTreeRoleId = `${path}/selectMenuTreeRoleId`
const
__sSelectUserRole
=
`
${
path
}
/selectUserRoleByRoleId`
const
__sSelectUserRole
=
`
${
path
}
/selectUserRoleByRoleId`
const
__sUpdateRole
=
`
${
path
}
/updateRole`
const
__sUpdateRole
=
`
${
path
}
/updateRole`
const
roleTest
=
{
p
:
[
__sTest
],
req
:
params
=>
GlAxios
.
post
(
__sTest
,
params
)
}
const
deleteRoleById
=
{
const
deleteRoleById
=
{
p
:
[
__sDeleteRole
],
p
:
[
__sDeleteRole
],
req
:
params
=>
GlAxios
.
post
(
__sDeleteRole
,
params
)
req
:
params
=>
GlAxios
.
post
(
__sDeleteRole
,
params
)
...
@@ -64,7 +58,6 @@ const updateRole = {
...
@@ -64,7 +58,6 @@ const updateRole = {
}
}
export
{
export
{
roleTest
,
deleteRoleById
,
deleteRoleById
,
deleteUserRoleById
,
deleteUserRoleById
,
getRoleDetail
,
getRoleDetail
,
...
...
src/api/userApi.js
View file @
6f66f7f
...
@@ -2,7 +2,6 @@ import {
...
@@ -2,7 +2,6 @@ import {
GlAxios
GlAxios
}
from
'glsx-vue-common'
}
from
'glsx-vue-common'
const
path
=
'user'
const
path
=
'user'
const
__sUserTest
=
`role/userList`
const
__sBatcheDel
=
`
${
path
}
/batcheDel`
const
__sBatcheDel
=
`
${
path
}
/batcheDel`
const
__sFindAll
=
`
${
path
}
/findAll`
const
__sFindAll
=
`
${
path
}
/findAll`
const
__sGet
=
`
${
path
}
/get`
const
__sGet
=
`
${
path
}
/get`
...
@@ -10,22 +9,17 @@ const __sGetWithRoles = `${path}/getWithRoles`
...
@@ -10,22 +9,17 @@ const __sGetWithRoles = `${path}/getWithRoles`
const
__sOperatUser
=
`
${
path
}
/operatUser`
const
__sOperatUser
=
`
${
path
}
/operatUser`
const
__sUpdateUser
=
`
${
path
}
/updateUser`
const
__sUpdateUser
=
`
${
path
}
/updateUser`
const
getUser
=
{
p
:
[
__sUserTest
],
req
:
params
=>
GlAxios
.
post
(
__sUserTest
,
params
)
}
const
batcheDelUser
=
{
const
batcheDelUser
=
{
p
:
[
__sBatcheDel
],
p
:
[
__sBatcheDel
],
req
:
params
=>
GlAxios
.
post
(
__sBatcheDel
,
params
)
req
:
params
=>
GlAxios
.
post
(
__sBatcheDel
,
params
)
}
}
const
find
UserList
=
{
const
find
All
=
{
p
:
[
__sFindAll
],
p
:
[
__sFindAll
],
req
:
params
=>
GlAxios
.
get
(
__sFindAll
,
{
params
})
req
:
params
=>
GlAxios
.
get
(
__sFindAll
,
{
params
})
}
}
const
getUser
Info
=
{
const
getUser
=
{
p
:
[
__sGet
],
p
:
[
__sGet
],
req
:
params
=>
GlAxios
.
get
(
__sGet
,
{
params
})
req
:
params
=>
GlAxios
.
get
(
__sGet
,
{
params
})
}
}
...
@@ -46,10 +40,9 @@ const updateUser = {
...
@@ -46,10 +40,9 @@ const updateUser = {
}
}
export
{
export
{
getUser
,
batcheDelUser
,
batcheDelUser
,
find
UserList
,
find
All
,
getUser
Info
,
getUser
,
getWithRoles
,
getWithRoles
,
operatUser
,
operatUser
,
updateUser
updateUser
...
...
src/config/common.conf.js
View file @
6f66f7f
export
default
{
export
default
{
axios
:
{
axios
:
{
baseURL
:
'http://cas.dev.glsx.net/admin-operating-auth/'
,
//
baseURL: 'http://cas.dev.glsx.net/admin-operating-auth/',
//
baseURL: 'http://192.168.3.171:7300/mock/5b91805391b67469b43e2921/subsystem/',
baseURL
:
'http://192.168.3.171:7300/mock/5b91805391b67469b43e2921/subsystem/'
,
whiteList
:
[
'role/deleteRoleById'
,
'role/deleteUserRoleById'
,
'role/getRoleDetail'
,
'role/getRoleDetail'
,
'role/getRoleList'
,
'role/isRoleNameExit'
,
'role/saveRoleList'
,
'role/selectMenuTreeRoleId'
,
'role/selectUserRoleByRoleId'
,
'role/updateRole'
,
'
role/userList'
,
'role/roleList
'
],
whiteList
:
[
'role/deleteRoleById'
,
'role/deleteUserRoleById'
,
'role/getRoleDetail'
,
'role/getRoleDetail'
,
'role/getRoleList'
,
'role/isRoleNameExit'
,
'role/saveRoleList'
,
'role/selectMenuTreeRoleId'
,
'role/selectUserRoleByRoleId'
,
'role/updateRole'
,
'
user/batcheDel'
,
'user/findAll'
,
'user/get'
,
'user/getWithRoles'
,
'user/operatUser'
,
'user/updateUser
'
],
timeout
:
15000
,
timeout
:
15000
,
result
:
{
result
:
{
data_key
:
'data'
,
// 返回值数据实体存放对象
data_key
:
'data'
,
// 返回值数据实体存放对象
...
...
src/views/customer/role/index.vue
View file @
6f66f7f
...
@@ -105,9 +105,6 @@ export default {
...
@@ -105,9 +105,6 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
// roleTest.req().then(res => {
// this.roleData.data = res.roleData
// })
this
.
getList
()
this
.
getList
()
},
},
// search--------------------
// search--------------------
...
@@ -143,16 +140,18 @@ export default {
...
@@ -143,16 +140,18 @@ export default {
// 获取页面参数
// 获取页面参数
getParams
()
{
getParams
()
{
return
{
return
{
pageSize
:
this
.
pageSize
,
//
pageSize: this.pageSize,
pageNum
:
this
.
pageNum
,
//
pageNum: this.pageNum,
roleName
:
this
.
roleName
roleName
:
this
.
roleName
}
}
},
},
// 接口请求-start---------------------------------------
// 接口请求-start---------------------------------------
// 获取展示数据,请求表格数据
// 获取展示数据,请求表格数据
getList
()
{
getList
()
{
// 接口
const
params
=
this
.
getParams
()
const
params
=
this
.
getParams
()
getRoleList
.
req
(
params
).
then
(
res
=>
{
getRoleList
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
total
=
res
.
total
this
.
total
=
res
.
total
this
.
roleData
.
data
=
res
.
list
this
.
roleData
.
data
=
res
.
list
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -190,11 +189,6 @@ export default {
...
@@ -190,11 +189,6 @@ export default {
},
},
handleSearchRoleName
()
{
handleSearchRoleName
()
{
this
.
getList
()
this
.
getList
()
// this.roleData.data = this.roleData.data.filter(item => {
// if (item.roleName.indexOf(this.roleName) !== -1) {
// return item
// }
// })
// this.roleName = ''
// this.roleName = ''
},
},
handleGetRoleDetail
(
params
)
{
handleGetRoleDetail
(
params
)
{
...
...
src/views/customer/user/index.vue
View file @
6f66f7f
...
@@ -13,7 +13,9 @@
...
@@ -13,7 +13,9 @@
<!--
<user-form
:dialogFormVisible=
"dialogFormVisible"
:editUser=
"editUser"
@
userFormData=
"handleUserFormData"
></user-form>
-->
<!--
<user-form
:dialogFormVisible=
"dialogFormVisible"
:editUser=
"editUser"
@
userFormData=
"handleUserFormData"
></user-form>
-->
</div>
</div>
<div
class=
"m-b8"
>
<div
class=
"m-b8"
>
<gl-table
:table=
"userData"
ref=
"multipleTable"
:pagination=
"pagination"
></gl-table>
<gl-table
:table=
"userData"
ref=
"multipleTable"
></gl-table>
<gl-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pageNum"
:page-sizes=
"[10,20,30,40]"
:page-size=
"pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</gl-pagination>
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"handleUserDetailClose"
:dataParam=
"[]"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam"
></user-detail>
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"handleUserDetailClose"
:dataParam=
"[]"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam"
></user-detail>
</div>
</div>
</div>
</div>
...
@@ -22,7 +24,7 @@
...
@@ -22,7 +24,7 @@
<
script
>
<
script
>
import
{
UserForm
,
UserDetail
}
from
'@/components/index'
import
{
UserForm
,
UserDetail
}
from
'@/components/index'
// import { getUser } from '@/api/userA
pi'
import
{
findAll
}
from
'@/api/a
pi'
import
{
userDetailColumn
}
from
'@/common/commonConst'
import
{
userDetailColumn
}
from
'@/common/commonConst'
export
default
{
export
default
{
name
:
'user'
,
name
:
'user'
,
...
@@ -37,6 +39,11 @@ export default {
...
@@ -37,6 +39,11 @@ export default {
editUser
:
{},
editUser
:
{},
userDetailVisible
:
false
,
userDetailVisible
:
false
,
userDetailTitle
:
'用户详情'
,
userDetailTitle
:
'用户详情'
,
// 分页所需参数-start
total
:
10
,
pageNum
:
1
,
pageSize
:
10
,
// 分页所需参数-end
columnParam
:
[],
columnParam
:
[],
consoleParam
:
[],
consoleParam
:
[],
userData
:
{
userData
:
{
...
@@ -105,23 +112,32 @@ export default {
...
@@ -105,23 +112,32 @@ export default {
},
},
selection
:
{},
selection
:
{},
multipleSelection
:
[]
multipleSelection
:
[]
},
pagination
:
{
show
:
true
,
layout
:
'total, sizes, prev, pager, next, jumper'
,
style
:
{
marginTop
:
'20px'
}
}
}
}
}
},
},
mounted
()
{
mounted
()
{
// getUser.req().then(res => {
this
.
findUserList
()
// this.userData.data = res.userData
// console.log(res.userData)
// })
},
},
methods
:
{
methods
:
{
// 获取所需字段
getParams
()
{
return
{
// pageSize: this.pageSize,
// pageNum: this.pageNum,
username
:
this
.
userName
}
},
// 接口请求-start
findUserList
()
{
const
params
=
this
.
getParams
()
findAll
.
req
(
params
).
then
(
res
=>
{
this
.
total
=
res
.
total
this
.
userData
.
data
=
res
.
list
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
// 接口请求-end
message
(
message
,
type
)
{
message
(
message
,
type
)
{
type
&&
this
.
$message
({
type
&&
this
.
$message
({
showClose
:
true
,
showClose
:
true
,
...
@@ -180,7 +196,17 @@ export default {
...
@@ -180,7 +196,17 @@ export default {
this
.
multipleSelection
=
val
this
.
multipleSelection
=
val
},
},
finduserName
()
{
finduserName
()
{
this
.
userName
=
''
// this.userName = ''
this
.
findUserList
()
},
// 调取接口相关函数
handleSizeChange
(
val
)
{
this
.
pageSize
=
val
this
.
findUserList
()
},
handleCurrentChange
(
val
)
{
this
.
pageNum
=
val
this
.
findUserList
()
},
},
delteSelected
(
index
,
rows
)
{
delteSelected
(
index
,
rows
)
{
console
.
log
(
rows
)
console
.
log
(
rows
)
...
...
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