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
d1eb154e
Commit
d1eb154e
authored
Apr 22, 2021
by
Nguyễn Văn Trường
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
29898b8f
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
164 additions
and
21530 deletions
+164
-21530
package-lock.json
package-lock.json
+36
-21502
quasar.conf.js
quasar.conf.js
+1
-1
configurations.example.ts
src/assets/configurations.example.ts
+1
-0
enums.ts
src/assets/enums.ts
+5
-0
GroupInfo.ts
src/components/group-info/GroupInfo.ts
+14
-0
index.vue
src/components/group-info/index.vue
+23
-7
UserGroup.ts
src/components/user-group/UserGroup.ts
+14
-4
index.vue
src/components/user-group/index.vue
+17
-7
index.ts
src/i18n/vi/index.ts
+1
-0
UserGroup.ts
src/pages/nhom-nguoi-dung/UserGroup.ts
+40
-6
index.vue
src/pages/nhom-nguoi-dung/index.vue
+11
-2
actions.ts
src/store/authentication/actions.ts
+1
-1
No files found.
package-lock.json
View file @
d1eb154e
This diff is collapsed.
Click to expand it.
quasar.conf.js
View file @
d1eb154e
...
@@ -81,7 +81,7 @@ module.exports = configure(function (ctx) {
...
@@ -81,7 +81,7 @@ module.exports = configure(function (ctx) {
devServer
:
{
devServer
:
{
https
:
false
,
https
:
false
,
port
:
10706
,
port
:
10706
,
open
:
tru
e
,
// opens browser window automatically
open
:
fals
e
,
// opens browser window automatically
},
},
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
...
...
src/assets/configurations.example.ts
View file @
d1eb154e
...
@@ -22,4 +22,5 @@ export enum API_PATHS {
...
@@ -22,4 +22,5 @@ export enum API_PATHS {
getUserGroups
=
'/group/get_list'
,
getUserGroups
=
'/group/get_list'
,
getGroupInfo
=
'/group/get_info'
,
getGroupInfo
=
'/group/get_info'
,
getListPages
=
'/user/page/list'
,
getListPages
=
'/user/page/list'
,
getListGroupUsers
=
'/user/group/list'
,
}
}
src/assets/enums.ts
0 → 100644
View file @
d1eb154e
export
enum
EditMode
{
edit
=
1
,
none
=
0
,
add
=
2
,
}
src/components/group-info/GroupInfo.ts
View file @
d1eb154e
...
@@ -6,6 +6,20 @@ const check2 = ref(false);
...
@@ -6,6 +6,20 @@ const check2 = ref(false);
const
check3
=
ref
(
false
);
const
check3
=
ref
(
false
);
export
const
GroupInfoScript
=
defineComponent
({
export
const
GroupInfoScript
=
defineComponent
({
props
:
{
isDisable
:
{
type
:
Number
,
required
:
true
,
},
groupName
:
{
type
:
String
,
requite
:
true
,
},
groupDescription
:
{
type
:
String
,
requite
:
true
,
},
},
setup
()
{
setup
()
{
return
{
check
,
check1
,
check2
,
check3
};
return
{
check
,
check1
,
check2
,
check3
};
},
},
...
...
src/components/group-info/index.vue
View file @
d1eb154e
...
@@ -3,30 +3,46 @@
...
@@ -3,30 +3,46 @@
<q-card-section
style=
"padding-top: 28px"
>
<q-card-section
style=
"padding-top: 28px"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-4"
style=
"display: flex"
>
<div
class=
"col-4"
style=
"display: flex"
>
<div
class=
"text-h
5
"
>
Thông tin nhóm
</div>
<div
class=
"text-h
6
"
>
Thông tin nhóm
</div>
</div>
</div>
<div
class=
"col-8"
style=
"display: flex; justify-content: flex-end"
>
<div
class=
"col-8"
style=
"display: flex; justify-content: flex-end"
>
<q-btn
<q-btn
v-if=
"isDisable === 2"
style=
"margin-right: 8px"
style=
"margin-right: 8px"
color=
"red"
color=
"red"
icon=
"delete"
icon=
"delete"
label=
"Xoá"
label=
"Xoá"
/>
/>
<q-btn
color=
"primary"
icon=
"update"
label=
"Cập nhật"
/>
<q-btn
v-if=
"isDisable !== 0"
color=
"primary"
icon=
"update"
label=
"Cập nhật"
/>
</div>
</div>
<div
style=
"position: absolute; top: 0; right: 0"
>
<div
<q-icon
size=
"x-large"
name=
"close"
color=
"primary"
/>
v-if=
"isDisable !== 0"
style=
"position: absolute; top: 0; right: 0"
>
<q-btn
size=
"x-small"
flat
round
color=
"primary"
icon=
"close"
/>
</div>
</div>
</div>
</div>
</q-card-section>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-card-section
class=
"q-pt-none"
>
<q-input
outlined
placeholder=
"Tên nhóm *"
disable
/>
<q-input
v-if=
"!isDisable"
disable
outlined
placeholder=
"Tên nhóm *"
/>
<q-input
v-else
v-model=
"groupName"
outlined
placeholder=
"Tên nhóm *"
/>
</q-card-section>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-card-section
class=
"q-pt-none"
>
<q-input
outlined
placeholder=
"Mô tả *"
disable
/>
<q-input
v-if=
"!isDisable"
disable
outlined
placeholder=
"Mô tả *"
/>
<q-input
v-else
v-model=
"groupDescription"
outlined
placeholder=
"Mô tả *"
/>
</q-card-section>
</q-card-section>
<q-card-section>
<q-card-section
v-if=
"isDisable === 2"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
<q-list
bordered
padding
>
<q-list
bordered
padding
>
...
...
src/components/user-group/UserGroup.ts
View file @
d1eb154e
import
{
UserInfo
}
from
'src/store/authentication/state
'
;
import
{
GroupInfoType
}
from
'src/pages/nhom-nguoi-dung/UserGroup
'
;
import
{
defineComponent
,
PropType
}
from
'vue'
;
import
{
computed
,
defineComponent
,
PropType
,
ref
}
from
'vue'
;
// import { useStore } from 'src/store';
// import { useStore } from 'src/store';
export
const
UserGroupScript
=
defineComponent
({
export
const
UserGroupScript
=
defineComponent
({
props
:
{
props
:
{
listUsers
:
{
listUsers
:
{
type
:
Array
as
PropType
<
UserInfo
[]
>
,
type
:
Array
as
PropType
<
GroupInfoType
[]
>
,
required
:
true
,
required
:
true
,
},
},
},
},
setup
()
{
emits
:
[
'click:groupName'
,
'update:addNewGroupUsers'
],
setup
(
props
)
{
// const $store = useStore();
// const $store = useStore();
const
keyword
=
ref
(
''
);
const
filteredListUsers
=
computed
(()
=>
{
return
props
.
listUsers
.
filter
((
group
)
=>
group
.
groupName
.
includes
(
keyword
.
value
)
);
});
return
{
keyword
,
filteredListUsers
};
},
},
});
});
src/components/user-group/index.vue
View file @
d1eb154e
<
template
>
<
template
>
<q-card
flat
bordered
class=
"my-card"
>
<q-card
flat
bordered
class=
"my-card"
>
<q-card-section
style=
"padding-top: 28px"
>
<q-card-section
style=
"padding-top: 28px"
>
<div
class=
"row
justify-start
"
>
<div
class=
"row"
>
<div
class=
"col-
9 text-h5
"
style=
"display: flex"
>
<div
class=
"col-
8 text-h6
"
style=
"display: flex"
>
<div>
Nhóm người dùng
</div>
<div>
Nhóm người dùng
</div>
</div>
</div>
<div
class=
"col-3"
>
<div
class=
"col-4"
style=
"display: flex; justify-content: flex-end"
>
<q-btn
color=
"primary"
label=
"THÊM MỚI"
/>
<q-btn
@
click=
"$emit('click:addNewGroupUsers', 1)"
color=
"primary"
label=
"Thêm mới"
no-caps
/>
</div>
</div>
</div>
</div>
</q-card-section>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-card-section
class=
"q-pt-none"
>
<q-input
outlined
placeholder=
"Tìm kiếm"
/>
<q-input
v-model=
"keyword"
outlined
placeholder=
"Tìm kiếm"
/>
</q-card-section>
</q-card-section>
<q-card-section
class=
"q-pt-none"
>
<q-card-section
class=
"q-pt-none"
>
<q-btn
<q-btn
v-for=
"(userItem, userItemIdx) in
l
istUsers"
v-for=
"(userItem, userItemIdx) in
filteredL
istUsers"
:key=
"`userItem-$
{userItemIdx}`"
:key=
"`userItem-$
{userItemIdx}`"
align="left"
align="left"
outline
outline
size="large"
size="large"
class="full-width my-1"
class="full-width my-1"
color="primary"
color="primary"
label="Admin
"
:label="userItem.groupName
"
no-caps
no-caps
@click="$emit('click:groupName', userItem)"
/>
/>
<div
v-if=
"!filteredListUsers.length"
>
{{
$t
(
'emptyData'
)
}}
</div>
</q-card-section>
</q-card-section>
</q-card>
</q-card>
</
template
>
</
template
>
...
...
src/i18n/vi/index.ts
View file @
d1eb154e
...
@@ -21,4 +21,5 @@ export default {
...
@@ -21,4 +21,5 @@ export default {
responseErrorMsg
:
{
responseErrorMsg
:
{
'msg-1'
:
'Lỗi không xác định'
,
'msg-1'
:
'Lỗi không xác định'
,
},
},
emptyData
:
'Không tìm thấy dữ liệu'
,
};
};
src/pages/nhom-nguoi-dung/UserGroup.ts
View file @
d1eb154e
import
{
defineComponent
,
onMounted
,
ref
}
from
'vue'
;
import
{
defineComponent
,
onMounted
,
Ref
,
ref
}
from
'vue'
;
import
{
useStore
}
from
'src/store'
;
import
{
useStore
}
from
'src/store'
;
import
UserGroupComponent
from
'../../components/user-group/index.vue'
;
import
UserGroupComponent
from
'../../components/user-group/index.vue'
;
import
GroupInfoComponent
from
'../../components/group-info/index.vue'
;
import
GroupInfoComponent
from
'../../components/group-info/index.vue'
;
import
{
UserInfo
}
from
'src/store/authentication/state'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
group
}
from
'console'
;
const
userList
=
ref
([
1
]);
export
type
GroupInfoType
=
{
createBy
:
null
|
string
;
createTime
:
null
|
string
;
description
:
string
;
groupName
:
string
;
id
:
number
;
status
:
number
;
updateBy
:
null
|
string
;
updateTime
:
null
|
string
;
};
const
userList
:
Ref
<
GroupInfoType
[]
>
=
ref
([]);
const
isDisable
=
ref
(
0
);
const
groupName
=
ref
(
''
);
const
groupDescription
=
ref
(
''
);
export
const
UserGroup
=
defineComponent
({
export
const
UserGroup
=
defineComponent
({
components
:
{
UserGroupComponent
,
GroupInfoComponent
},
components
:
{
UserGroupComponent
,
GroupInfoComponent
},
setup
()
{
setup
()
{
const
$store
=
useStore
();
const
$store
=
useStore
();
const
getGroupInfo
=
(
groupInfo
:
GroupInfoType
)
=>
{
console
.
log
(
groupInfo
);
isDisable
.
value
=
2
;
groupName
.
value
=
groupInfo
.
groupName
;
groupDescription
.
value
=
groupInfo
.
description
;
};
const
changeValueIsDisable
=
(
value
:
number
)
=>
{
isDisable
.
value
=
value
;
};
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
await
$store
.
dispatch
(
'authentication/getListUsers'
).
then
((
response
)
=>
{
await
$store
.
dispatch
(
'authentication/getListUsers'
).
then
((
response
)
=>
{
const
res
=
response
as
AxiosResponse
<
const
res
=
response
as
AxiosResponse
<
BaseResponseBody
<
{
data
:
UserInfo
[]
}
>
BaseResponseBody
<
GroupInfoType
[]
>
>
;
>
;
if
(
!
res
.
data
.
error
.
code
)
{
if
(
!
res
.
data
.
error
.
code
)
{
// userList = res.data
.data.data;
userList
.
value
=
res
.
data
.
data
;
}
}
});
});
});
});
return
{
userList
};
return
{
userList
,
getGroupInfo
,
isDisable
,
changeValueIsDisable
,
groupName
,
groupDescription
,
};
},
},
});
});
src/pages/nhom-nguoi-dung/index.vue
View file @
d1eb154e
...
@@ -2,10 +2,19 @@
...
@@ -2,10 +2,19 @@
<q-page
padding
>
<q-page
padding
>
<div
class=
"row q-col-gutter-sm"
align=
"center"
justify=
"center"
>
<div
class=
"row q-col-gutter-sm"
align=
"center"
justify=
"center"
>
<div
class=
"col-4"
>
<div
class=
"col-4"
>
<UserGroupComponent
:list-users=
"userList"
></UserGroupComponent>
<UserGroupComponent
:list-users=
"userList"
:is-disable=
"isDisable"
@
click:groupName=
"getGroupInfo"
@
click:addNewGroupUsers=
"changeValueIsDisable"
></UserGroupComponent>
</div>
</div>
<div
class=
"col-8"
>
<div
class=
"col-8"
>
<GroupInfoComponent></GroupInfoComponent>
<GroupInfoComponent
:is-disable=
"isDisable"
:group-name=
"groupName"
:group-description=
"groupDescription"
></GroupInfoComponent>
</div>
</div>
</div>
</div>
</q-page>
</q-page>
...
...
src/store/authentication/actions.ts
View file @
d1eb154e
...
@@ -98,7 +98,7 @@ const actions: ActionTree<AuthenticationState, StateInterface> = {
...
@@ -98,7 +98,7 @@ const actions: ActionTree<AuthenticationState, StateInterface> = {
async
getListUsers
()
{
async
getListUsers
()
{
try
{
try
{
const
response
=
(
await
api
({
const
response
=
(
await
api
({
url
:
API_PATHS
.
getListUsers
,
url
:
API_PATHS
.
getList
Group
Users
,
method
:
'GET'
,
method
:
'GET'
,
params
:
{},
params
:
{},
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
...
...
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