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
ea171371
Commit
ea171371
authored
May 13, 2021
by
Tình Trương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0c577f62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
30 deletions
+33
-30
configurations.example.ts
src/assets/configurations.example.ts
+1
-0
index.vue
src/pages/bai-viet/index.vue
+32
-30
No files found.
src/assets/configurations.example.ts
View file @
ea171371
...
@@ -71,4 +71,5 @@ export enum API_PATHS {
...
@@ -71,4 +71,5 @@ export enum API_PATHS {
detailCustomer
=
'customer/detail'
,
detailCustomer
=
'customer/detail'
,
updateCustomer
=
'customer/update'
,
updateCustomer
=
'customer/update'
,
getPostCategory
=
'postCategory'
,
getPostCategory
=
'postCategory'
,
addPost
=
'post/add'
,
}
}
src/pages/bai-viet/index.vue
View file @
ea171371
...
@@ -45,13 +45,13 @@
...
@@ -45,13 +45,13 @@
hide-pagination
hide-pagination
class=
"sticky-header-table"
class=
"sticky-header-table"
>
>
<template
v-slot:body-cell-STT=
"item"
>
<
!--
<
template
v-slot:body-cell-STT=
"item"
>
<q-td
style=
"padding: 0; height: 100%"
>
<q-td
style=
"padding: 0; height: 100%"
>
<div
align=
"center"
>
<div
align=
"center"
>
{{
item
.
rowIndex
+
1
}}
{{
item
.
rowIndex
+
1
}}
</div>
</div>
</q-td>
</q-td>
</
template
>
</
template
>
-->
<
template
v-slot:body-cell-action=
"item"
>
<
template
v-slot:body-cell-action=
"item"
>
<q-td
style=
"padding: 0"
>
<q-td
style=
"padding: 0"
>
<div
align=
"center"
>
<div
align=
"center"
>
...
@@ -162,9 +162,10 @@ import { AxiosResponse } from 'axios';
...
@@ -162,9 +162,10 @@ import { AxiosResponse } from 'axios';
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
import
{
PaginationResponse
,
PaginationResponse
,
Post
,
Post
Type
,
FileUploadType
,
FileUploadType
,
CategoryPostType
,
CategoryPostType
,
PostDetailType
,
}
from
'src/assets/type'
;
}
from
'src/assets/type'
;
import
{
config
}
from
'src/assets/configurations'
;
import
{
config
}
from
'src/assets/configurations'
;
import
{
PostStatus
}
from
'src/assets/enums'
;
import
{
PostStatus
}
from
'src/assets/enums'
;
...
@@ -182,14 +183,14 @@ export default defineComponent({
...
@@ -182,14 +183,14 @@ export default defineComponent({
},
},
setup
()
{
setup
()
{
const
postTableColumns
=
[
const
postTableColumns
=
[
{
//
{
name
:
'STT'
,
//
name: 'STT',
field
:
'STT'
,
//
field: 'STT',
required
:
true
,
//
required: true,
label
:
'STT'
,
//
label: 'STT',
align
:
'center'
,
//
align: 'center',
sortable
:
false
,
//
sortable: false,
},
//
},
{
{
name
:
'name'
,
name
:
'name'
,
field
:
'name'
,
field
:
'name'
,
...
@@ -309,7 +310,7 @@ export default defineComponent({
...
@@ -309,7 +310,7 @@ export default defineComponent({
pageSize
:
pageSize
.
value
,
pageSize
:
pageSize
.
value
,
name
:
namePost
.
value
,
name
:
namePost
.
value
,
},
},
}))
as
AxiosResponse
<
BaseResponseBody
<
PaginationResponse
<
Post
>>>
;
}))
as
AxiosResponse
<
BaseResponseBody
<
PaginationResponse
<
Post
Type
>>>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
postTableRows
.
value
=
response
.
data
.
data
.
data
;
postTableRows
.
value
=
response
.
data
.
data
.
data
;
totalPage
.
value
=
response
.
data
.
data
.
totalPages
;
totalPage
.
value
=
response
.
data
.
data
.
totalPages
;
...
@@ -362,24 +363,25 @@ export default defineComponent({
...
@@ -362,24 +363,25 @@ export default defineComponent({
//gọi api add
//gọi api add
const
addNewPost
=
async
()
=>
{
const
addNewPost
=
async
()
=>
{
// const data = {
const
data
=
{
// name: name.value,
image
:
image
.
value
,
// status: status.value,
status
:
status
.
value
,
// };
category
:
category
.
value
,
// const response = (await api({
};
// url: API_PATHS.addPost,
const
response
=
(
await
api
({
// method: 'POST',
url
:
API_PATHS
.
addPost
,
// data,
method
:
'POST'
,
// })) as AxiosResponse
<
BaseResponseBody
<
[]
>>
;
data
,
// if (response.data.error.code === config.API_RES_CODE.OK.code) {
}))
as
AxiosResponse
<
BaseResponseBody
<
PostDetailType
[]
>>
;
// addPostDialogIsOpened.value = false;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
// Notify.create({
addPostDialogIsOpened
.
value
=
false
;
// type: 'positive',
Notify
.
create
({
// message: i18n.global.t('post.actionMessages.addNewPostAccess'),
type
:
'positive'
,
// actions: [{ icon: 'close', color: 'white' }],
message
:
i18n
.
global
.
t
(
'post.actionMessages.addNewPostAccess'
),
// });
actions
:
[{
icon
:
'close'
,
color
:
'white'
}],
// void getListPost();
});
// }
void
getListPost
();
}
};
};
const
openUpdatePostDialog
=
(
id
:
number
)
=>
{
const
openUpdatePostDialog
=
(
id
:
number
)
=>
{
...
...
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