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
641b5de3
Commit
641b5de3
authored
Jul 08, 2021
by
Tình Trương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
18f31f91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
3 deletions
+50
-3
updateInformationArtist.ts
...ges/cap-nhat-thong-tin-nghe-sy/updateInformationArtist.ts
+34
-1
AddArtist.ts
src/pages/them-nghe-sy/AddArtist.ts
+16
-2
No files found.
src/pages/cap-nhat-thong-tin-nghe-sy/updateInformationArtist.ts
View file @
641b5de3
...
@@ -308,6 +308,15 @@ export default defineComponent({
...
@@ -308,6 +308,15 @@ export default defineComponent({
}
}
);
);
watch
(
()
=>
formatSchedules
.
value
,
(
value
)
=>
{
if
(
value
)
{
console
.
log
(
value
,
'aaa'
);
}
}
);
const
getInformationArtist
=
async
()
=>
{
const
getInformationArtist
=
async
()
=>
{
const
response
=
(
await
api
({
const
response
=
(
await
api
({
url
:
API_PATHS
.
getDetailArtist
,
url
:
API_PATHS
.
getDetailArtist
,
...
@@ -767,6 +776,30 @@ export default defineComponent({
...
@@ -767,6 +776,30 @@ export default defineComponent({
}
}
}
}
// cách 1: dùng reduce
const
schedules
:
Array
<
{
scheduleTime
:
string
}
>
=
formatSchedules
.
value
.
reduce
(
(
acc
:
Array
<
{
scheduleTime
:
string
}
>
,
item
)
=>
{
acc
.
push
({
scheduleTime
:
moment
(
item
,
'YYYY/MM/DD'
).
format
(
'DD/MM/YYYY HH:mm:ss'
),
});
return
acc
;
},
[]
);
// cach 2: dùng for
// const schedules: Array<{ scheduleTime: string }> = [];
// for (let idx = 0; idx < formatSchedules.value.length; idx++) {
// schedules.push({
// scheduleTime: moment(
// formatSchedules.value[idx],
// 'YYYY/MM/DD'
// ).format('DD/MM/YYYY HH:mm:ss'),
// });
// }
const
response
=
(
await
api
({
const
response
=
(
await
api
({
url
:
API_PATHS
.
updateArtist
,
url
:
API_PATHS
.
updateArtist
,
method
:
'POST'
,
method
:
'POST'
,
...
@@ -798,7 +831,7 @@ export default defineComponent({
...
@@ -798,7 +831,7 @@ export default defineComponent({
works
:
works
.
value
,
works
:
works
.
value
,
banners
:
banners
.
value
,
banners
:
banners
.
value
,
bankAccounts
:
bankAccounts
.
value
,
bankAccounts
:
bankAccounts
.
value
,
schedules
:
schedules
.
value
,
schedules
,
stories
:
stories
.
value
,
stories
:
stories
.
value
,
products
:
products
.
value
,
products
:
products
.
value
,
},
},
...
...
src/pages/them-nghe-sy/AddArtist.ts
View file @
641b5de3
...
@@ -3,7 +3,7 @@ import { api, BaseResponseBody } from 'src/boot/axios';
...
@@ -3,7 +3,7 @@ import { api, BaseResponseBody } from 'src/boot/axios';
import
{
API_PATHS
,
config
}
from
'src/assets/configurations'
;
import
{
API_PATHS
,
config
}
from
'src/assets/configurations'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
AxiosResponse
}
from
'axios'
;
import
moment
from
'moment'
;
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
Dialog
,
Notify
}
from
'quasar'
;
import
{
Dialog
,
Notify
}
from
'quasar'
;
import
{
Router
}
from
'src/router'
;
import
{
Router
}
from
'src/router'
;
...
@@ -701,6 +701,20 @@ export default defineComponent({
...
@@ -701,6 +701,20 @@ export default defineComponent({
}
}
}
}
// cách 1: dùng reduce
const
schedules
:
Array
<
{
scheduleTime
:
string
}
>
=
formatSchedules
.
value
.
reduce
(
(
acc
:
Array
<
{
scheduleTime
:
string
}
>
,
item
)
=>
{
acc
.
push
({
scheduleTime
:
moment
(
item
,
'YYYY/MM/DD'
).
format
(
'DD/MM/YYYY HH:mm:ss'
),
});
return
acc
;
},
[]
);
const
response
=
(
await
api
({
const
response
=
(
await
api
({
url
:
API_PATHS
.
addArtist
,
url
:
API_PATHS
.
addArtist
,
method
:
'POST'
,
method
:
'POST'
,
...
@@ -733,7 +747,7 @@ export default defineComponent({
...
@@ -733,7 +747,7 @@ export default defineComponent({
works
:
works
.
value
,
works
:
works
.
value
,
banners
:
banners
.
value
,
banners
:
banners
.
value
,
bankAccounts
:
bankAccounts
.
value
,
bankAccounts
:
bankAccounts
.
value
,
schedules
:
schedules
.
value
,
schedules
,
stories
:
stories
.
value
,
stories
:
stories
.
value
,
products
:
products
.
value
,
products
:
products
.
value
,
},
},
...
...
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