update

parent c3c8b3f7
...@@ -39,4 +39,5 @@ export enum API_PATHS { ...@@ -39,4 +39,5 @@ export enum API_PATHS {
getArtistLevelOptions = '/artistLevel', getArtistLevelOptions = '/artistLevel',
getQualificationOptions = '/qualification', getQualificationOptions = '/qualification',
getWorkOptions = '/work', getWorkOptions = '/work',
getDetailArtist = '/artist/detail',
} }
...@@ -37,17 +37,22 @@ export type ArtistInfoType = { ...@@ -37,17 +37,22 @@ export type ArtistInfoType = {
sex: number; sex: number;
address: string | null; address: string | null;
status: number; status: number;
nationality: NationalityType;
field: FieldType;
work: WorkType;
qualification: QualificationType;
artistLevel: FieldType;
phoneNumber: string | null; phoneNumber: string | null;
email: string | null; email: string | null;
facebook: string | null; facebook: string | null;
facebookMessage: string | null; facebookMessage: string | null;
instagram: string | null; instagram: string | null;
whatsapp: string | null; whatsapp: string | null;
nationality: NationalityType;
fields: FieldType[];
works: WorkType[];
qualification: QualificationType;
artistLevel: ArtistLevelType;
bankAccounts: BankAccountType[];
banners: BannerType[];
products: ProductType[];
schedules: SchedulesType[];
stories: StoriesType[];
}; };
export type FieldType = { export type FieldType = {
...@@ -83,15 +88,11 @@ export type WorkType = { ...@@ -83,15 +88,11 @@ export type WorkType = {
numIndex: number; numIndex: number;
}; };
export type ArtistOwner = { export type BannerType = {
bannerUrl: string;
id: number; id: number;
code: string; numIndex: number;
name: string; status: 1;
representative: string;
fields: string;
email: string;
phoneNumber: number;
status: number;
}; };
export type SchedulesType = { export type SchedulesType = {
...@@ -111,3 +112,37 @@ export type StoriesType = { ...@@ -111,3 +112,37 @@ export type StoriesType = {
imageUrl: string; imageUrl: string;
status: number; status: number;
}; };
export type BankAccountType = {
id: number;
isDefault: number;
nameInCard: string;
status: number;
accountNumber: string;
accountOwner: string;
bankName: string;
branchName: string;
cardNumber: string;
cardType: number;
};
export type ProductType = {
code: string;
embeddedUrl: string;
id: number;
imageUrl: string;
name: string;
numIndex: number;
status: number;
};
export type ArtistOwner = {
id: number;
code: string;
name: string;
representative: string;
fields: string;
email: string;
phoneNumber: number;
status: number;
};
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { i18n } from 'src/boot/i18n';
import { isEmail } from '../../../boot/functions';
import { isMobilePhone } from '../../../boot/functions';
export default defineComponent({ export default defineComponent({
props: { props: {
id: { type: Number, required: true }, id: { type: Number, required: true },
artistCode: { type: String, required: true }, artistCode: { type: String, required: true },
fullName: { type: String, required: true }, fullName: { type: String, required: true },
artistName: { type: String, default: '' }, artistName: { type: String, required: true },
birthday: { type: String, default: '' }, birthday: { type: String, required: true },
sex: { type: Number, required: true }, sex: { type: Number, required: true },
nationality: { type: String, default: '' }, nationality: { type: Number, required: true },
address: { type: String, default: '' },
status: { type: Number, required: true }, status: { type: Number, required: true },
field: { type: String, default: '' }, address: { type: String, required: true },
work: { type: String, default: '' }, fields: { type: Array, required: true },
qualification: { type: String, default: '' }, works: { type: Number, required: true },
artistLevel: { type: String, default: '' }, qualification: { type: Number, required: true },
phoneNumber: { type: String, default: '' }, artistLevel: { type: Number, required: true },
email: { type: String, default: '' }, phoneNumber: { type: String, required: true },
facebook: { type: String, default: '' }, email: { type: String, required: true },
facebookMessage: { type: String, default: '' }, facebook: { type: String, required: true },
instagram: { type: String, default: '' }, facebookMessage: { type: String, required: true },
whatsapp: { type: String, default: '' }, instagram: { type: String, required: true },
whatsapp: { type: String, required: true },
sexOptions: { type: Array, required: true },
fieldOptions: { type: Array, required: true },
nationalityOptions: { type: Array, required: true },
professionOptions: { type: Array, required: true },
artistLevelOptions: { type: Array, required: true },
workOptions: { type: Array, required: true },
},
setup() {
const artistCodeRules = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireArtistCode'
),
];
const fullNameRules = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireFullName'
),
];
const artistNameRules = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireArtistName'
),
];
const birthdayRules = [
(val?: string) =>
val !== undefined ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireBirthday'
),
];
const emailRules = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t('artist.artistInformation.validateMessages.requireEmail'),
(val: string) =>
isEmail(val) ||
i18n.global.t('artist.artistInformation.validateMessages.isEmail'),
];
const addressRules = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireAddress'
),
];
const phoneNumberRules = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t(
'artist.artistInformation.validateMessages.requirePhoneNumber'
),
(val: string) =>
isMobilePhone(val) ||
i18n.global.t('artist.artistInformation.validateMessages.isPhone'),
];
const sexRules = [
(val?: number) =>
val !== undefined ||
i18n.global.t('artist.artistInformation.validateMessages.requireSex'),
];
const nationalityRules = [
(val?: number) =>
val !== undefined ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireNationality'
),
];
const fieldRules = [
(val?: number) =>
val !== undefined ||
i18n.global.t('artist.artistInformation.validateMessages.requireField'),
];
const workRules = [
(val?: number) =>
val !== undefined ||
i18n.global.t('artist.artistInformation.validateMessages.requiredWork'),
];
const qualificationRules = [
(val?: number) =>
val !== undefined ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireQualification'
),
];
const artistLevelRules = [
(val?: number) =>
val !== undefined ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireArtistLevel'
),
];
return {
artistCodeRules,
fullNameRules,
artistNameRules,
birthdayRules,
emailRules,
addressRules,
phoneNumberRules,
sexRules,
nationalityRules,
fieldRules,
workRules,
qualificationRules,
artistLevelRules,
};
}, },
emits: [ emits: [
'update:artistCode',
'update:fullName', 'update:fullName',
'update:artistName', 'update:artistName',
'update:birthday', 'update:birthday',
'update:sex',
'update:nationality',
'update:address',
'update:status',
'update:field',
'update:work',
'update:qualification',
'update:artistLevel',
'update:phoneNumber',
'update:email', 'update:email',
'update:facebook', 'update:facebook',
'update:facebookMessage', 'update:facebookMessage',
'update:instagram', 'update:instagram',
'update:whatsapp', 'update:whatsapp',
'update:address',
'update:phoneNumber',
'update:sex',
'update:nationality',
'update:fields',
'update:works',
'update:qualification',
'update:artistLevel',
'update:status',
'addNewArtist',
], ],
}); });
...@@ -2,17 +2,26 @@ ...@@ -2,17 +2,26 @@
<div class="row q-col-gutter-sm q-mt-md"> <div class="row q-col-gutter-sm q-mt-md">
<q-space></q-space> <q-space></q-space>
<div class="col-5"> <div class="col-5">
<div class="row flex-center"> <!-- <div class="row flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.id') }} {{ $t('artist.artistInformation.titleDataField.id') }}
</div> </div>
<div class="col-8">{{ id }}</div> <div class="col-8">{{ id }}</div>
</div> </div> -->
<div class="row q-mt-md flex-center"> <div class="row q-mt-sm flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.artistCode') }} {{ $t('artist.artistInformation.titleDataField.artistCode') }}
</div> </div>
<div class="col-8">{{ artistCode }}</div> <div class="col-8">
<q-input
:model-value="artistCode"
:rules="artistCodeRules"
@update:model-value="$emit('update:artistCode', $event)"
outlined
dense
hide-bottom-space
></q-input>
</div>
</div> </div>
<div class="row q-mt-md flex-center"> <div class="row q-mt-md flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
...@@ -21,9 +30,11 @@ ...@@ -21,9 +30,11 @@
<div class="col-8"> <div class="col-8">
<q-input <q-input
:model-value="fullName" :model-value="fullName"
:rules="fullNameRules"
@update:model-value="$emit('update:fullName', $event)" @update:model-value="$emit('update:fullName', $event)"
outlined outlined
dense dense
hide-bottom-space
></q-input> ></q-input>
</div> </div>
</div> </div>
...@@ -35,25 +46,32 @@ ...@@ -35,25 +46,32 @@
<q-input <q-input
:model-value="artistName" :model-value="artistName"
@update:model-value="$emit('update:artistName', $event)" @update:model-value="$emit('update:artistName', $event)"
:rules="artistNameRules"
outlined outlined
dense dense
hide-bottom-space
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row q-mt-md flex-center"> <div class="row q-mt-sm flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.birthday') }} {{ $t('artist.artistInformation.titleDataField.birthday') }}
</div> </div>
<div class="col-8"> <div class="col-8">
<q-select <q-input
:model-value="birthday" :model-value="birthday"
@update:model-value="$emit('update:birthday', $event)" @update:model-value="$emit('update:birthday', $event)"
:rules="birthdayRules"
class="q-my-sm"
type="date"
outlined outlined
dense dense
></q-select> hide-bottom-space
>
</q-input>
</div> </div>
</div> </div>
<div class="row q-mt-md flex-center"> <div class="row flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.sex') }} {{ $t('artist.artistInformation.titleDataField.sex') }}
</div> </div>
...@@ -61,12 +79,22 @@ ...@@ -61,12 +79,22 @@
<q-select <q-select
:model-value="sex" :model-value="sex"
@update:model-value="$emit('update:sex', $event)" @update:model-value="$emit('update:sex', $event)"
:options="sexOptions"
:rules="sexRules"
emit-value
map-options
option-value="id"
option-label="name"
type="text"
class="q-my-sm"
outlined outlined
hide-bottom-space
clearable
dense dense
></q-select> ></q-select>
</div> </div>
</div> </div>
<div class="row q-mt-md flex-center"> <div class="row flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.nationality') }} {{ $t('artist.artistInformation.titleDataField.nationality') }}
</div> </div>
...@@ -74,12 +102,22 @@ ...@@ -74,12 +102,22 @@
<q-select <q-select
:model-value="nationality" :model-value="nationality"
@update:model-value="$emit('update:nationality', $event)" @update:model-value="$emit('update:nationality', $event)"
:options="nationalityOptions"
:rules="nationalityRules"
emit-value
map-options
option-value="id"
option-label="name"
type="text"
class="q-my-sm"
outlined outlined
hide-bottom-space
clearable
dense dense
></q-select> ></q-select>
</div> </div>
</div> </div>
<div class="row q-mt-md flex-center"> <div class="row q-mt-xs flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.address') }} {{ $t('artist.artistInformation.titleDataField.address') }}
</div> </div>
...@@ -87,54 +125,82 @@ ...@@ -87,54 +125,82 @@
<q-input <q-input
:model-value="address" :model-value="address"
@update:model-value="$emit('update:address', $event)" @update:model-value="$emit('update:address', $event)"
:rules="addressRules"
outlined outlined
hide-bottom-space
dense dense
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row q-mt-md flex-center"> <div class="row q-mt-xs flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.status') }} {{ $t('artist.artistInformation.titleDataField.field') }}
</div> </div>
<div class="col-8"> <div class="col-8">
<q-select <q-select
:model-value="status" :model-value="fields"
@update:model-value="$emit('update:status', $event)" @update:model-value="$emit('update:fields', $event)"
:rules="fieldRules"
:options="fieldOptions"
emit-value
map-options
option-value="id"
option-label="name"
type="text"
class="q-my-sm"
outlined outlined
hide-bottom-space
clearable
dense dense
multiple
use-input
use-chips
></q-select> ></q-select>
</div> </div>
</div> </div>
</div>
<q-space></q-space>
<div class="col-5">
<div class="row flex-center"> <div class="row flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.field') }} {{ $t('artist.artistInformation.titleDataField.work') }}
</div> </div>
<div class="col-8"> <div class="col-8">
<q-select <q-select
:model-value="field" :model-value="works"
@update:model-value="$emit('update:field', $event)" :rules="workRules"
@update:model-value="$emit('update:works', $event)"
:options="workOptions"
emit-value
map-options
option-value="id"
option-label="name"
type="text"
class="q-my-sm"
outlined outlined
hide-bottom-space
clearable
dense dense
multiple
use-input
use-chips
></q-select> ></q-select>
</div> </div>
</div> </div>
<div class="row q-mt-sm flex-center"> <!-- <div class="row q-mt-md flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.work') }} {{ $t('artist.artistInformation.titleDataField.status') }}
</div> </div>
<div class="col-8"> <div class="col-8">
<q-select <q-select
:model-value="work" :model-value="status"
@update:model-value="$emit('update:work', $event)" @update:model-value="$emit('update:status', $event)"
outlined outlined
dense dense
></q-select> ></q-select>
</div> </div>
</div> -->
</div> </div>
<div class="row q-mt-sm flex-center"> <q-space></q-space>
<div class="col-5">
<div class="row flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.qualification') }} {{ $t('artist.artistInformation.titleDataField.qualification') }}
</div> </div>
...@@ -142,20 +208,40 @@ ...@@ -142,20 +208,40 @@
<q-select <q-select
:model-value="qualification" :model-value="qualification"
@update:model-value="$emit('update:qualification', $event)" @update:model-value="$emit('update:qualification', $event)"
:options="professionOptions"
:rules="qualificationRules"
emit-value
map-options
option-value="id"
option-label="name"
type="text"
class="q-my-sm"
outlined outlined
hide-bottom-space
clearable
dense dense
></q-select> ></q-select>
</div> </div>
</div> </div>
<div class="row q-mt-sm flex-center"> <div class="row flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.artistLevel') }} {{ $t('artist.artistInformation.titleDataField.artistLevel') }}
</div> </div>
<div class="col-8"> <div class="col-8">
<q-select <q-select
:model-value="artistLevel" :model-value="artistLevel"
:rules="artistLevelRules"
@update:model-value="$emit('update:artistLevel')" @update:model-value="$emit('update:artistLevel')"
:options="artistLevelOptions"
emit-value
map-options
option-value="id"
option-label="name"
type="text"
class="q-my-sm"
outlined outlined
hide-bottom-space
clearable
dense dense
></q-select> ></q-select>
</div> </div>
...@@ -168,12 +254,14 @@ ...@@ -168,12 +254,14 @@
<q-input <q-input
:model-value="phoneNumber" :model-value="phoneNumber"
@update:model-value="$emit('update:phoneNumber', $event)" @update:model-value="$emit('update:phoneNumber', $event)"
:rules="phoneNumberRules"
outlined outlined
dense dense
hide-bottom-space
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row q-mt-sm flex-center"> <div class="row q-mt-md flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.email') }} {{ $t('artist.artistInformation.titleDataField.email') }}
</div> </div>
...@@ -181,12 +269,14 @@ ...@@ -181,12 +269,14 @@
<q-input <q-input
:model-value="email" :model-value="email"
@update:model-value="$emit('update:email', $event)" @update:model-value="$emit('update:email', $event)"
:rules="emailRules"
outlined outlined
dense dense
hide-bottom-space
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row q-mt-sm flex-center"> <div class="row q-mt-md flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.facebook') }} {{ $t('artist.artistInformation.titleDataField.facebook') }}
</div> </div>
...@@ -199,7 +289,7 @@ ...@@ -199,7 +289,7 @@
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row q-mt-sm flex-center"> <div class="row q-mt-md flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.facebookMessage') }} {{ $t('artist.artistInformation.titleDataField.facebookMessage') }}
</div> </div>
...@@ -212,7 +302,7 @@ ...@@ -212,7 +302,7 @@
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row q-mt-sm flex-center"> <div class="row q-mt-md flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.instagram') }} {{ $t('artist.artistInformation.titleDataField.instagram') }}
</div> </div>
...@@ -225,7 +315,7 @@ ...@@ -225,7 +315,7 @@
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row q-mt-sm flex-center"> <div class="row q-mt-md flex-center">
<div class="col-3 text-weight-medium"> <div class="col-3 text-weight-medium">
{{ $t('artist.artistInformation.titleDataField.whatsapp') }} {{ $t('artist.artistInformation.titleDataField.whatsapp') }}
</div> </div>
......
...@@ -35,16 +35,16 @@ ...@@ -35,16 +35,16 @@
<q-tab-panel name="information"> <q-tab-panel name="information">
<PersonalInformation <PersonalInformation
:id="id" :id="id"
:artist-code="artistCode" v-model:artist-code="artistCode"
v-model:full-name="fullName" v-model:full-name="fullName"
v-model:artist-name="artistName" v-model:artist-name="artistName"
v-model:birthday="birthday" v-model:birthday="birthday"
v-model:sex="sex" v-model:sex="sex"
v-model:nationality="nationality" v-model:nationality="nationality"
v-model:address="address"
v-model:status="status" v-model:status="status"
v-model:field="field" v-model:address="address"
v-model:work="work" v-model:fields="fields"
v-model:works="works"
v-model:qualification="qualification" v-model:qualification="qualification"
v-model:artist-level="artistLevel" v-model:artist-level="artistLevel"
v-model:phone-number="phoneNumber" v-model:phone-number="phoneNumber"
...@@ -53,6 +53,12 @@ ...@@ -53,6 +53,12 @@
v-model:facebook-message="facebookMessage" v-model:facebook-message="facebookMessage"
v-model:instagram="instagram" v-model:instagram="instagram"
v-model:whatsapp="whatsapp" v-model:whatsapp="whatsapp"
:sex-options="sexOptions"
:field-options="fieldOptions"
:nationality-options="nationalityOptions"
:profession-options="professionOptions"
:artist-level-options="artistLevelOptions"
:work-options="workOptions"
></PersonalInformation> ></PersonalInformation>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="vabAccount"> <q-tab-panel name="vabAccount">
......
// import { route } from 'quasar/wrappers';
// import { api } from 'src/boot/axios';
// import router from 'src/router';
// import routes from 'src/router/routes';
// import router from 'src/router';
import { defineComponent, onMounted, Ref, ref } from 'vue'; import { defineComponent, onMounted, Ref, ref } from 'vue';
import PersonalInformation from '../../components/artist-information/personal-information/index.vue'; import PersonalInformation from '../../components/artist-information/personal-information/index.vue';
import VabAccount from '../../components/artist-information/VAB-account/index.vue'; import VabAccount from '../../components/artist-information/VAB-account/index.vue';
import BankAccount from '../../components/artist-information/bank-account/index.vue'; import BankAccount from '../../components/artist-information/bank-account/index.vue';
import HotProduct from '../../components/artist-information/hot-product/index.vue'; import HotProduct from '../../components/artist-information/hot-product/index.vue';
// import { useRoute } from 'vue-router'; import { api, BaseResponseBody } from 'src/boot/axios';
import { API_PATHS, config } from 'src/assets/configurations';
import { useRoute } from 'vue-router';
import { AxiosResponse } from 'axios';
import {
ArtistInfoType,
FieldType,
NationalityType,
ArtistLevelType,
QualificationType,
WorkType,
} from 'src/assets/type';
export default defineComponent({ export default defineComponent({
components: { components: {
...@@ -33,84 +39,147 @@ export default defineComponent({ ...@@ -33,84 +39,147 @@ export default defineComponent({
setup() { setup() {
const tab = ref('information'); const tab = ref('information');
const fieldOptions: Ref<FieldType[]> = ref([]);
const nationalityOptions: Ref<NationalityType[]> = ref([]);
const professionOptions: Ref<QualificationType[]> = ref([]);
const artistLevelOptions: Ref<ArtistLevelType[]> = ref([]);
const workOptions: Ref<WorkType[]> = ref([]);
const sexOptions = ref([
{ id: 1, name: 'Nam' },
{ id: 2, name: 'Nữ' },
]);
const id: Ref<number> = ref(0); const id: Ref<number> = ref(0);
const artistCode: Ref<string> = ref(''); const artistCode: Ref<string> = ref('');
const fullName: Ref<string> = ref(''); const fullName: Ref<string> = ref('');
const artistName: Ref<string | undefined> = ref(); const artistName: Ref<string | null | undefined> = ref();
const birthday: Ref<string | undefined> = ref(); const birthday: Ref<string | null | undefined> = ref('29/04/2021');
const sex: Ref<number | undefined> = ref(); const sex: Ref<number | undefined> = ref();
const nationality: Ref<string | undefined> = ref(); const nationality: Ref<NationalityType> = ref({
const address: Ref<string | undefined> = ref(); id: 0,
name: 'VN',
status: 1,
numIndex: 1,
});
const qualification: Ref<QualificationType> = ref({
id: 0,
name: 'Chuyen nghiep',
status: 1,
numIndex: 1,
});
const artistLevel: Ref<ArtistLevelType> = ref({
id: 0,
name: 'Hang 1',
status: 1,
artistLevel: 1,
description: '',
});
const address: Ref<string | null | undefined> = ref();
const status: Ref<number> = ref(1); const status: Ref<number> = ref(1);
const field: Ref<string | undefined> = ref(); const fields: Ref<FieldType[]> = ref([]);
const work: Ref<string | undefined> = ref(); const works: Ref<WorkType[]> = ref([]);
const qualification: Ref<string | undefined> = ref(); const phoneNumber: Ref<string | null | undefined> = ref();
const artistLevel: Ref<string | undefined> = ref(); const email: Ref<string | null | undefined> = ref();
const phoneNumber: Ref<string | undefined> = ref(); const facebook: Ref<string | null | undefined> = ref();
const email: Ref<string | undefined> = ref(); const facebookMessage: Ref<string | null | undefined> = ref();
const facebook: Ref<string | undefined> = ref(); const instagram: Ref<string | null | undefined> = ref();
const facebookMessage: Ref<string | undefined> = ref(); const whatsapp: Ref<string | null | undefined> = ref();
const instagram: Ref<string | undefined> = ref();
const whatsapp: Ref<string | undefined> = ref();
// const route = useRoute(); const route = useRoute();
const getInformationArtist = () => { const getInformationArtist = async () => {
// const response = await api({ const response = (await api({
// // url: API_PATHS. url: API_PATHS.getDetailArtist,
// method: 'GET', method: 'GET',
// params: { params: { artistId: route.params.id },
// id: route.params.id, })) as AxiosResponse<BaseResponseBody<ArtistInfoType>>;
// }, console.log(response, 'Artist Detail Info');
// }); const ArtistInformation = response.data.data;
const fakeData = { id.value = ArtistInformation.id;
id: 1, artistCode.value = ArtistInformation.artistCode;
artistCode: '0001', fullName.value = ArtistInformation.fullName;
fullName: 'Sơn Tùng', artistName.value = ArtistInformation.artistName;
stageName: 'SonTungMTP', // birthday.value = ArtistInformation.birthday;
birthday: '04/02/1999', address.value = ArtistInformation.address;
sex: 1, status.value = ArtistInformation.status;
nationality: 'Việt Nam', phoneNumber.value = ArtistInformation.phoneNumber;
address: '', email.value = ArtistInformation.email;
status: 1, facebook.value = ArtistInformation.facebook;
field: 'Âm nhạc', facebookMessage.value = ArtistInformation.facebookMessage;
work: 'Ca sỹ', instagram.value = ArtistInformation.instagram;
qualification: 'Chuyên nghiệp', whatsapp.value = ArtistInformation.whatsapp;
artistLevel: 'Vip_1', nationality.value = ArtistInformation.nationality;
phoneNumber: '09999999999', qualification.value = ArtistInformation.qualification;
email: 'sontung@gmail.com', works.value = ArtistInformation.works;
facebook: '', artistLevel.value = ArtistInformation.artistLevel;
facebookMessage: '', sex.value = ArtistInformation.sex;
instagram: '', fields.value = ArtistInformation.fields;
whatsapp: '', };
const getFieldOptions = async () => {
const response = (await api({
url: API_PATHS.getFieldOptions,
method: 'GET',
params: {},
})) as AxiosResponse<BaseResponseBody<FieldType[]>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
fieldOptions.value = response.data.data;
console.log(fieldOptions.value, 'fieldOptions');
}
}; };
artistCode.value = fakeData.artistCode; const getNationalityOptions = async () => {
fullName.value = fakeData.fullName; const response = (await api({
artistName.value = fakeData.stageName; url: API_PATHS.getNationalityOptions,
birthday.value = fakeData.birthday; method: 'GET',
sex.value = fakeData.sex; params: {},
nationality.value = fakeData.nationality; })) as AxiosResponse<BaseResponseBody<NationalityType[]>>;
address.value = fakeData.address; if (response.data.error.code === config.API_RES_CODE.OK.code) {
status.value = fakeData.status; nationalityOptions.value = response.data.data;
field.value = fakeData.field; }
work.value = fakeData.work; };
qualification.value = fakeData.qualification; const getArtistLevelOptions = async () => {
artistLevel.value = fakeData.artistLevel; const response = (await api({
phoneNumber.value = fakeData.phoneNumber; url: API_PATHS.getArtistLevelOptions,
email.value = fakeData.email; method: 'GET',
facebook.value = fakeData.facebook; params: {},
facebookMessage.value = fakeData.facebookMessage; })) as AxiosResponse<BaseResponseBody<ArtistLevelType[]>>;
instagram.value = fakeData.instagram; if (response.data.error.code === config.API_RES_CODE.OK.code) {
whatsapp.value = fakeData.whatsapp; artistLevelOptions.value = response.data.data;
}
};
const getQualificationOptions = async () => {
const response = (await api({
url: API_PATHS.getQualificationOptions,
method: 'GET',
params: {},
})) as AxiosResponse<BaseResponseBody<QualificationType[]>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
professionOptions.value = response.data.data;
}
};
const getWorkOptions = async () => {
const response = (await api({
url: API_PATHS.getWorkOptions,
method: 'GET',
params: {},
})) as AxiosResponse<BaseResponseBody<WorkType[]>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
workOptions.value = response.data.data;
}
}; };
onMounted(() => { onMounted(() => {
console.log('Information');
void getInformationArtist(); void getInformationArtist();
void getFieldOptions();
void getNationalityOptions();
void getArtistLevelOptions();
void getQualificationOptions();
void getWorkOptions();
}); });
return { return {
tab, tab,
getInformationArtist, getInformationArtist,
id, id,
route,
artistCode, artistCode,
fullName, fullName,
artistName, artistName,
...@@ -119,8 +188,8 @@ export default defineComponent({ ...@@ -119,8 +188,8 @@ export default defineComponent({
nationality, nationality,
address, address,
status, status,
field, fields,
work, works,
qualification, qualification,
artistLevel, artistLevel,
phoneNumber, phoneNumber,
...@@ -129,6 +198,17 @@ export default defineComponent({ ...@@ -129,6 +198,17 @@ export default defineComponent({
facebookMessage, facebookMessage,
instagram, instagram,
whatsapp, whatsapp,
sexOptions,
fieldOptions,
nationalityOptions,
professionOptions,
artistLevelOptions,
workOptions,
getFieldOptions,
getNationalityOptions,
getArtistLevelOptions,
getQualificationOptions,
getWorkOptions,
}; };
}, },
}); });
<template> <template>
<div class="row q-col-gutter-sm flex-center q-mt-sm"> <div class="row q-col-gutter-sm flex-center q-mt-sm">
<div class="col-auto text-h6 text-weight-regular flex flex-center q-mr-md">
{{ $t('artist.title') }}
<q-separator vertical spaced />
</div>
<q-space></q-space> <q-space></q-space>
<div class="col-2"> <div class="col-2">
<q-input <q-input
...@@ -11,7 +7,6 @@ ...@@ -11,7 +7,6 @@
dense dense
outlined outlined
:label="$t('artist.tableColumnsArtist.artistName')" :label="$t('artist.tableColumnsArtist.artistName')"
clearable
></q-input> ></q-input>
</div> </div>
<div class="col-2" dense outlined> <div class="col-2" dense outlined>
...@@ -23,7 +18,6 @@ ...@@ -23,7 +18,6 @@
label="Lĩnh vực" label="Lĩnh vực"
dense dense
outlined outlined
clearable
></q-select> ></q-select>
</div> </div>
<div class="col-2" dense outlined> <div class="col-2" dense outlined>
...@@ -35,7 +29,6 @@ ...@@ -35,7 +29,6 @@
dense dense
outlined outlined
label="Độ chuyên" label="Độ chuyên"
clearable
></q-select> ></q-select>
</div> </div>
<div class="col-2" dense outlined> <div class="col-2" dense outlined>
...@@ -47,7 +40,6 @@ ...@@ -47,7 +40,6 @@
dense dense
outlined outlined
label="Xếp hạng" label="Xếp hạng"
clearable
></q-select> ></q-select>
</div> </div>
<div class="col-auto"> <div class="col-auto">
...@@ -55,7 +47,6 @@ ...@@ -55,7 +47,6 @@
color="primary" color="primary"
no-caps no-caps
:label="$t('crudActions.search')" :label="$t('crudActions.search')"
style="width: 100px"
@click="filterListArtist" @click="filterListArtist"
> >
</q-btn> </q-btn>
...@@ -65,7 +56,6 @@ ...@@ -65,7 +56,6 @@
color="primary" color="primary"
no-caps no-caps
:label="$t('crudActions.add')" :label="$t('crudActions.add')"
style="width: 100px"
@click="isOpenNewArtistDialog = true" @click="isOpenNewArtistDialog = true"
></q-btn> ></q-btn>
</div> </div>
...@@ -111,7 +101,7 @@ ...@@ -111,7 +101,7 @@
</div> </div>
<AddNewArtistDialog <AddNewArtistDialog
v-model:is-open-new-artist-dialog="isOpenNewArtistDialog" v-model:is-open-new-artist-dialog="isOpenNewArtistDialog"
artistCode v-model:artist-code="artistCode"
v-model:full-name="fullName" v-model:full-name="fullName"
v-model:artist-name="artistName" v-model:artist-name="artistName"
v-model:birthday="birthday" v-model:birthday="birthday"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment