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
29898b8f
Commit
29898b8f
authored
Apr 22, 2021
by
Võ Quang Thành Đạt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update base
parent
fe148fd3
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
253 additions
and
3 deletions
+253
-3
quasar.conf.js
quasar.conf.js
+1
-1
configurations.example.ts
src/assets/configurations.example.ts
+1
-1
GroupInfo.ts
src/components/group-info/GroupInfo.ts
+12
-0
index.vue
src/components/group-info/index.vue
+88
-0
UserGroup.ts
src/components/user-group/UserGroup.ts
+15
-0
index.vue
src/components/user-group/index.vue
+37
-0
UserGroup.ts
src/pages/nhom-nguoi-dung/UserGroup.ts
+26
-0
index.vue
src/pages/nhom-nguoi-dung/index.vue
+16
-0
routes.ts
src/router/routes.ts
+6
-0
actions.ts
src/store/authentication/actions.ts
+19
-0
mutations.ts
src/store/authentication/mutations.ts
+10
-1
state.ts
src/store/authentication/state.ts
+22
-0
No files found.
quasar.conf.js
View file @
29898b8f
...
@@ -80,7 +80,7 @@ module.exports = configure(function (ctx) {
...
@@ -80,7 +80,7 @@ module.exports = configure(function (ctx) {
// Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
// Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
devServer
:
{
devServer
:
{
https
:
false
,
https
:
false
,
port
:
8080
,
port
:
10706
,
open
:
true
,
// opens browser window automatically
open
:
true
,
// opens browser window automatically
},
},
...
...
src/assets/configurations.example.ts
View file @
29898b8f
...
@@ -21,5 +21,5 @@ export enum API_PATHS {
...
@@ -21,5 +21,5 @@ export enum API_PATHS {
login
=
'/user/login'
,
login
=
'/user/login'
,
getUserGroups
=
'/group/get_list'
,
getUserGroups
=
'/group/get_list'
,
getGroupInfo
=
'/group/get_info'
,
getGroupInfo
=
'/group/get_info'
,
getListPages
=
'/page/list'
,
getListPages
=
'/
user/
page/list'
,
}
}
src/components/group-info/GroupInfo.ts
0 → 100644
View file @
29898b8f
import
{
defineComponent
,
ref
}
from
'vue'
;
const
check
=
ref
(
false
);
const
check1
=
ref
(
false
);
const
check2
=
ref
(
false
);
const
check3
=
ref
(
false
);
export
const
GroupInfoScript
=
defineComponent
({
setup
()
{
return
{
check
,
check1
,
check2
,
check3
};
},
});
src/components/group-info/index.vue
0 → 100644
View file @
29898b8f
<
template
>
<q-card
flat
bordered
class=
"my-card"
>
<q-card-section
style=
"padding-top: 28px"
>
<div
class=
"row"
>
<div
class=
"col-4"
style=
"display: flex"
>
<div
class=
"text-h5"
>
Thông tin nhóm
</div>
</div>
<div
class=
"col-8"
style=
"display: flex; justify-content: flex-end"
>
<q-btn
style=
"margin-right: 8px"
color=
"red"
icon=
"delete"
label=
"Xoá"
/>
<q-btn
color=
"primary"
icon=
"update"
label=
"Cập nhật"
/>
</div>
<div
style=
"position: absolute; top: 0; right: 0"
>
<q-icon
size=
"x-large"
name=
"close"
color=
"primary"
/>
</div>
</div>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-input
outlined
placeholder=
"Tên nhóm *"
disable
/>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-input
outlined
placeholder=
"Mô tả *"
disable
/>
</q-card-section>
<q-card-section>
<div
class=
"row"
>
<div
class=
"col-6"
>
<q-list
bordered
padding
>
<q-item
tag=
"label"
v-ripple
>
<q-item-section
side
top
>
<q-checkbox
v-model=
"check"
/>
</q-item-section>
<q-item-section>
<q-item-label
class=
"text-h5"
>
Trang
</q-item-label>
</q-item-section>
</q-item>
<q-item
tag=
"label"
v-ripple
>
<q-item-section
side
top
>
<q-checkbox
v-model=
"check1"
/>
</q-item-section>
<q-item-section>
<q-item-label
class=
"text-subtitle1"
style=
"display: flex"
>
Trang chủ
</q-item-label
>
</q-item-section>
</q-item>
<q-item
tag=
"label"
v-ripple
>
<q-item-section
side
top
>
<q-checkbox
v-model=
"check2"
/>
</q-item-section>
<q-item-section>
<q-item-label
style=
"display: flex"
class=
"text-subtitle1"
>
Người dùng
</q-item-label
>
</q-item-section>
</q-item>
<q-item
tag=
"label"
v-ripple
>
<q-item-section
side
top
>
<q-checkbox
v-model=
"check3"
/>
</q-item-section>
<q-item-section>
<q-item-label
style=
"display: flex"
class=
"text-subtitle1"
>
Nhóm người dùng
</q-item-label
>
</q-item-section>
</q-item>
</q-list>
</div>
<div
class=
"col-6"
></div>
</div>
</q-card-section>
</q-card>
</
template
>
<
script
lang=
"ts"
>
import
{
GroupInfoScript
}
from
'./GroupInfo'
;
export
default
GroupInfoScript
;
</
script
>
src/components/user-group/UserGroup.ts
0 → 100644
View file @
29898b8f
import
{
UserInfo
}
from
'src/store/authentication/state'
;
import
{
defineComponent
,
PropType
}
from
'vue'
;
// import { useStore } from 'src/store';
export
const
UserGroupScript
=
defineComponent
({
props
:
{
listUsers
:
{
type
:
Array
as
PropType
<
UserInfo
[]
>
,
required
:
true
,
},
},
setup
()
{
// const $store = useStore();
},
});
src/components/user-group/index.vue
0 → 100644
View file @
29898b8f
<
template
>
<q-card
flat
bordered
class=
"my-card"
>
<q-card-section
style=
"padding-top: 28px"
>
<div
class=
"row justify-start"
>
<div
class=
"col-9 text-h5"
style=
"display: flex"
>
<div>
Nhóm người dùng
</div>
</div>
<div
class=
"col-3"
>
<q-btn
color=
"primary"
label=
"THÊM MỚI"
/>
</div>
</div>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-input
outlined
placeholder=
"Tìm kiếm"
/>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-btn
v-for=
"(userItem, userItemIdx) in listUsers"
:key=
"`userItem-$
{userItemIdx}`"
align="left"
outline
size="large"
class="full-width my-1"
color="primary"
label="Admin"
no-caps
/>
</q-card-section>
</q-card>
</
template
>
<
script
lang=
"ts"
>
import
{
UserGroupScript
}
from
'./UserGroup'
;
export
default
UserGroupScript
;
</
script
>
src/pages/nhom-nguoi-dung/UserGroup.ts
0 → 100644
View file @
29898b8f
import
{
defineComponent
,
onMounted
,
ref
}
from
'vue'
;
import
{
useStore
}
from
'src/store'
;
import
UserGroupComponent
from
'../../components/user-group/index.vue'
;
import
GroupInfoComponent
from
'../../components/group-info/index.vue'
;
import
{
UserInfo
}
from
'src/store/authentication/state'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
BaseResponseBody
}
from
'src/boot/axios'
;
const
userList
=
ref
([
1
]);
export
const
UserGroup
=
defineComponent
({
components
:
{
UserGroupComponent
,
GroupInfoComponent
},
setup
()
{
const
$store
=
useStore
();
onMounted
(
async
()
=>
{
await
$store
.
dispatch
(
'authentication/getListUsers'
).
then
((
response
)
=>
{
const
res
=
response
as
AxiosResponse
<
BaseResponseBody
<
{
data
:
UserInfo
[]
}
>
>
;
if
(
!
res
.
data
.
error
.
code
)
{
// userList = res.data.data.data;
}
});
});
return
{
userList
};
},
});
src/pages/nhom-nguoi-dung/index.vue
0 → 100644
View file @
29898b8f
<
template
>
<q-page
padding
>
<div
class=
"row q-col-gutter-sm"
align=
"center"
justify=
"center"
>
<div
class=
"col-4"
>
<UserGroupComponent
:list-users=
"userList"
></UserGroupComponent>
</div>
<div
class=
"col-8"
>
<GroupInfoComponent></GroupInfoComponent>
</div>
</div>
</q-page>
</
template
>
<
script
lang=
"ts"
>
import
{
UserGroup
}
from
'./UserGroup'
;
export
default
UserGroup
;
</
script
>
src/router/routes.ts
View file @
29898b8f
...
@@ -3,6 +3,7 @@ import { RouteRecordRaw } from 'vue-router';
...
@@ -3,6 +3,7 @@ import { RouteRecordRaw } from 'vue-router';
export
enum
Pages
{
export
enum
Pages
{
home
=
'home'
,
home
=
'home'
,
login
=
'login'
,
login
=
'login'
,
groupUsers
=
'nhom-nguoi-dung'
,
}
}
const
routes
:
RouteRecordRaw
[]
=
[
const
routes
:
RouteRecordRaw
[]
=
[
...
@@ -20,6 +21,11 @@ const routes: RouteRecordRaw[] = [
...
@@ -20,6 +21,11 @@ const routes: RouteRecordRaw[] = [
component
:
()
=>
import
(
'pages/login/index.vue'
),
component
:
()
=>
import
(
'pages/login/index.vue'
),
name
:
Pages
.
login
,
name
:
Pages
.
login
,
},
},
{
path
:
'/nhom-nguoi-dung'
,
component
:
()
=>
import
(
'pages/nhom-nguoi-dung/index.vue'
),
name
:
Pages
.
groupUsers
,
},
],
],
},
},
...
...
src/store/authentication/actions.ts
View file @
29898b8f
...
@@ -95,6 +95,25 @@ const actions: ActionTree<AuthenticationState, StateInterface> = {
...
@@ -95,6 +95,25 @@ const actions: ActionTree<AuthenticationState, StateInterface> = {
}
}
}
catch
(
error
)
{}
}
catch
(
error
)
{}
},
},
async
getListUsers
()
{
try
{
const
response
=
(
await
api
({
url
:
API_PATHS
.
getListUsers
,
method
:
'GET'
,
params
:
{},
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
// if (!response.data.error.code) {
// const res = response as AxiosResponse<
// BaseResponseBody<{ data: UserInfo[] }>
// >;
// const listUser = res.data.data.data;
// console.log(listUser, 'listUser');
// context.commit('setUserList', listUser);
// }
return
response
;
}
catch
(
error
)
{}
},
};
};
export
default
actions
;
export
default
actions
;
src/store/authentication/mutations.ts
View file @
29898b8f
import
{
MutationTree
}
from
'vuex'
;
import
{
MutationTree
}
from
'vuex'
;
import
{
AuthenticationState
,
MenuItem
,
Page
,
RoleInfo
}
from
'./state'
;
import
{
AuthenticationState
,
MenuItem
,
Page
,
RoleInfo
,
UserInfo
,
}
from
'./state'
;
const
mutation
:
MutationTree
<
AuthenticationState
>
=
{
const
mutation
:
MutationTree
<
AuthenticationState
>
=
{
setToken
(
state
,
payload
:
string
)
{
setToken
(
state
,
payload
:
string
)
{
...
@@ -33,6 +39,9 @@ const mutation: MutationTree<AuthenticationState> = {
...
@@ -33,6 +39,9 @@ const mutation: MutationTree<AuthenticationState> = {
setMenuList
(
state
,
payload
:
MenuItem
[])
{
setMenuList
(
state
,
payload
:
MenuItem
[])
{
state
.
menuList
=
payload
;
state
.
menuList
=
payload
;
},
},
setUserList
(
state
,
payload
:
UserInfo
[])
{
state
.
userList
=
payload
;
},
};
};
export
default
mutation
;
export
default
mutation
;
src/store/authentication/state.ts
View file @
29898b8f
...
@@ -43,6 +43,26 @@ export type MenuItem = {
...
@@ -43,6 +43,26 @@ export type MenuItem = {
menuIndex
:
number
;
menuIndex
:
number
;
children
?:
MenuItem
[];
children
?:
MenuItem
[];
};
};
export
type
UserInfo
=
{
address
:
string
|
null
;
birthday
:
number
|
null
;
createBy
:
string
|
null
;
createTime
:
number
|
null
;
email
:
string
|
null
;
fullName
:
string
|
null
;
id
:
number
;
isAdmin
:
boolean
|
null
;
mobileNumber
:
number
|
null
;
password
:
string
;
phoneNumber
:
number
|
null
;
sex
:
number
;
status
:
number
;
unit
:
string
|
null
;
updateBy
:
string
|
null
;
updateTime
:
number
|
null
;
userName
:
string
;
};
export
interface
AuthenticationState
{
export
interface
AuthenticationState
{
token
?:
string
;
token
?:
string
;
user
?:
{
user
?:
{
...
@@ -57,6 +77,7 @@ export interface AuthenticationState {
...
@@ -57,6 +77,7 @@ export interface AuthenticationState {
}[];
}[];
pageList
:
Page
[];
pageList
:
Page
[];
menuList
:
MenuItem
[];
menuList
:
MenuItem
[];
userList
:
UserInfo
[];
}
}
function
state
():
AuthenticationState
{
function
state
():
AuthenticationState
{
...
@@ -65,6 +86,7 @@ function state(): AuthenticationState {
...
@@ -65,6 +86,7 @@ function state(): AuthenticationState {
pageList
:
[],
pageList
:
[],
pageRoles
:
[],
pageRoles
:
[],
menuList
:
[],
menuList
:
[],
userList
:
[],
};
};
}
}
...
...
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