Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service-admin-view
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
external
on-site-service-admin-view
Commits
b8ea022c
Commit
b8ea022c
authored
Jul 27, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 用户管理
parent
00348101
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
347 additions
and
530 deletions
+347
-530
sysRole.js
src/api/system/sysRole.js
+9
-1
Logo.vue
src/components/tools/Logo.vue
+1
-1
HomeNotice.vue
src/views/notice/HomeNotice.vue
+10
-1
SysRoleRouteView.vue
src/views/system/role/SysRoleRouteView.vue
+0
-17
SysUserDetail.vue
src/views/system/user/SysUserDetail.vue
+212
-214
SysUserList.vue
src/views/system/user/SysUserList.vue
+115
-279
SysUserRouteView.vue
src/views/system/user/SysUserRouteView.vue
+0
-17
No files found.
src/api/system/sysRole.js
View file @
b8ea022c
import
{
axios
}
from
'@/util/axios/request'
import
{
axios
}
from
'@/util/axios/request'
const
api
=
{
const
api
=
{
getPage
:
'/sys/role/page'
,
getPage
:
'/sys/role/page'
,
...
@@ -46,3 +46,11 @@ export function changeStatus(id) {
...
@@ -46,3 +46,11 @@ export function changeStatus(id) {
useFullLoading
:
true
useFullLoading
:
true
})
})
}
}
export
function
getAll
()
{
return
axios
({
url
:
'/sys/role/all-available'
,
method
:
'get'
})
}
\ No newline at end of file
src/components/tools/Logo.vue
View file @
b8ea022c
...
@@ -13,7 +13,7 @@ export default {
...
@@ -13,7 +13,7 @@ export default {
props
:
{
props
:
{
title
:
{
title
:
{
type
:
String
,
type
:
String
,
default
:
'
服务预约
管理'
,
default
:
'
城市匠人
管理'
,
required
:
false
required
:
false
},
},
showTitle
:
{
showTitle
:
{
...
...
src/views/notice/HomeNotice.vue
View file @
b8ea022c
...
@@ -74,7 +74,13 @@ export default {
...
@@ -74,7 +74,13 @@ export default {
columns
,
columns
,
useYScroll
:
true
,
useYScroll
:
true
,
title
:
'首页通知管理'
,
title
:
'首页通知管理'
,
codes
:
[[
'BIZ0003'
],
[]]
codes
:
[[
'BIZ0003'
],
[]],
toolbar
:
[
{
text
:
'新建'
,
handler
:
'add'
}
]
}
}
},
},
methods
:
{
methods
:
{
...
@@ -123,6 +129,9 @@ export default {
...
@@ -123,6 +129,9 @@ export default {
},
},
detail
(
id
)
{
detail
(
id
)
{
this
.
$refs
.
NoticeDetail
.
show
(
id
)
this
.
$refs
.
NoticeDetail
.
show
(
id
)
},
add
()
{
this
.
$refs
.
NoticeDetail
.
show
(
null
)
}
}
}
}
}
}
...
...
src/views/system/role/SysRoleRouteView.vue
deleted
100644 → 0
View file @
00348101
<
template
>
<keep-alive
v-if=
"keepAlive"
>
<router-view/>
</keep-alive>
<router-view
v-else
/>
</
template
>
<
script
>
export
default
{
name
:
"SysRoleRouteView"
,
computed
:
{
keepAlive
()
{
return
this
.
$route
.
meta
.
keepAlive
}
},
}
</
script
>
\ No newline at end of file
src/views/system/user/SysUserDetail.vue
View file @
b8ea022c
...
@@ -2,107 +2,83 @@
...
@@ -2,107 +2,83 @@
<div>
<div>
<a-form
@
submit=
"handleSubmit"
:form=
"form"
class=
"cust-detail-form"
>
<a-form
@
submit=
"handleSubmit"
:form=
"form"
class=
"cust-detail-form"
>
<header-tool-bar>
<header-tool-bar>
<span
class=
"cust-title"
slot=
"title"
>
<span
class=
"cust-title"
slot=
"title"
>
<a-icon
type=
"hdd"
/>
系统用户详情
<a-icon
type=
"hdd"
/>
系统用户详情
</span>
</span>
<a-button-group
slot=
"extra"
>
<a-button-group
slot=
"extra"
>
<a-button
type=
'primary'
htmlType=
'submit'
>
保存
</a-button>
<a-button
type=
"primary"
htmlType=
"submit"
>
保存
</a-button>
<a-button
type=
"primary"
@
click=
"back"
ghost
>
返回
</a-button>
<a-button
type=
"primary"
@
click=
"back"
ghost
>
返回
</a-button>
</a-button-group>
</a-button-group>
</header-tool-bar>
</header-tool-bar>
<a-card
title=
"用户基础数据"
class=
"cust-normal-card"
>
<a-card
title=
"用户基础数据"
class=
"cust-normal-card"
>
<a-row
:gutter=
"gutter"
>
<a-row
:gutter=
"gutter"
>
<a-col
:span=
"span"
>
<a-col
:span=
"span"
>
<a-form-item
<a-form-item
v-bind=
"formItemLayout"
label=
"用户名"
>
v-bind=
"formItemLayout"
label=
'用户名'
>
<a-input
<a-input
v-decorator=
"['username',
{initialValue: userDate.username, rules: [{ required: true, message: '请输入用户名!' }]}]"
v-decorator=
"[
'userName',
{
initialValue: userDate.userName,
rules: [{ required: true, message: '请输入用户名!' }]
}
]"
/>
/>
</a-form-item>
</a-form-item>
</a-col>
</a-col>
<a-col
:span=
"span"
>
<a-col
:span=
"span"
>
<a-form-item
<a-form-item
v-bind=
"formItemLayout"
label=
"真实姓名"
>
v-bind=
"formItemLayout"
label=
'真实姓名'
>
<a-input
<a-input
v-decorator=
"['realName',
{initialValue: userDate.realName, rules: [{ required: true, message: '请输入真实姓名!' }]}]"
v-decorator=
"[
'realName',
{
initialValue: userDate.realName,
rules: [{ required: true, message: '请输入真实姓名!' }]
}
]"
/>
/>
</a-form-item>
</a-form-item>
</a-col>
</a-col>
<a-col
:span=
"span"
>
<a-col
:span=
"span"
>
<a-form-item
<a-form-item
v-bind=
"formItemLayout"
label=
"联系电话"
>
v-bind=
"formItemLayout"
label=
'联系电话'
>
<a-input
<a-input
oninput =
"value=value.replace(/[^\d]/g,'')"
oninput=
"value=value.replace(/[^\d]/g,'')"
v-decorator=
"['mobile',
{initialValue: userDate.mobile, rules: [{ required: true, message: '请输入电话!' }]}]"
v-decorator=
"[
'phone',
{
initialValue: userDate.phone,
rules: [{ required: true, message: '请输入电话!' }]
}
]"
/>
/>
</a-form-item>
</a-form-item>
</a-col>
</a-col>
<a-col
:span=
"span"
>
<a-col
:span=
"span"
>
<a-form-item
<a-form-item
v-bind=
"formItemLayout"
label=
"邮箱"
>
v-bind=
"formItemLayout"
label=
'邮箱'
>
<a-input
<a-input
v-decorator=
"['email',
{initialValue: userDate.email, rules: [{ required: false, message: '请输入电话!' }]}]"
v-decorator=
"[
'email',
{
initialValue: userDate.email,
rules: [{ required: false, message: '请输入电话!' }]
}
]"
/>
/>
</a-form-item>
</a-form-item>
</a-col>
</a-col>
</a-row>
</a-row>
<a-row>
<a-col
:span=
"6"
>
<a-form-item
v-bind=
"formItemLayout"
label=
'所属分局: '
>
<a-select
style=
'width: 100%'
v-decorator=
"['communityId',
{initialValue: userDate.communityId, rules: [{ required: true, message: '选择分局' }]}]"
>
<a-select-option
v-for=
"item in officeList"
:key=
"item.id"
:value=
"item.id"
>
{{
item
.
name
}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
v-bind=
"formItemLayout"
label=
'所属科室: '
>
<a-select
style=
'width: 100%'
v-decorator=
"['org',
{initialValue: userDate.org, rules: [{ required: true, message: '选择科室' }]}]"
>
<a-select-option
v-for=
"item in orgList"
:key=
"item.id"
:value=
"item.valueInt"
>
{{
item
.
name
}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
v-bind=
"formItemLayout"
label=
'数据权限: '
>
<a-select
style=
'width: 100%'
v-decorator=
"['dataAccessType',
{initialValue: userDate.dataAccessType, rules: [{ required: true, message: '选择权限' }]}]"
>
<a-select-option
v-for=
"item in authorityTypeList"
:key=
"item.id"
:value=
"item.valueInt"
>
{{
item
.
name
}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row
:utter=
"gutter"
>
<a-row
:utter=
"gutter"
>
<a-col
:span=
"6"
>
<a-col
:span=
"6"
>
<a-form-item
<a-form-item
v-bind=
"formItemLayout"
label=
"头像"
>
v-bind=
"formItemLayout"
label=
'头像'
>
<a-upload
<a-upload
:rows=
"3"
:rows=
"3"
v-decorator=
"['avatar',
{
v-decorator=
"[
valuePropName: 'imageList',
'avatar',
getValueFromEvent: normFile,
{
rules: [{ required: false, message: '请上传用户头像' }]
valuePropName: 'imageList',
}]"
getValueFromEvent: normFile,
rules: [{ required: false, message: '请上传用户头像' }]
}
]"
style="width: 100%"
style="width: 100%"
:defaultFileList="imageList"
:defaultFileList="imageList"
:fileList="imageList"
:fileList="imageList"
...
@@ -113,21 +89,35 @@
...
@@ -113,21 +89,35 @@
@preview="handlePreview"
@preview="handlePreview"
>
>
<div
v-if=
"imageList.length
<
1
"
>
<div
v-if=
"imageList.length
<
1
"
>
<a-icon
type=
"plus"
/>
<a-icon
type=
"plus"
/>
<div
class=
"ant-upload-text"
>
上传图片
</div>
<div
class=
"ant-upload-text"
>
上传图片
</div>
</div>
</div>
</a-upload>
</a-upload>
<a-modal
:visible=
"previewVisible"
:footer=
"null"
@
cancel=
"handleCancel"
>
<a-modal
<img
alt=
"example"
style=
"width: 100%"
:src=
"previewImage"
/>
:visible=
"previewVisible"
:footer=
"null"
@
cancel=
"handleCancel"
>
<img
alt=
"example"
style=
"width: 100%"
:src=
"previewImage"
/>
</a-modal>
</a-modal>
</a-form-item>
</a-form-item>
</a-col>
</a-col>
<a-col
:span=
"12"
>
<a-col
:span=
"12"
>
<a-form-item
<a-form-item
:labelCol=
"
{span: 4}"
:labelCol=
"
{ span: 4 }"
:wrapperCol="{span: 20}"
:wrapperCol="{ span: 20 }"
label='备注' >
label="备注"
<a-textarea
:rows=
"3"
v-decorator=
"['remark',
{initialValue: userDate.remark, rules: [{ required: false, message: '' }]}]"/>
>
<a-textarea
:rows=
"3"
v-decorator=
"[
'remark',
{
initialValue: userDate.remark,
rules: [{ required: false, message: '' }]
}
]"
/>
</a-form-item>
</a-form-item>
</a-col>
</a-col>
</a-row>
</a-row>
...
@@ -140,7 +130,10 @@
...
@@ -140,7 +130,10 @@
size=
"middle"
size=
"middle"
:pagination=
"false"
:pagination=
"false"
class=
"cust-card-table"
class=
"cust-card-table"
:rowSelection=
"
{selectedRowKeys: selectedRowKeys, onChange: updateSelect}"
:rowSelection=
"
{
selectedRowKeys: selectedRowKeys,
onChange: updateSelect
}"
bordered
bordered
>
>
</a-table>
</a-table>
...
@@ -150,151 +143,156 @@
...
@@ -150,151 +143,156 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
HeaderToolBar
from
'@/components/page/HeaderToolBar'
import
HeaderToolBar
from
'@/components/page/HeaderToolBar'
import
{
getDetail
,
save
,
}
from
'@/api/system/sysUserApi'
import
{
getDetail
,
save
}
from
'@/api/system/sysUserApi'
import
{
getCommonCode
}
from
"@/api/system/sysCode"
;
import
{
import
{
getOneImageURL
,
getOneImageURL
,
getUploadImageHeader
,
getUploadImageHeader
,
getUploadImageUrl
,
getUploadImageUrl
,
isLoading
,
isLoading
,
isUpdateSuccess
isUpdateSuccess
}
from
'@/api/common/fileUpload'
}
from
"@/api/common/fileUpload"
;
import
{
getAll
}
from
'@/api/system/sysRole'
let
listPathName
=
'sysuserlist'
;
let
listPathName
=
'sysUserList'
const
columns
=
[
const
columns
=
[
{
title
:
'角色名称'
,
dataIndex
:
'name'
,
width
:
250
},
{
title
:
'角色名称'
,
dataIndex
:
'name'
,
width
:
250
},
{
title
:
'角色Code'
,
dataIndex
:
'code'
,
},
{
title
:
'角色Code'
,
dataIndex
:
'code'
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,},
{
title
:
'备注'
,
dataIndex
:
'remark'
}
]
]
export
default
{
export
default
{
name
:
"SysUserDetail"
,
name
:
'SysUserDetail'
,
components
:
{
HeaderToolBar
},
components
:
{
HeaderToolBar
},
data
()
{
data
()
{
return
{
return
{
id
:
0
,
id
:
0
,
form
:
this
.
$form
.
createForm
(
this
),
form
:
this
.
$form
.
createForm
(
this
),
userDate
:
{},
userDate
:
{},
roleList
:
[],
roleList
:
[],
typeList
:
[],
typeList
:
[],
columns
:
columns
,
columns
:
columns
,
currentEditDate
:
{},
currentEditDate
:
{},
selectedRowKeys
:
[],
selectedRowKeys
:
[],
officeList
:[],
officeList
:
[],
visible
:
false
,
visible
:
false
,
imageList
:[],
imageList
:
[],
orgList
:
[],
orgList
:
[],
authorityTypeList
:
[],
authorityTypeList
:
[],
loading
:
false
,
loading
:
false
,
previewVisible
:
false
,
previewVisible
:
false
,
previewImage
:
''
,
previewImage
:
''
,
business
:
'sys-user'
,
business
:
'sys-user'
,
uploadImageHeader
:
getUploadImageHeader
(),
uploadImageHeader
:
getUploadImageHeader
(),
formItemLayout
:
{
formItemLayout
:
{
labelCol
:
{
labelCol
:
{
sm
:
{
span
:
8
},
sm
:
{
span
:
8
}
},
wrapperCol
:
{
sm
:
{
span
:
16
},
},
},
},
gutter
:
8
,
wrapperCol
:
{
span
:
6
,
sm
:
{
span
:
16
}
}
}
},
},
activated
()
{
gutter
:
8
,
this
.
getSysCode
();
span
:
6
},
}
deactivated
()
{
},
this
.
form
.
resetFields
()
activated
()
{
this
.
userDate
=
{};
this
.
getSysCode
()
this
.
selectedRowKeys
=
[];
},
this
.
imageList
=
[];
deactivated
()
{
},
this
.
form
.
resetFields
()
methods
:
{
this
.
userDate
=
{}
getUploadImageUrl
,
this
.
selectedRowKeys
=
[]
isUpdateSuccess
,
this
.
imageList
=
[]
isLoading
,
},
getOneImageURL
,
methods
:
{
initData
()
{
getUploadImageUrl
,
this
.
id
=
this
.
$route
.
query
.
id
||
0
;
isUpdateSuccess
,
getDetail
(
this
.
id
).
then
(
resp
=>
{
isLoading
,
if
(
resp
&&
resp
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
getOneImageURL
,
this
.
userDate
=
resp
.
data
.
sysUserDetail
;
initData
()
{
this
.
roleList
=
resp
.
data
.
sysUserRoleList
||
[];
this
.
id
=
this
.
$route
.
query
.
id
||
0
this
.
officeList
=
resp
.
data
.
officeList
||
[];
getDetail
(
this
.
id
).
then
((
resp
)
=>
{
this
.
selectedRowKeys
=
resp
.
data
.
sysUserCheckedRoleList
||
[];
if
(
resp
&&
resp
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
userDate
=
resp
.
data
.
sysUserDetail
this
.
selectedRowKeys
=
resp
.
data
.
sysUserCheckedRoleList
||
[]
if
(
this
.
userDate
.
avatar
!=
null
)
{
if
(
this
.
userDate
.
avatar
!=
null
)
{
let
image
=
{
let
image
=
{
uid
:
'-1'
,
uid
:
'-1'
,
name
:
'xxx.png'
,
name
:
'xxx.png'
,
status
:
'done'
,
status
:
'done'
,
url
:
this
.
userDate
.
avatar
,
url
:
this
.
userDate
.
avatar
};
this
.
imageList
.
push
(
image
);
}
}
this
.
imageList
.
push
(
image
)
}
}
})
}
},
})
handleSubmit
(
e
)
{
},
e
.
preventDefault
();
handleSubmit
(
e
)
{
this
.
form
.
validateFieldsAndScroll
((
err
,
values
)
=>
{
e
.
preventDefault
()
if
(
!
err
)
{
this
.
form
.
validateFieldsAndScroll
((
err
,
values
)
=>
{
if
(
this
.
selectedRowKeys
.
length
===
0
)
{
if
(
!
err
)
{
this
.
$notification
.
error
({
message
:
'系统提示'
,
description
:
"至少勾选一个角色"
,
duration
:
4
,});
if
(
this
.
selectedRowKeys
.
length
===
0
)
{
return
this
.
$notification
.
error
({
}
message
:
'系统提示'
,
values
.
avatar
=
getOneImageURL
(
this
.
imageList
);
description
:
'至少勾选一个角色'
,
let
saveData
=
{
duration
:
4
sysUserDetail
:
this
.
$valueCopy
(
this
.
userDate
,
values
),
sysUserCheckedRoleList
:
this
.
selectedRowKeys
,
};
save
(
saveData
).
then
(
resp
=>
{
if
(
resp
&&
resp
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
$notification
.
success
({
message
:
'系统提示'
,
description
:
"保存成功"
,
duration
:
4
,});
this
.
$router
.
push
({
name
:
listPathName
,
query
:
{
isModify
:
this
.
id
!=
0
}})
}
})
})
return
}
}
})
values
.
avatar
=
getOneImageURL
(
this
.
imageList
)
},
let
saveData
=
{
updateSelect
(
selectedRowKeys
)
{
sysUserDetail
:
this
.
$valueCopy
(
this
.
userDate
,
values
),
this
.
selectedRowKeys
=
selectedRowKeys
sysUserCheckedRoleList
:
this
.
selectedRowKeys
},
back
()
{
this
.
$router
.
push
({
name
:
listPathName
})
},
normFile
(
e
)
{
if
(
Array
.
isArray
(
e
))
{
return
e
}
return
e
&&
e
.
fileList
},
handleChangeImg
({
fileList
})
{
this
.
isUpdateSuccess
(
fileList
);
this
.
loading
=
this
.
isLoading
(
fileList
);
this
.
imageList
=
fileList
;
},
handlePreview
(
file
)
{
this
.
previewImage
=
file
.
url
||
file
.
thumbUrl
;
this
.
previewVisible
=
true
;
},
handleCancel
()
{
this
.
previewVisible
=
false
;
},
getSysCode
()
{
getCommonCode
([
SYS_CONST
.
CODE
.
UNIT_TYPE
,
SYS_CONST
.
CODE
.
AUTHORITY_TYPE
]).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
orgList
=
response
.
data
.
data
[
SYS_CONST
.
CODE
.
UNIT_TYPE
];
this
.
authorityTypeList
=
response
.
data
.
data
[
SYS_CONST
.
CODE
.
AUTHORITY_TYPE
];
}
}
this
.
initData
()
save
(
saveData
).
then
((
resp
)
=>
{
})
if
(
resp
&&
resp
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
},
this
.
$notification
.
success
({
message
:
'系统提示'
,
description
:
'保存成功'
,
duration
:
4
})
this
.
$router
.
push
({
name
:
listPathName
,
query
:
{
isModify
:
this
.
id
!=
0
}
})
}
})
}
})
},
updateSelect
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
},
back
()
{
this
.
$router
.
push
({
name
:
listPathName
})
},
normFile
(
e
)
{
if
(
Array
.
isArray
(
e
))
{
return
e
}
return
e
&&
e
.
fileList
},
handleChangeImg
({
fileList
})
{
this
.
isUpdateSuccess
(
fileList
)
this
.
loading
=
this
.
isLoading
(
fileList
)
this
.
imageList
=
fileList
},
handlePreview
(
file
)
{
this
.
previewImage
=
file
.
url
||
file
.
thumbUrl
this
.
previewVisible
=
true
},
handleCancel
()
{
this
.
previewVisible
=
false
},
getSysCode
()
{
this
.
initData
()
getAll
().
then
(({
data
})
=>
{
this
.
roleList
=
data
})
}
}
};
}
}
</
script
>
</
script
>
src/views/system/user/SysUserList.vue
View file @
b8ea022c
<
template
>
<
template
>
<div>
<table-template
:soul=
"this"
>
<a-card
class=
"cust-list-cart"
>
<template
#
tags=
"
{ record }">
<div>
<a-switch
<a-form
layout=
"horizontal"
class=
"ant-advanced-search-form"
>
:disabled=
"record.id == 1"
<div>
checkedChildren=
"启用"
<a-row>
unCheckedChildren=
"禁用"
<a-col
:span=
"6"
>
@
click=
"setStatus(record)"
<a-form-item
label=
"用户名"
v-bind=
"formItemLayout"
>
:checked=
"record.available"
<a-input
@
pressEnter=
"search"
v-model=
"query.username"
placeholder=
"请输入"
/>
/>
</a-form-item>
</
template
>
</a-col>
<
template
#
action=
"{ record }"
>
<a-col
:span=
"6"
>
<a
@
click=
"editRow(record)"
v-if=
"record.id != 1"
>
编辑
</a>
<a-form-item
label=
"真实姓名"
v-bind=
"formItemLayout"
>
<a-divider
type=
"vertical"
v-if=
"record.id != 1"
/>
<a-input
<a
@
click=
"resetPwd(record)"
v-if=
"record.id != 1"
>
重置密码
</a>
@
pressEnter=
"search"
</
template
>
style=
"width: 100%"
</table-template>
v-model=
"query.realName"
placeholder=
"请输入"
/>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
label=
"电话"
v-bind=
"formItemLayout"
>
<a-input-number
@
pressEnter=
"search"
style=
"width: 100%"
v-model=
"query.mobile"
placeholder=
"请输入"
/>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
label=
"状态"
v-bind=
"formItemLayout"
>
<a-select
placeholder=
"请选择状态"
v-model=
"query.available"
@
change=
"this.onChangeStatus"
:allowClear=
"true"
>
<a-select-option
v-for=
"option in availabStatus"
v-bind:value=
"option.valueInt"
v-bind:key=
"option.id"
>
{{
option
.
name
}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</div>
</a-form>
</div>
<div>
<a-table
size=
"middle"
@
change=
"sortChange"
:columns=
"columns"
:dataSource=
"dataSource"
:pagination=
"false"
:rowKey=
"rowKey"
:rowSelection=
"
{selectedRowKeys: selectedRowKeys, onChange: updateSelect}"
bordered
>
<div
slot=
"title"
slot-scope=
"data"
>
<span
class=
"cust-title"
>
<a-icon
type=
"hdd"
/>
系统用户
{{
data
.
none
}}
</span>
<div
class=
"cust-table-operator"
>
<a-button-group>
<a-button
type=
"primary"
@
click=
"search"
>
查询
</a-button>
<a-button
@
click=
"reset"
>
重置
</a-button>
<a-button
@
click=
"addNew"
>
新建
</a-button>
</a-button-group>
</div>
</div>
<div
slot=
"footer"
slot-scope=
"data"
>
{{
data
.
none
}}
<a-pagination
@
change=
"pageChange"
:defaultPageSize=
"defaultPageSize"
:pageSizeOptions=
"$pageSizeOptions"
@
showSizeChange=
"sizeChange"
class=
"cust-pagination"
size=
"small"
:total=
"total"
showSizeChanger
showQuickJumper
:showTotal=
"$showTotal"
/>
</div>
<span
slot=
"action"
slot-scope=
"text, record"
v-if=
"record.id!=1"
>
<a
@
click=
"editRow(record)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<a
@
click=
"resetPwd(record)"
>
重置密码
</a>
</span>
<span
slot=
"tags"
slot-scope=
"text, record"
>
<a-switch
:disabled=
"record.id == 1"
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
@
click=
"setStatus(record)"
:checked=
"record.available"
:key=
"record.id"
/>
</span>
</a-table>
</div>
</a-card>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
changeStatus
,
getPage
,
resetPwd
}
from
"@/api/system/sysUserApi"
;
import
{
TableTemplate
,
TableScript
,
SearchType
}
from
'@/components/table'
import
{
getCommonCode
}
from
"@/api/system/sysCode"
;
import
{
changeStatus
,
getPage
,
resetPwd
}
from
'@/api/system/sysUserApi'
import
{
formatDate
,
humpToLine
,
setOrder
}
from
"@/util/util"
;
import
dayjs
from
'dayjs'
const
dataSource
=
[]
const
columns
=
[
{
title
:
'用户名'
,
dataIndex
:
'username'
,
width
:
120
},
{
title
:
'真实姓名'
,
dataIndex
:
'realName'
,
width
:
90
},
{
title
:
'联系电话'
,
dataIndex
:
'mobile'
,
width
:
100
},
{
title
:
'邮箱'
,
dataIndex
:
'email'
,
width
:
150
},
{
title
:
'备注'
,
dataIndex
:
'remark'
},
// {title: '创建人', dataIndex: 'ct_user_name', width:70},
{
title
:
'创建时间'
,
dataIndex
:
'ctDate'
,
width
:
120
,
sorter
:
true
,
customRender
:
(
text
)
=>
formatDate
(
new
Date
(
text
),
'yyyy-MM-dd hh:mm'
)
},
// {title: '修改人', dataIndex: 'lm_user_name',width:70},
{
title
:
'修改时间'
,
dataIndex
:
'lmDate'
,
width
:
140
,
sorter
:
true
,
customRender
:
(
text
)
=>
formatDate
(
new
Date
(
text
),
'yyyy-MM-dd hh:mm'
)
},
{
title
:
'状态'
,
dataIndex
:
'available'
,
width
:
80
,
scopedSlots
:
{
customRender
:
'tags'
}},
// {title: '状态', dataIndex: 'available', width: 60, },
{
title
:
'操作'
,
key
:
'operation'
,
width
:
130
,
scopedSlots
:
{
customRender
:
'action'
}}
];
let
detailPathName
=
'sysuserdetail'
export
default
{
const
columns
=
[
name
:
'SysUserList'
,
{
data
()
{
title
:
'用户名'
,
return
{
dataIndex
:
'userName'
,
query
:
{
width
:
120
,
page
:
1
,
filter
:
{
type
:
SearchType
.
STRING
}
size
:
10
,
},
username
:
""
,
{
realName
:
""
,
title
:
'真实姓名'
,
mobile
:
""
,
dataIndex
:
'realName'
,
available
:
""
,
width
:
90
,
order
:
""
,
filter
:
{
type
:
SearchType
.
STRING
}
sort
:
""
},
},
{
total
:
0
,
title
:
'联系电话'
,
rowKey
:
"id"
,
dataIndex
:
'phone'
,
columns
:
columns
,
width
:
100
,
dataSource
:
dataSource
,
filter
:
{
type
:
SearchType
.
STRING
}
selectedRowKeys
:
[],
},
selectedRows
:
[],
{
title
:
'邮箱'
,
dataIndex
:
'email'
,
width
:
150
},
coachList
:
[],
{
title
:
'备注'
,
dataIndex
:
'remark'
},
currentEditDate
:
{},
{
coachId
:
{},
title
:
'创建时间'
,
sysUserId
:
{},
dataIndex
:
'ctDate'
,
rowDate
:
{},
width
:
170
,
availabStatus
:
{},
sorter
:
true
,
customRender
:
(
text
)
=>
dayjs
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
},
{
title
:
'修改时间'
,
dataIndex
:
'lmDate'
,
width
:
170
,
sorter
:
true
,
customRender
:
(
text
)
=>
dayjs
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
},
{
title
:
'状态'
,
dataIndex
:
'available'
,
width
:
80
,
align
:
'center'
,
scopedSlots
:
{
customRender
:
'tags'
},
enum
:
'SYS0002'
,
filter
:
{
type
:
SearchType
.
ENUM
}
},
{
title
:
'操作'
,
key
:
'operation'
,
width
:
130
,
scopedSlots
:
{
customRender
:
'action'
}
}
]
formItemLayout
:
{
export
default
{
labelCol
:
{
name
:
'SysUserList'
,
sm
:
{
span
:
8
},
mixins
:
[
TableScript
],
},
components
:
{
TableTemplate
},
wrapperCol
:
{
data
()
{
sm
:
{
span
:
16
},
return
{
},
title
:
'系统用户'
,
columns
,
codes
:
[[
'SYS0002'
],
[]],
toolbar
:
[
{
text
:
'新建'
,
handler
:
'addNew'
}
}
}
]
},
}
computed
:
{
},
defaultPageSize
:
function
()
{
methods
:
{
return
this
.
$defaultPageSize
()
queryData
:
getPage
,
}
},
methods
:
{
search
()
{
this
.
query
.
page
=
1
;
this
.
loadData
();
},
reset
()
{
this
.
query
.
page
=
1
;
this
.
query
.
username
=
""
;
this
.
query
.
realName
=
""
;
this
.
query
.
mobile
=
""
;
this
.
query
.
available
=
""
;
this
.
loadData
();
},
pageChange
(
page
)
{
this
.
query
.
page
=
page
;
this
.
loadData
();
},
sizeChange
(
current
,
size
)
{
this
.
query
.
size
=
size
;
this
.
loadData
();
},
loadData
(
pageSize
)
{
if
(
pageSize
&&
!
isNaN
(
pageSize
))
{
this
.
query
.
size
=
pageSize
}
getPage
(
this
.
query
).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
let
respData
=
response
.
data
;
this
.
total
=
respData
.
total
;
this
.
dataSource
=
respData
.
list
;
}
});
},
sortChange
(
pagination
,
filters
,
sorter
)
{
this
.
query
.
sort
=
humpToLine
(
sorter
.
field
);
this
.
query
.
order
=
setOrder
(
sorter
.
order
);
this
.
loadData
();
},
setStatus
(
record
)
{
changeStatus
(
record
.
id
).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
loadData
();
}
});
},
addNew
()
{
addNew
()
{
this
.
editRow
()
this
.
editRow
()
},
},
editRow
(
row
)
{
editRow
(
row
)
{
this
.
$router
.
push
({
name
:
detailPathName
,
query
:
{
id
:
row
?
row
.
id
:
0
}})
this
.
$router
.
push
({
name
:
'sysUserDetail'
,
query
:
{
id
:
row
?
row
.
id
:
0
}})
},
updateSelect
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
},
},
onChangeStatus
()
{
setStatus
(
record
)
{
this
.
loadData
();
changeStatus
(
record
.
id
).
then
(({
code
})
=>
{
},
if
(
code
==
200
)
{
resetPwd
(
rowData
)
{
let
_this
=
this
;
let
contText
=
'确定重置['
+
rowData
.
realName
+
']的密码?'
this
.
$confirm
({
title
:
'提示'
,
content
:
contText
,
onOk
()
{
resetPwd
(
rowData
.
id
).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
_this
.
$notification
.
success
({
message
:
'系统提示'
,
description
:
"重置密码成功"
,
duration
:
4
,
});
}
})
},
onCancel
()
{
},
});
},
getavailable
()
{
getCommonCode
([
SYS_CONST
.
CODE
.
SYS_AVAILABLE_STATUS
]).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
availabStatus
=
response
.
data
.
data
[
SYS_CONST
.
CODE
.
SYS_AVAILABLE_STATUS
];
}
})
},
},
mounted
()
{
// 查询状态下拉菜单
this
.
getavailable
();
this
.
loadData
(
this
.
defaultPageSize
);
},
activated
()
{
if
(
this
.
isFirstLoad
==
true
)
{
this
.
loadData
(
this
.
defaultPageSize
)
this
.
isFirstLoad
=
false
}
else
{
let
isModify
=
this
.
$route
.
query
.
isModify
if
(
isModify
==
true
)
{
this
.
loadData
()
}
else
if
(
isModify
!=
undefined
)
{
this
.
loadData
()
this
.
loadData
()
}
}
}
})
},
resetPwd
(
rowData
)
{
let
_this
=
this
let
contText
=
'确定重置['
+
rowData
.
realName
+
']的密码?'
this
.
$confirm
({
title
:
'提示'
,
content
:
contText
,
onOk
()
{
resetPwd
(
rowData
.
id
).
then
((
response
)
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
_this
.
$notification
.
success
({
message
:
'系统提示'
,
description
:
'重置密码成功'
,
duration
:
4
})
}
})
},
onCancel
()
{}
})
}
}
}
}
</
script
>
}
</
script
>
\ No newline at end of file
src/views/system/user/SysUserRouteView.vue
deleted
100644 → 0
View file @
00348101
<
template
>
<keep-alive
v-if=
"keepAlive"
>
<router-view
/>
</keep-alive>
<router-view
v-else
/>
</
template
>
<
script
>
export
default
{
name
:
"SysUserRouteView"
,
computed
:
{
keepAlive
()
{
return
this
.
$route
.
meta
.
keepAlive
}
},
}
</
script
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment