Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quasar-web-base
Project
Project
Details
Activity
Releases
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
Nguyễn Hải Sơn
quasar-web-base
Commits
ea945e99
Commit
ea945e99
authored
Apr 23, 2021
by
Võ Quang Thành Đạt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create user page
parent
b295345e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
204 additions
and
0 deletions
+204
-0
configurations.example.ts
src/assets/configurations.example.ts
+1
-0
type.ts
src/assets/type.ts
+29
-0
index.ts
src/i18n/vi/index.ts
+16
-0
User.ts
src/pages/nguoi-dung/User.ts
+102
-0
index.vue
src/pages/nguoi-dung/index.vue
+50
-0
routes.ts
src/router/routes.ts
+6
-0
No files found.
src/assets/configurations.example.ts
View file @
ea945e99
...
@@ -26,4 +26,5 @@ export enum API_PATHS {
...
@@ -26,4 +26,5 @@ export enum API_PATHS {
deleteGroupUser
=
'/user/group/delete'
,
deleteGroupUser
=
'/user/group/delete'
,
getUserGroupDetail
=
'/user/group/detail'
,
getUserGroupDetail
=
'/user/group/detail'
,
updateUserGroupInfo
=
'/user/group/update'
,
updateUserGroupInfo
=
'/user/group/update'
,
getListUsers
=
'/user/list'
,
}
}
src/assets/type.ts
0 → 100644
View file @
ea945e99
export
type
PaginationResponse
<
DataType
>
=
{
pageIndex
:
null
|
number
;
pageSize
:
null
|
number
;
totalPages
:
number
;
totalRecords
:
number
;
beginIndex
:
number
;
endIndex
:
number
;
data
:
DataType
[];
};
export
type
UserObject
=
{
id
:
number
;
userName
:
string
;
password
:
string
;
fullName
:
null
|
string
;
birthday
:
null
|
string
;
email
:
null
|
string
;
phoneNumber
:
null
|
string
;
mobileNumber
:
null
|
string
;
sex
:
number
;
address
:
null
|
string
;
unit
:
null
|
number
;
status
:
number
;
isAdmin
:
null
|
number
;
createTime
:
null
|
string
;
createBy
:
null
|
string
;
updateTime
:
null
|
string
;
updateBy
:
null
|
string
;
};
src/i18n/vi/index.ts
View file @
ea945e99
...
@@ -58,4 +58,20 @@ export default {
...
@@ -58,4 +58,20 @@ export default {
confirmDeleteGroupCancelBtnLabel
:
'Huỷ'
,
confirmDeleteGroupCancelBtnLabel
:
'Huỷ'
,
},
},
},
},
userPage
:
{
title
:
'Quản lý người dùng'
,
tableColumns
:
{
userName
:
'Tên đăng nhập'
,
fullName
:
'Họ tên'
,
email
:
'Email'
,
phone
:
'SĐT'
,
unit
:
'Đơn vị'
,
status
:
'Trạng thái'
,
action
:
'Chức năng'
,
},
statusLabel
:
{
active
:
'Đang hoạt động'
,
inactive
:
'Ngừng hoạt động'
,
},
},
};
};
src/pages/nguoi-dung/User.ts
0 → 100644
View file @
ea945e99
import
{
AxiosResponse
}
from
'axios'
;
import
{
API_PATHS
,
config
}
from
'src/assets/configurations'
;
import
{
PaginationResponse
,
UserObject
}
from
'src/assets/type'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
defineComponent
,
onMounted
,
Ref
,
ref
}
from
'vue'
;
export
default
defineComponent
({
setup
()
{
const
totalPage
=
ref
(
0
);
const
pageIndex
=
ref
(
1
);
const
pageSize
=
ref
(
20
);
const
userTableColumns
=
[
{
name
:
'userName'
,
field
:
'userName'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'userPage.tableColumns.userName'
),
align
:
'left'
,
sortable
:
true
,
},
{
name
:
'fullName'
,
field
:
'fullName'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'userPage.tableColumns.fullName'
),
align
:
'left'
,
sortable
:
true
,
},
{
name
:
'email'
,
field
:
'email'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'userPage.tableColumns.email'
),
align
:
'left'
,
sortable
:
true
,
},
{
name
:
'phoneNumber'
,
field
:
'phoneNumber'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'userPage.tableColumns.phone'
),
align
:
'left'
,
sortable
:
true
,
},
{
name
:
'unit'
,
field
:
'unit'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'userPage.tableColumns.unit'
),
align
:
'left'
,
sortable
:
true
,
},
{
name
:
'status'
,
field
:
'status'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'userPage.tableColumns.status'
),
align
:
'left'
,
sortable
:
true
,
},
{
name
:
'action'
,
field
:
'action'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'userPage.tableColumns.action'
),
align
:
'left'
,
sortable
:
true
,
},
];
const
userTableRows
:
Ref
<
UserObject
[]
>
=
ref
([]);
const
getListUsers
=
async
()
=>
{
try
{
const
response
=
(
await
api
({
url
:
API_PATHS
.
getListUsers
,
method
:
'GET'
,
params
:
{
pageIndex
:
pageIndex
.
value
,
pageSize
:
pageSize
.
value
,
},
}))
as
AxiosResponse
<
BaseResponseBody
<
PaginationResponse
<
UserObject
>>>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
userTableRows
.
value
=
response
.
data
.
data
.
data
;
totalPage
.
value
=
response
.
data
.
data
.
totalPages
;
console
.
log
(
response
.
data
.
data
);
}
}
catch
(
error
)
{}
};
onMounted
(()
=>
{
void
getListUsers
();
});
return
{
rows
:
userTableRows
,
userTableColumns
,
totalPage
,
pageIndex
,
pageSize
,
};
},
});
src/pages/nguoi-dung/index.vue
0 → 100644
View file @
ea945e99
<
template
>
<div
class=
"row q-col-gutter-sm"
>
<div
class=
"col-12"
>
<q-table
:rows=
"rows"
:columns=
"userTableColumns"
row-key=
"name"
separator=
"cell"
hide-pagination
>
<template
v-slot:top
>
<q-th
class=
"row"
>
<div
class=
"col-2 text-h6 text-weight-regular"
>
{{
$t
(
'userPage.title'
)
}}
</div>
</q-th>
</
template
>
<
template
v-slot:body-cell-status=
"rowData"
>
<q-td
class=
"flex flex-center"
>
<q-chip
:color=
"rowData.value ? 'positive' : undefined"
text-color=
"white"
size=
"sm"
>
{{
rowData
.
value
?
$t
(
'userPage.statusLabel.active'
)
:
$t
(
'userPage.statusLabel.inactive'
)
}}
</q-chip>
</q-td>
</
template
>
</q-table>
</div>
<div
class=
"col-12 q-pa-lg flex flex-center"
>
<q-pagination
v-model=
"pageIndex"
:max=
"totalPage"
direction-links
boundary-links
icon-first=
"skip_previous"
icon-last=
"skip_next"
icon-prev=
"fast_rewind"
icon-next=
"fast_forward"
/>
</div>
</div>
</template>
<
script
lang=
"ts"
src=
"./User.ts"
></
script
>
src/router/routes.ts
View file @
ea945e99
...
@@ -4,6 +4,7 @@ export enum Pages {
...
@@ -4,6 +4,7 @@ export enum Pages {
home
=
'home'
,
home
=
'home'
,
login
=
'login'
,
login
=
'login'
,
groupUsers
=
'nhom-nguoi-dung'
,
groupUsers
=
'nhom-nguoi-dung'
,
cmsUser
=
'nguoi-dung'
,
}
}
const
routes
:
RouteRecordRaw
[]
=
[
const
routes
:
RouteRecordRaw
[]
=
[
...
@@ -26,6 +27,11 @@ const routes: RouteRecordRaw[] = [
...
@@ -26,6 +27,11 @@ const routes: RouteRecordRaw[] = [
component
:
()
=>
import
(
'pages/nhom-nguoi-dung/index.vue'
),
component
:
()
=>
import
(
'pages/nhom-nguoi-dung/index.vue'
),
name
:
Pages
.
groupUsers
,
name
:
Pages
.
groupUsers
,
},
},
{
path
:
'/nguoi-dung'
,
component
:
()
=>
import
(
'pages/nguoi-dung/index.vue'
),
name
:
Pages
.
cmsUser
,
},
],
],
},
},
...
...
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