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
Show 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
=
{
getPage
:
'/sys/role/page'
,
...
...
@@ -46,3 +46,11 @@ export function changeStatus(id) {
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 {
props
:
{
title
:
{
type
:
String
,
default
:
'
服务预约
管理'
,
default
:
'
城市匠人
管理'
,
required
:
false
},
showTitle
:
{
...
...
src/views/notice/HomeNotice.vue
View file @
b8ea022c
...
...
@@ -74,7 +74,13 @@ export default {
columns
,
useYScroll
:
true
,
title
:
'首页通知管理'
,
codes
:
[[
'BIZ0003'
],
[]]
codes
:
[[
'BIZ0003'
],
[]],
toolbar
:
[
{
text
:
'新建'
,
handler
:
'add'
}
]
}
},
methods
:
{
...
...
@@ -123,6 +129,9 @@ export default {
},
detail
(
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
...
...
@@ -3,106 +3,82 @@
<a-form
@
submit=
"handleSubmit"
:form=
"form"
class=
"cust-detail-form"
>
<header-tool-bar>
<span
class=
"cust-title"
slot=
"title"
>
<a-icon
type=
"hdd"
/>
系统用户详情
<a-icon
type=
"hdd"
/>
系统用户详情
</span>
<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-group>
</header-tool-bar>
<a-card
title=
"用户基础数据"
class=
"cust-normal-card"
>
<a-row
:gutter=
"gutter"
>
<a-col
:span=
"span"
>
<a-form-item
v-bind=
"formItemLayout"
label=
'用户名'
>
<a-form-item
v-bind=
"formItemLayout"
label=
"用户名"
>
<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-col>
<a-col
:span=
"span"
>
<a-form-item
v-bind=
"formItemLayout"
label=
'真实姓名'
>
<a-form-item
v-bind=
"formItemLayout"
label=
"真实姓名"
>
<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-col>
<a-col
:span=
"span"
>
<a-form-item
v-bind=
"formItemLayout"
label=
'联系电话'
>
<a-form-item
v-bind=
"formItemLayout"
label=
"联系电话"
>
<a-input
oninput =
"value=value.replace(/[^\d]/g,'')"
v-decorator=
"['mobile',
{initialValue: userDate.mobile, rules: [{ required: true, message: '请输入电话!' }]}]"
oninput=
"value=value.replace(/[^\d]/g,'')"
v-decorator=
"[
'phone',
{
initialValue: userDate.phone,
rules: [{ required: true, message: '请输入电话!' }]
}
]"
/>
</a-form-item>
</a-col>
<a-col
:span=
"span"
>
<a-form-item
v-bind=
"formItemLayout"
label=
'邮箱'
>
<a-form-item
v-bind=
"formItemLayout"
label=
"邮箱"
>
<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-col>
</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-col
:span=
"6"
>
<a-form-item
v-bind=
"formItemLayout"
label=
'头像'
>
<a-form-item
v-bind=
"formItemLayout"
label=
"头像"
>
<a-upload
:rows=
"3"
v-decorator=
"['avatar',
{
v-decorator=
"[
'avatar',
{
valuePropName: 'imageList',
getValueFromEvent: normFile,
rules: [{ required: false, message: '请上传用户头像' }]
}]"
}
]"
style="width: 100%"
:defaultFileList="imageList"
:fileList="imageList"
...
...
@@ -113,21 +89,35 @@
@preview="handlePreview"
>
<div
v-if=
"imageList.length
<
1
"
>
<a-icon
type=
"plus"
/>
<a-icon
type=
"plus"
/>
<div
class=
"ant-upload-text"
>
上传图片
</div>
</div>
</a-upload>
<a-modal
:visible=
"previewVisible"
:footer=
"null"
@
cancel=
"handleCancel"
>
<img
alt=
"example"
style=
"width: 100%"
:src=
"previewImage"
/>
<a-modal
:visible=
"previewVisible"
:footer=
"null"
@
cancel=
"handleCancel"
>
<img
alt=
"example"
style=
"width: 100%"
:src=
"previewImage"
/>
</a-modal>
</a-form-item>
</a-col>
<a-col
:span=
"12"
>
<a-form-item
:labelCol=
"
{span: 4}"
:wrapperCol="{span: 20}"
label='备注' >
<a-textarea
:rows=
"3"
v-decorator=
"['remark',
{initialValue: userDate.remark, rules: [{ required: false, message: '' }]}]"/>
:labelCol=
"
{ span: 4 }"
:wrapperCol="{ span: 20 }"
label="备注"
>
<a-textarea
:rows=
"3"
v-decorator=
"[
'remark',
{
initialValue: userDate.remark,
rules: [{ required: false, message: '' }]
}
]"
/>
</a-form-item>
</a-col>
</a-row>
...
...
@@ -140,7 +130,10 @@
size=
"middle"
:pagination=
"false"
class=
"cust-card-table"
:rowSelection=
"
{selectedRowKeys: selectedRowKeys, onChange: updateSelect}"
:rowSelection=
"
{
selectedRowKeys: selectedRowKeys,
onChange: updateSelect
}"
bordered
>
</a-table>
...
...
@@ -150,27 +143,27 @@
</
template
>
<
script
>
import
HeaderToolBar
from
'@/components/page/HeaderToolBar'
import
{
getDetail
,
save
,}
from
'@/api/system/sysUserApi'
import
{
getCommonCode
}
from
"@/api/system/sysCode"
;
import
{
import
HeaderToolBar
from
'@/components/page/HeaderToolBar'
import
{
getDetail
,
save
}
from
'@/api/system/sysUserApi'
import
{
getOneImageURL
,
getUploadImageHeader
,
getUploadImageUrl
,
isLoading
,
isUpdateSuccess
}
from
"@/api/common/fileUpload"
;
}
from
'@/api/common/fileUpload'
import
{
getAll
}
from
'@/api/system/sysRole'
let
listPathName
=
'sysuserlist'
;
const
columns
=
[
{
title
:
'角色名称'
,
dataIndex
:
'name'
,
width
:
250
},
{
title
:
'角色Code'
,
dataIndex
:
'code'
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,},
]
let
listPathName
=
'sysUserList'
const
columns
=
[
{
title
:
'角色名称'
,
dataIndex
:
'name'
,
width
:
250
},
{
title
:
'角色Code'
,
dataIndex
:
'code'
},
{
title
:
'备注'
,
dataIndex
:
'remark'
}
]
export
default
{
name
:
"SysUserDetail"
,
components
:
{
HeaderToolBar
},
export
default
{
name
:
'SysUserDetail'
,
components
:
{
HeaderToolBar
},
data
()
{
return
{
id
:
0
,
...
...
@@ -181,9 +174,9 @@
columns
:
columns
,
currentEditDate
:
{},
selectedRowKeys
:
[],
officeList
:
[],
officeList
:
[],
visible
:
false
,
imageList
:
[],
imageList
:
[],
orgList
:
[],
authorityTypeList
:
[],
loading
:
false
,
...
...
@@ -193,24 +186,24 @@
uploadImageHeader
:
getUploadImageHeader
(),
formItemLayout
:
{
labelCol
:
{
sm
:
{
span
:
8
},
sm
:
{
span
:
8
}
},
wrapperCol
:
{
sm
:
{
span
:
16
},
},
sm
:
{
span
:
16
}
}
},
gutter
:
8
,
span
:
6
,
span
:
6
}
},
activated
()
{
this
.
getSysCode
();
this
.
getSysCode
()
},
deactivated
()
{
this
.
form
.
resetFields
()
this
.
userDate
=
{};
this
.
selectedRowKeys
=
[];
this
.
imageList
=
[];
this
.
userDate
=
{}
this
.
selectedRowKeys
=
[]
this
.
imageList
=
[]
},
methods
:
{
getUploadImageUrl
,
...
...
@@ -218,43 +211,52 @@
isLoading
,
getOneImageURL
,
initData
()
{
this
.
id
=
this
.
$route
.
query
.
id
||
0
;
getDetail
(
this
.
id
).
then
(
resp
=>
{
this
.
id
=
this
.
$route
.
query
.
id
||
0
getDetail
(
this
.
id
).
then
((
resp
)
=>
{
if
(
resp
&&
resp
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
userDate
=
resp
.
data
.
sysUserDetail
;
this
.
roleList
=
resp
.
data
.
sysUserRoleList
||
[];
this
.
officeList
=
resp
.
data
.
officeList
||
[];
this
.
selectedRowKeys
=
resp
.
data
.
sysUserCheckedRoleList
||
[];
this
.
userDate
=
resp
.
data
.
sysUserDetail
this
.
selectedRowKeys
=
resp
.
data
.
sysUserCheckedRoleList
||
[]
if
(
this
.
userDate
.
avatar
!=
null
)
{
let
image
=
{
uid
:
'-1'
,
name
:
'xxx.png'
,
status
:
'done'
,
url
:
this
.
userDate
.
avatar
,
};
this
.
imageList
.
push
(
image
);
url
:
this
.
userDate
.
avatar
}
this
.
imageList
.
push
(
image
)
}
}
})
},
handleSubmit
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
()
this
.
form
.
validateFieldsAndScroll
((
err
,
values
)
=>
{
if
(
!
err
)
{
if
(
this
.
selectedRowKeys
.
length
===
0
)
{
this
.
$notification
.
error
({
message
:
'系统提示'
,
description
:
"至少勾选一个角色"
,
duration
:
4
,});
this
.
$notification
.
error
({
message
:
'系统提示'
,
description
:
'至少勾选一个角色'
,
duration
:
4
})
return
}
values
.
avatar
=
getOneImageURL
(
this
.
imageList
);
values
.
avatar
=
getOneImageURL
(
this
.
imageList
)
let
saveData
=
{
sysUserDetail
:
this
.
$valueCopy
(
this
.
userDate
,
values
),
sysUserCheckedRoleList
:
this
.
selectedRowKeys
,
};
save
(
saveData
).
then
(
resp
=>
{
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
}})
this
.
$notification
.
success
({
message
:
'系统提示'
,
description
:
'保存成功'
,
duration
:
4
})
this
.
$router
.
push
({
name
:
listPathName
,
query
:
{
isModify
:
this
.
id
!=
0
}
})
}
})
}
...
...
@@ -264,7 +266,7 @@
this
.
selectedRowKeys
=
selectedRowKeys
},
back
()
{
this
.
$router
.
push
({
name
:
listPathName
})
this
.
$router
.
push
({
name
:
listPathName
})
},
normFile
(
e
)
{
if
(
Array
.
isArray
(
e
))
{
...
...
@@ -272,29 +274,25 @@
}
return
e
&&
e
.
fileList
},
handleChangeImg
({
fileList
})
{
this
.
isUpdateSuccess
(
fileList
);
this
.
loading
=
this
.
isLoading
(
fileList
);
this
.
imageList
=
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
;
this
.
previewImage
=
file
.
url
||
file
.
thumbUrl
this
.
previewVisible
=
true
},
handleCancel
()
{
this
.
previewVisible
=
false
;
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
()
getAll
().
then
(({
data
})
=>
{
this
.
roleList
=
data
})
},
}
};
}
}
</
script
>
src/views/system/user/SysUserList.vue
View file @
b8ea022c
<
template
>
<div>
<a-card
class=
"cust-list-cart"
>
<div>
<a-form
layout=
"horizontal"
class=
"ant-advanced-search-form"
>
<div>
<a-row>
<a-col
:span=
"6"
>
<a-form-item
label=
"用户名"
v-bind=
"formItemLayout"
>
<a-input
@
pressEnter=
"search"
v-model=
"query.username"
placeholder=
"请输入"
/>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
label=
"真实姓名"
v-bind=
"formItemLayout"
>
<a-input
@
pressEnter=
"search"
style=
"width: 100%"
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"
>
<table-template
:soul=
"this"
>
<template
#
tags=
"
{ 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
#
action=
"{ record }"
>
<a
@
click=
"editRow(record)"
v-if=
"record.id != 1"
>
编辑
</a>
<a-divider
type=
"vertical"
v-if=
"record.id != 1"
/>
<a
@
click=
"resetPwd(record)"
v-if=
"record.id != 1"
>
重置密码
</a>
</
template
>
</table-template>
</template>
<
script
>
import
{
changeStatus
,
getPage
,
resetPwd
}
from
"@/api/system/sysUserApi"
;
import
{
getCommonCode
}
from
"@/api/system/sysCode"
;
import
{
formatDate
,
humpToLine
,
setOrder
}
from
"@/util/util"
;
import
{
TableTemplate
,
TableScript
,
SearchType
}
from
'@/components/table'
import
{
changeStatus
,
getPage
,
resetPwd
}
from
'@/api/system/sysUserApi'
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},
const
columns
=
[
{
title
:
'用户名'
,
dataIndex
:
'userName'
,
width
:
120
,
filter
:
{
type
:
SearchType
.
STRING
}
},
{
title
:
'真实姓名'
,
dataIndex
:
'realName'
,
width
:
90
,
filter
:
{
type
:
SearchType
.
STRING
}
},
{
title
:
'联系电话'
,
dataIndex
:
'phone'
,
width
:
100
,
filter
:
{
type
:
SearchType
.
STRING
}
},
{
title
:
'邮箱'
,
dataIndex
:
'email'
,
width
:
150
},
{
title
:
'备注'
,
dataIndex
:
'remark'
},
{
title
:
'创建时间'
,
dataIndex
:
'ctDate'
,
width
:
12
0
,
width
:
17
0
,
sorter
:
true
,
customRender
:
(
text
)
=>
formatDate
(
new
Date
(
text
),
'yyyy-MM-dd hh:mm
'
)
customRender
:
(
text
)
=>
dayjs
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss
'
)
},
// {title: '修改人', dataIndex: 'lm_user_name',width:70},
{
title
:
'修改时间'
,
dataIndex
:
'lmDate'
,
width
:
14
0
,
width
:
17
0
,
sorter
:
true
,
customRender
:
(
text
)
=>
formatDate
(
new
Date
(
text
),
'yyyy-MM-dd hh:mm
'
)
customRender
:
(
text
)
=>
dayjs
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss
'
)
},
{
title
:
'状态'
,
dataIndex
:
'available'
,
width
:
80
,
scopedSlots
:
{
customRender
:
'tags'
}},
// {title: '状态', dataIndex: 'available', width: 60, },
{
title
:
'操作'
,
key
:
'operation'
,
width
:
130
,
scopedSlots
:
{
customRender
:
'action'
}}
];
let
detailPathName
=
'sysuserdetail'
{
title
:
'状态'
,
dataIndex
:
'available'
,
width
:
80
,
align
:
'center'
,
scopedSlots
:
{
customRender
:
'tags'
},
enum
:
'SYS0002'
,
filter
:
{
type
:
SearchType
.
ENUM
}
},
{
title
:
'操作'
,
key
:
'operation'
,
width
:
130
,
scopedSlots
:
{
customRender
:
'action'
}
}
]
export
default
{
export
default
{
name
:
'SysUserList'
,
mixins
:
[
TableScript
],
components
:
{
TableTemplate
},
data
()
{
return
{
query
:
{
page
:
1
,
size
:
10
,
username
:
""
,
realName
:
""
,
mobile
:
""
,
available
:
""
,
order
:
""
,
sort
:
""
},
total
:
0
,
rowKey
:
"id"
,
columns
:
columns
,
dataSource
:
dataSource
,
selectedRowKeys
:
[],
selectedRows
:
[],
coachList
:
[],
currentEditDate
:
{},
coachId
:
{},
sysUserId
:
{},
rowDate
:
{},
availabStatus
:
{},
formItemLayout
:
{
labelCol
:
{
sm
:
{
span
:
8
},
},
wrapperCol
:
{
sm
:
{
span
:
16
},
},
}
title
:
'系统用户'
,
columns
,
codes
:
[[
'SYS0002'
],
[]],
toolbar
:
[
{
text
:
'新建'
,
handler
:
'addNew'
}
},
computed
:
{
defaultPageSize
:
function
()
{
return
this
.
$defaultPageSize
()
]
}
},
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
();
}
});
},
queryData
:
getPage
,
addNew
()
{
this
.
editRow
()
},
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
()
{
this
.
loadData
();
setStatus
(
record
)
{
changeStatus
(
record
.
id
).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
this
.
loadData
()
}
})
},
resetPwd
(
rowData
)
{
let
_this
=
this
;
let
_this
=
this
let
contText
=
'确定重置['
+
rowData
.
realName
+
']的密码?'
this
.
$confirm
({
title
:
'提示'
,
content
:
contText
,
onOk
()
{
resetPwd
(
rowData
.
id
).
then
(
response
=>
{
resetPwd
(
rowData
.
id
).
then
((
response
)
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
_this
.
$notification
.
success
({
message
:
'系统提示'
,
description
:
"重置密码成功"
,
duration
:
4
,
});
}
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
()
}
}
onCancel
()
{}
})
}
}
}
</
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