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
e9783f94
Commit
e9783f94
authored
May 08, 2021
by
Võ Quang Thành Đạt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
33b9a73e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
158 additions
and
116 deletions
+158
-116
configurations.example.ts
src/assets/configurations.example.ts
+1
-0
index.vue
src/components/artist-information/VAB-account/index.vue
+20
-2
PersonalInformation.ts
...t-information/personal-information/PersonalInformation.ts
+9
-6
index.vue
...ponents/artist-information/personal-information/index.vue
+1
-1
index.ts
src/i18n/vi/index.ts
+1
-0
AddArtist.ts
src/pages/them-nghe-sy/AddArtist.ts
+119
-100
index.vue
src/pages/them-nghe-sy/index.vue
+7
-7
No files found.
src/assets/configurations.example.ts
View file @
e9783f94
...
@@ -50,4 +50,5 @@ export enum API_PATHS {
...
@@ -50,4 +50,5 @@ export enum API_PATHS {
uploadImage
=
'file/upload'
,
uploadImage
=
'file/upload'
,
getDetailUnit
=
'artistOwner/detail'
,
getDetailUnit
=
'artistOwner/detail'
,
updateUnit
=
'artistOwner/update'
,
updateUnit
=
'artistOwner/update'
,
addArtist
=
'artist/add'
,
}
}
src/components/artist-information/VAB-account/index.vue
View file @
e9783f94
...
@@ -139,10 +139,28 @@
...
@@ -139,10 +139,28 @@
<div
class=
"col-4"
>
<div
class=
"col-4"
>
<div
class=
"text-h6 text-weight-regular"
>
Story
</div>
<div
class=
"text-h6 text-weight-regular"
>
Story
</div>
<q-carousel
v-model=
"slideStory"
animated
arrows
navigation
infinite
>
<q-card
class=
"my-card flex q-mt-xs flex-center"
style=
"height: 300px"
bordered
v-if=
"!stories.length"
>
<div
align=
"center"
class=
"flex flex-center q-py-xs"
>
<q-icon
name=
"mdi-plus-circle-outline"
size=
"xl"
></q-icon>
<div
class=
"q-mt-xs"
>
{{ $t('uploadImage.uploadStory') }}
</div>
</div>
</q-card>
<q-carousel
v-else
v-model=
"slideStory"
animated
arrows
navigation
infinite
>
<q-carousel-slide
<q-carousel-slide
v-for=
"(story, storyIdx) in stories"
v-for=
"(story, storyIdx) in stories"
:key=
"stor
ies.length
"
:key=
"stor
yIdx
"
:name=
"storyIdx"
:name=
"storyIdx"
class=
"q-pt-sm"
class=
"q-pt-sm"
>
>
...
...
src/components/artist-information/personal-information/PersonalInformation.ts
View file @
e9783f94
...
@@ -39,7 +39,10 @@ export default defineComponent({
...
@@ -39,7 +39,10 @@ export default defineComponent({
const
selectedFile
=
(
value
:
FileList
)
=>
{
const
selectedFile
=
(
value
:
FileList
)
=>
{
// console.log(value);
// console.log(value);
// console.log(URL.createObjectURL(value[0]));
// console.log(URL.createObjectURL(value[0]));
context
.
emit
(
'SetAvatar'
,{
file
:
value
[
0
],
url
:
URL
.
createObjectURL
(
value
[
0
])})
context
.
emit
(
'SetAvatar'
,
{
file
:
value
[
0
],
url
:
URL
.
createObjectURL
(
value
[
0
]),
});
};
};
const
upload
=
ref
(
null
);
const
upload
=
ref
(
null
);
const
uploadBanner
=
()
=>
{
const
uploadBanner
=
()
=>
{
...
@@ -137,10 +140,10 @@ export default defineComponent({
...
@@ -137,10 +140,10 @@ export default defineComponent({
'artist.artistInformation.validateMessages.requireArtistLevel'
'artist.artistInformation.validateMessages.requireArtistLevel'
),
),
];
];
const
deleteAvatar
=
()
=>
{
const
deleteAvatar
=
()
=>
{
console
.
log
(
'object'
);
console
.
log
(
'object'
);
context
.
emit
(
'deleteAvatar'
)
context
.
emit
(
'deleteAvatar'
)
;
}
}
;
return
{
return
{
artistCodeRules
,
artistCodeRules
,
fullNameRules
,
fullNameRules
,
...
@@ -158,7 +161,7 @@ export default defineComponent({
...
@@ -158,7 +161,7 @@ export default defineComponent({
upload
,
upload
,
uploadBanner
,
uploadBanner
,
selectedFile
,
selectedFile
,
deleteAvatar
deleteAvatar
,
};
};
},
},
emits
:
[
emits
:
[
...
@@ -183,6 +186,6 @@ export default defineComponent({
...
@@ -183,6 +186,6 @@ export default defineComponent({
'update:status'
,
'update:status'
,
'addNewArtist'
,
'addNewArtist'
,
'SetAvatar'
,
'SetAvatar'
,
'deleteAvatar'
'deleteAvatar'
,
],
],
});
});
src/components/artist-information/personal-information/index.vue
View file @
e9783f94
...
@@ -246,8 +246,8 @@
...
@@ -246,8 +246,8 @@
<div
class=
"col-8"
>
<div
class=
"col-8"
>
<q-select
<q-select
:model-value=
"artistLevel"
:model-value=
"artistLevel"
@
update:model-value=
"$emit('update:artistLevel', $event)"
:rules=
"artistLevelRules"
:rules=
"artistLevelRules"
@
update:model-value=
"$emit('update:artistLevel')"
:options=
"artistLevelOptions"
:options=
"artistLevelOptions"
emit-value
emit-value
map-options
map-options
...
...
src/i18n/vi/index.ts
View file @
e9783f94
...
@@ -468,6 +468,7 @@ export default {
...
@@ -468,6 +468,7 @@ export default {
uploadImage
:
{
uploadImage
:
{
uploadBanner
:
'Tải lên'
,
uploadBanner
:
'Tải lên'
,
uploadEmbed
:
'Tải lên Embed'
,
uploadEmbed
:
'Tải lên Embed'
,
uploadStory
:
'Tải lên Story'
,
titleEmbedDialog
:
'Thay đổi Embed'
,
titleEmbedDialog
:
'Thay đổi Embed'
,
},
},
};
};
src/pages/them-nghe-sy/AddArtist.ts
View file @
e9783f94
...
@@ -35,6 +35,13 @@ import {
...
@@ -35,6 +35,13 @@ import {
TypeCardType
,
TypeCardType
,
}
from
'src/assets/type'
;
}
from
'src/assets/type'
;
export
type
AvatarType
=
{
file
?:
File
;
url
?:
string
|
null
;
};
// export type Story = {
// story?:object |
// };
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
components
:
{
PersonalInformation
,
PersonalInformation
,
...
@@ -47,9 +54,10 @@ export default defineComponent({
...
@@ -47,9 +54,10 @@ export default defineComponent({
UpdateHotProduct
,
UpdateHotProduct
,
UploadEmbedDialog
,
UploadEmbedDialog
,
},
},
setup
()
{
setup
(
_
,
context
)
{
const
route
=
useRoute
();
const
route
=
useRoute
();
const
tab
:
Ref
<
string
>
=
ref
(
'information'
);
const
tab
=
ref
(
'information'
);
// state open dialog
// state open dialog
const
isOpenAddAccountBankDialog
:
Ref
<
boolean
>
=
ref
(
false
);
const
isOpenAddAccountBankDialog
:
Ref
<
boolean
>
=
ref
(
false
);
...
@@ -75,6 +83,7 @@ export default defineComponent({
...
@@ -75,6 +83,7 @@ export default defineComponent({
const
id
:
Ref
<
number
>
=
ref
(
0
);
const
id
:
Ref
<
number
>
=
ref
(
0
);
const
account
:
Ref
<
string
>
=
ref
(
''
);
const
account
:
Ref
<
string
>
=
ref
(
''
);
const
avatar
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
avatar
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
avatarFile
:
Ref
<
File
|
null
>
=
ref
(
null
);
const
artistCode
:
Ref
<
string
>
=
ref
(
''
);
const
artistCode
:
Ref
<
string
>
=
ref
(
''
);
const
fullName
:
Ref
<
string
>
=
ref
(
''
);
const
fullName
:
Ref
<
string
>
=
ref
(
''
);
const
artistName
:
Ref
<
string
|
null
|
undefined
>
=
ref
();
const
artistName
:
Ref
<
string
|
null
|
undefined
>
=
ref
();
...
@@ -97,7 +106,7 @@ export default defineComponent({
...
@@ -97,7 +106,7 @@ export default defineComponent({
// state sử dụng trong tab vab account
// state sử dụng trong tab vab account
const
banners
:
Ref
<
BannerType
[]
>
=
ref
([]);
const
banners
:
Ref
<
BannerType
[]
>
=
ref
([]);
const
shortDescription
:
Ref
<
string
|
null
>
=
ref
(
''
);
const
shortDescription
:
Ref
<
string
|
null
>
=
ref
(
''
);
const
socialEmbedded
:
Ref
<
string
|
null
>
=
ref
(
''
);
const
socialEmbedded
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
stories
:
Ref
<
StoriesType
[]
>
=
ref
([]);
const
stories
:
Ref
<
StoriesType
[]
>
=
ref
([]);
const
schedules
:
Ref
<
SchedulesType
[]
>
=
ref
([]);
const
schedules
:
Ref
<
SchedulesType
[]
>
=
ref
([]);
const
formatSchedules
:
Ref
<
string
[]
>
=
ref
([]);
const
formatSchedules
:
Ref
<
string
[]
>
=
ref
([]);
...
@@ -113,57 +122,6 @@ export default defineComponent({
...
@@ -113,57 +122,6 @@ export default defineComponent({
const
DataInsertHotProduct
:
Ref
<
ProductType
|
null
>
=
ref
(
null
);
const
DataInsertHotProduct
:
Ref
<
ProductType
|
null
>
=
ref
(
null
);
const
DataUpdateHotProduct
:
Ref
<
ProductType
|
null
>
=
ref
(
null
);
const
DataUpdateHotProduct
:
Ref
<
ProductType
|
null
>
=
ref
(
null
);
// const getInformationArtist = async () => {
// const response = (await api({
// url: API_PATHS.getDetailArtist,
// method: 'GET',
// params: { artistId: route.params.id },
// })) as AxiosResponse<BaseResponseBody<ArtistInfoType>>;
// console.log(response, 'Artist Detail Info');
// const ArtistInformation = response.data.data;
// id.value = ArtistInformation.id;
// // avatar.value = ArtistInformation.avatar
// avatar.value =
// 'https://static2.yan.vn/YanNews/2167221/201911/son-tung-mtp-so-huu-3-cong-ty-giai-tri-o-tuoi-25-cdm-qua-gioi-f53bb404.jpg';
// account.value = ArtistInformation.account;
// artistCode.value = ArtistInformation.artistCode;
// fullName.value = ArtistInformation.fullName;
// artistName.value = ArtistInformation.artistName;
// birthday.value = moment(
// ArtistInformation.birthday,
// 'DD/MM/YYYY HH:mm:ss'
// ).format('YYYY-MM-DD');
// address.value = ArtistInformation.address;
// status.value = ArtistInformation.status;
// phoneNumber.value = ArtistInformation.phoneNumber;
// email.value = ArtistInformation.email;
// facebook.value = ArtistInformation.facebook;
// facebookMessage.value = ArtistInformation.facebookMessage;
// instagram.value = ArtistInformation.instagram;
// whatsapp.value = ArtistInformation.whatsapp;
// nationality.value = ArtistInformation.nationality;
// qualification.value = ArtistInformation.qualification;
// works.value = ArtistInformation.works;
// artistLevel.value = ArtistInformation.artistLevel;
// sex.value = ArtistInformation.sex;
// fields.value = ArtistInformation.fields;
// bankAccounts.value = ArtistInformation.bankAccounts;
// products.value = ArtistInformation.products;
// banners.value = ArtistInformation.banners || [];
// socialEmbedded.value = ArtistInformation.socialEmbedded;
// stories.value = ArtistInformation.stories;
// schedules.value = ArtistInformation.schedules;
// for (let index = 0; index < schedules.value.length; index++) {
// const element = schedules.value[index];
// formatSchedules.value.push(
// moment(element.scheduleTime, 'DD/MM/YYYY HH:mm:ss').format(
// 'YYYY/MM/DD'
// )
// );
// }
// };
const
getFieldOptions
=
async
()
=>
{
const
getFieldOptions
=
async
()
=>
{
const
response
=
(
await
api
({
const
response
=
(
await
api
({
url
:
API_PATHS
.
getFieldOptions
,
url
:
API_PATHS
.
getFieldOptions
,
...
@@ -318,53 +276,108 @@ export default defineComponent({
...
@@ -318,53 +276,108 @@ export default defineComponent({
const
SetProduct
=
(
value
:
ProductType
)
=>
{
const
SetProduct
=
(
value
:
ProductType
)
=>
{
DataUpdateHotProduct
.
value
=
value
;
DataUpdateHotProduct
.
value
=
value
;
};
};
const
setAvatar
=
(
value
:
BannerType
)
=>
{
console
.
log
(
value
);
avatarFile
.
value
=
value
.
file
as
File
;
avatar
.
value
=
value
.
url
as
string
;
};
// const updateInformationArtist = async () => {
const
confirmDeleteSocialEmbedded
=
()
=>
{
// try {
Dialog
.
create
({
// const response = (await api({
title
:
i18n
.
global
.
t
(
// url: API_PATHS.updateArtist,
'artist.bankAccount.confirmActionsTitle.confirmDeleteAccBankTitle'
// method: 'POST',
),
// data: {
message
:
i18n
.
global
.
t
(
// id: route.params.id,
'artist.confirmActionsTitle.confirmDeleteEmbedContent'
// artistCode: artistCode.value,
),
// artistName: artistName.value,
cancel
:
i18n
.
global
.
t
(
// birthday: birthday.value,
'artist.bankAccount.confirmActionsTitle.confirmDeleteAccBankBtnLabel'
// sex: sex.value,
),
// address: address.value,
color
:
'negative'
,
// phoneNumber: phoneNumber.value,
}).
onOk
(()
=>
{
// email: email.value,
socialEmbedded
.
value
=
null
;
// facebook: facebook.value,
});
// facebookMessage: facebookMessage.value,
};
// instagram: instagram.value,
// whatsapp: whatsapp.value,
const
changeEmbed
=
(
newEmbed
:
string
|
null
)
=>
{
// fullName: fullName.value,
socialEmbedded
.
value
=
newEmbed
;
// // "workStatus": 1,
console
.
log
(
newEmbed
,
'newEmbed'
);
// shortDescription: null,
// account: null,
isOpenDialogEmbed
.
value
=
false
;
// socialEmbedded: socialEmbedded.value,
};
// artistLevel: artistLevel.value,
const
callApiUploadImage
=
async
(
file
:
File
)
=>
{
// fields: fields.value,
try
{
// nationality: nationality.value,
const
response
=
await
api
({
// qualification: qualification.value,
url
:
API_PATHS
.
uploadImage
,
// works: works.value,
method
:
'GET'
,
// banners: banners.value,
params
:
{},
// bankAccounts: bankAccounts.value,
});
// schedules: schedules.value,
}
catch
(
error
)
{}
// stories: stories.value,
};
// products: products.value,
// },
const
addArtist
=
async
()
=>
{
// })) as AxiosResponse<BaseResponseBody<unknown>>;
try
{
// if (response.data.error.code === config.API_RES_CODE.OK.code) {
const
response
=
(
await
api
({
// await Router.push({ name: Pages.artist });
url
:
API_PATHS
.
addArtist
,
// Notify.create({
method
:
'POST'
,
// type: 'positive',
data
:
{
// message: i18n.global.t('artist.actionMessages.editNewUserAccess'),
id
:
route
.
params
.
id
,
// });
avatar
:
avatar
.
value
,
// }
artistCode
:
artistCode
.
value
,
// } catch (error) {}
artistName
:
artistName
.
value
,
// };
birthday
:
birthday
.
value
,
sex
:
sex
.
value
,
address
:
address
.
value
,
phoneNumber
:
phoneNumber
.
value
,
email
:
email
.
value
,
facebook
:
facebook
.
value
,
facebookMessage
:
facebookMessage
.
value
,
instagram
:
instagram
.
value
,
whatsapp
:
whatsapp
.
value
,
fullName
:
fullName
.
value
,
// "workStatus": 1,
shortDescription
:
null
,
account
:
account
.
value
,
socialEmbedded
:
socialEmbedded
.
value
,
artistLevel
:
artistLevel
.
value
,
fields
:
fields
.
value
,
nationality
:
nationality
.
value
,
qualification
:
qualification
.
value
,
works
:
works
.
value
,
banners
:
banners
.
value
,
bankAccounts
:
bankAccounts
.
value
,
schedules
:
schedules
.
value
,
stories
:
stories
.
value
,
products
:
products
.
value
,
},
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
await
Router
.
push
({
name
:
Pages
.
artist
});
Notify
.
create
({
type
:
'positive'
,
message
:
i18n
.
global
.
t
(
'artist.actionMessages.editNewUserAccess'
),
});
}
}
catch
(
error
)
{}
};
const
deleteImagesStories
=
(
value
:
number
)
=>
{
console
.
log
(
value
,
'deleteImagesStories'
);
console
.
log
(
stories
.
value
);
};
const
DeleteItemStories
=
(
value
:
StoriesType
)
=>
{
for
(
let
i
=
0
;
i
<
stories
.
value
.
length
;
i
++
)
{
if
(
stories
.
value
[
i
].
id
==
value
.
id
)
{
console
.
log
(
1
);
stories
.
value
.
splice
(
Number
(
stories
.
value
[
i
]),
1
);
}
}
console
.
log
(
stories
.
value
);
};
const
deleteAvatar
=
()
=>
{
avatar
.
value
=
null
;
};
onMounted
(()
=>
{
onMounted
(()
=>
{
// void getInformationArtist();
void
getFieldOptions
();
void
getFieldOptions
();
void
getNationalityOptions
();
void
getNationalityOptions
();
void
getArtistLevelOptions
();
void
getArtistLevelOptions
();
...
@@ -374,7 +387,6 @@ export default defineComponent({
...
@@ -374,7 +387,6 @@ export default defineComponent({
void
getTypeCardOptions
();
void
getTypeCardOptions
();
});
});
return
{
return
{
// getInformationArtist,
tab
,
tab
,
id
,
id
,
route
,
route
,
...
@@ -434,6 +446,7 @@ export default defineComponent({
...
@@ -434,6 +446,7 @@ export default defineComponent({
resetOldData
,
resetOldData
,
reset
,
reset
,
confirmDeleteRow
,
confirmDeleteRow
,
addArtist
,
openUpdateHotProduct
,
openUpdateHotProduct
,
SetProduct
,
SetProduct
,
DataUpdateHotProduct
,
DataUpdateHotProduct
,
...
@@ -442,6 +455,12 @@ export default defineComponent({
...
@@ -442,6 +455,12 @@ export default defineComponent({
getTypeCardOptions
,
getTypeCardOptions
,
rowDataAccBank
,
rowDataAccBank
,
avatar
,
avatar
,
setAvatar
,
deleteAvatar
,
deleteImagesStories
,
DeleteItemStories
,
confirmDeleteSocialEmbedded
,
changeEmbed
,
};
};
},
},
});
});
src/pages/them-nghe-sy/index.vue
View file @
e9783f94
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
name=
"information"
name=
"information"
:label=
"$t('artist.artistInformation.tabLabel.personalInformation')"
:label=
"$t('artist.artistInformation.tabLabel.personalInformation')"
/>
/>
<
!--
<
q-tab
<q-tab
name=
"vabAccount"
name=
"vabAccount"
:label=
"$t('artist.artistInformation.tabLabel.vabAccout')"
:label=
"$t('artist.artistInformation.tabLabel.vabAccout')"
/>
-->
/>
<q-tab
<q-tab
name=
"bankAccount"
name=
"bankAccount"
:label=
"$t('artist.artistInformation.tabLabel.bankAcount')"
:label=
"$t('artist.artistInformation.tabLabel.bankAcount')"
...
@@ -60,11 +60,10 @@
...
@@ -60,11 +60,10 @@
:work-options=
"workOptions"
:work-options=
"workOptions"
></PersonalInformation>
></PersonalInformation>
</q-tab-panel>
</q-tab-panel>
<
!--
<
q-tab-panel
name=
"vabAccount"
>
<q-tab-panel
name=
"vabAccount"
>
<VabAccount
<VabAccount
v-model:account=
"account"
v-model:account=
"account"
v-model:short-description=
"shortDescription"
v-model:short-description=
"shortDescription"
v-model:content=
"stories[0].content"
v-model:format-schedules=
"formatSchedules"
v-model:format-schedules=
"formatSchedules"
@
selectedFile=
"selectedFile"
@
selectedFile=
"selectedFile"
@
deleteBanner=
"banners.splice($event, 1)"
@
deleteBanner=
"banners.splice($event, 1)"
...
@@ -73,7 +72,7 @@
...
@@ -73,7 +72,7 @@
:banners=
"banners"
:banners=
"banners"
:stories=
"stories"
:stories=
"stories"
></VabAccount>
></VabAccount>
</q-tab-panel>
-->
</q-tab-panel>
<q-tab-panel
name=
"bankAccount"
>
<q-tab-panel
name=
"bankAccount"
>
<BankAccount
<BankAccount
...
@@ -118,12 +117,12 @@
...
@@ -118,12 +117,12 @@
@
click:CloseBtn=
"isOpenEditAccountBankDialog = false"
@
click:CloseBtn=
"isOpenEditAccountBankDialog = false"
></EditBankAccountDialog>
></EditBankAccountDialog>
<
!--
<
UploadEmbedDialog
<UploadEmbedDialog
v-model:is-open-dialog-embed=
"isOpenDialogEmbed"
v-model:is-open-dialog-embed=
"isOpenDialogEmbed"
v-model:social-embedded=
"socialEmbedded"
v-model:social-embedded=
"socialEmbedded"
@
uploadEmbed=
"isOpenDialogEmbed = false"
@
uploadEmbed=
"isOpenDialogEmbed = false"
@
click:CloseBtn=
"isOpenDialogEmbed = false"
@
click:CloseBtn=
"isOpenDialogEmbed = false"
></UploadEmbedDialog>
-->
></UploadEmbedDialog>
<AddHotProductDialog
<AddHotProductDialog
@
insertData=
"pushData"
@
insertData=
"pushData"
...
@@ -154,6 +153,7 @@
...
@@ -154,6 +153,7 @@
color=
"primary"
color=
"primary"
no-caps
no-caps
:label=
"$t('crudActions.update')"
:label=
"$t('crudActions.update')"
@
click=
"addArtist"
></q-btn>
></q-btn>
</div>
</div>
</div>
</div>
...
...
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