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
ea6b09d8
Commit
ea6b09d8
authored
Jul 13, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 用户管理
parent
acc9ef70
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
115 additions
and
6 deletions
+115
-6
index.html
public/index.html
+1
-1
user.js
src/api/user.js
+23
-0
router.config.js
src/router/router.config.js
+1
-1
util.js
src/util/util.js
+4
-4
Login.vue
src/views/system/Login.vue
+0
-0
UserList.vue
src/views/user/UserList.vue
+86
-0
No files found.
public/index.html
View file @
ea6b09d8
...
...
@@ -5,7 +5,7 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.png"
>
<title>
房屋线上修缮
系统
</title>
<title>
城市匠人管理
系统
</title>
<script
type=
"text/javascript"
src=
"https://api.map.baidu.com/api?v=2.0&ak=8uuOYfYHUCjgSm0uEelyMxaLcaQSRiM0"
></script>
</head>
<body>
...
...
src/api/user.js
0 → 100644
View file @
ea6b09d8
import
{
axios
}
from
'@/util/axios/request'
const
BANNER_URL
=
'/user'
export
function
getPage
(
data
)
{
return
axios
({
url
:
`
${
BANNER_URL
}
/page`
,
method
:
'post'
,
data
})
}
export
function
save
(
data
)
{
return
axios
({
url
:
BANNER_URL
,
method
:
'put'
,
data
,
})
}
src/router/router.config.js
View file @
ea6b09d8
...
...
@@ -15,7 +15,7 @@ export const constantRouterMap = [
{
path
:
'login'
,
name
:
'login'
,
component
:
()
=>
import
(
'@/views/
user
/Login'
)
component
:
()
=>
import
(
'@/views/
system
/Login'
)
}
]
},
...
...
src/util/util.js
View file @
ea6b09d8
...
...
@@ -109,18 +109,18 @@ export { bizCode, bizCodeMapping };
*/
export
function
getCodeOptions
(
codes
,
valueFiled
)
{
if
(
!
valueFiled
)
{
valueFiled
=
'
valueInt
'
;
valueFiled
=
'
code
'
;
}
return
getCommonCode
(
codes
).
then
(({
data
:
{
data
}
})
=>
{
return
getCommonCode
(
codes
).
then
(({
data
})
=>
{
const
codeMapping
=
{};
const
options
=
{};
Object
.
keys
(
data
).
forEach
((
k
)
=>
{
const
codeArray
=
data
[
k
];
const
map
=
{};
options
[
k
]
=
codeArray
.
map
(
c
=>
{
map
[
c
[
valueFiled
]]
=
c
[
'
nam
e'
];
map
[
c
[
valueFiled
]]
=
c
[
'
valu
e'
];
return
{
title
:
c
[
'
nam
e'
],
title
:
c
[
'
valu
e'
],
value
:
c
[
valueFiled
]
};
});
...
...
src/views/
user
/Login.vue
→
src/views/
system
/Login.vue
View file @
ea6b09d8
File moved
src/views/user/UserList.vue
0 → 100644
View file @
ea6b09d8
<
template
>
<table-template
:soul=
"this"
>
<template
#
avatar=
"
{ record }">
<a-avatar
:src=
"record.avatar"
/>
</
template
>
<
template
#
userType=
"{ record }"
>
<span
>
{{
record
.
roleTypeValue
}}
<a-dropdown
:trigger=
"['click']"
>
<a><a-icon
type=
"edit"
@
click=
"(e) => e.preventDefault()"
/></a>
<a-menu
slot=
"overlay"
@
click=
"(
{ key }) => edit(key, record)">
<a-menu-item
key=
"0"
>
修改为 普通用户
</a-menu-item>
<a-menu-item
key=
"1"
>
修改为 客服
</a-menu-item>
<a-menu-item
key=
"2"
>
修改为 估价员
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</
template
>
</table-template>
</template>
<
script
>
import
{
TableTemplate
,
TableScript
,
SearchType
}
from
'@/components/table'
import
{
getPage
,
save
}
from
'@/api/user'
import
dayjs
from
'dayjs'
const
columns
=
[
{
title
:
'头像'
,
scopedSlots
:
{
customRender
:
'avatar'
},
width
:
120
},
{
title
:
'用户名'
,
dataIndex
:
'userName'
,
width
:
120
,
filter
:
{
type
:
SearchType
.
STRING
}
},
{
title
:
'昵称'
,
dataIndex
:
'nickName'
},
{
title
:
'手机'
,
dataIndex
:
'phone'
,
filter
:
{
type
:
SearchType
.
STRING
}
},
{
title
:
'微信唯一id'
,
dataIndex
:
'unionId'
},
{
title
:
'小程序id'
,
dataIndex
:
'openId'
},
{
title
:
'用户类型'
,
dataIndex
:
'roleType'
,
hidden
:
true
,
enum
:
'BIZ0001'
,
filter
:
{
type
:
SearchType
.
ENUM
}
},
{
title
:
'用户类型'
,
scopedSlots
:
{
customRender
:
'userType'
}
},
{
title
:
'注册时间'
,
dataIndex
:
'createTime'
,
width
:
180
,
filter
:
{
type
:
SearchType
.
RANGE
},
customRender
:
(
text
)
=>
dayjs
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
]
export
default
{
name
:
'UserList'
,
mixins
:
[
TableScript
],
components
:
{
TableTemplate
},
data
()
{
return
{
columns
,
useYScroll
:
true
,
codes
:
[[
'BIZ0001'
],
[]]
}
},
methods
:
{
queryData
:
getPage
,
edit
(
key
,
record
)
{
if
(
key
==
record
.
roleType
)
{
return
}
if
(
key
!=
0
&&
!
record
.
phone
)
{
this
.
$message
.
error
(
'用户未绑定手机号'
)
return
}
save
({
id
:
record
.
id
,
roleType
:
key
}).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
this
.
$message
.
success
(
'保存成功'
)
this
.
reset
()
}
})
}
}
}
</
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