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
4541a3e7
Commit
4541a3e7
authored
Apr 23, 2021
by
Võ Quang Thành Đạt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add newGroupUSer
parent
94394d0e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
12 deletions
+33
-12
index.vue
src/components/group-info/index.vue
+1
-1
UserGroup.ts
src/pages/nhom-nguoi-dung/UserGroup.ts
+22
-2
actions.ts
src/store/authentication/actions.ts
+10
-9
No files found.
src/components/group-info/index.vue
View file @
4541a3e7
<
template
>
<q-card
flat
bordered
class=
"my-card"
>
<q-form
@
submit
.
prevent=
"$emit('saveGroupInfo')"
>
<q-form
@
submit
.
prevent=
"$emit('saveGroupInfo'
, isDisable
)"
>
<q-card-section
style=
"padding-top: 28px"
>
<div
class=
"row"
>
<div
class=
"col-4"
style=
"display: flex"
>
...
...
src/pages/nhom-nguoi-dung/UserGroup.ts
View file @
4541a3e7
...
...
@@ -3,8 +3,9 @@ import { useStore } from 'src/store';
import
UserGroupComponent
from
'../../components/user-group/index.vue'
;
import
GroupInfoComponent
from
'../../components/group-info/index.vue'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
EditMode
}
from
'src/assets/enums'
;
import
{
API_PATHS
}
from
'src/assets/configurations'
;
export
type
GroupInfoType
=
{
createBy
:
null
|
string
;
...
...
@@ -23,8 +24,26 @@ const groupName = ref('');
const
groupDescription
=
ref
(
''
);
const
selectedGroupId
=
ref
(
-
1
);
const
saveGroupInfo
=
()
=>
{
const
saveGroupInfo
=
async
()
=>
{
//...
if
(
isDisable
.
value
===
EditMode
.
add
)
{
try
{
const
response
=
(
await
api
({
url
:
API_PATHS
.
addNewGroupUser
,
method
:
'POST'
,
data
:
{
group
:
{
groupName
:
groupName
.
value
,
description
:
groupDescription
.
value
,
},
},
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
return
response
;
}
catch
(
error
)
{}
}
else
{
console
.
log
(
'editGroupInfo'
);
}
};
export
default
defineComponent
({
...
...
@@ -43,6 +62,7 @@ export default defineComponent({
groupDescription
.
value
=
''
;
selectedGroupId
.
value
=
-
1
;
};
onMounted
(
async
()
=>
{
await
$store
.
dispatch
(
'authentication/getListUsers'
).
then
((
response
)
=>
{
const
res
=
response
as
AxiosResponse
<
...
...
src/store/authentication/actions.ts
View file @
4541a3e7
...
...
@@ -102,15 +102,16 @@ const actions: ActionTree<AuthenticationState, StateInterface> = {
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
)
{}
},
async
addNewGroupUser
(
payload
)
{
try
{
const
response
=
(
await
api
({
url
:
API_PATHS
.
addNewGroupUser
,
method
:
'POST'
,
data
:
payload
,
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
return
response
;
}
catch
(
error
)
{}
},
...
...
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