format code

parent 51520254
import { defineComponent } from 'vue';
import { i18n } from 'src/boot/i18n';
import { isEmail } from '../../../boot/functions';
import { isMobilePhone } from '../../../boot/functions';
export default defineComponent({
props: {
isOpenNewArtistDialog: {
type: Boolean,
required: true,
},
artistCode: { type: String, required: true },
fullName: { type: String, required: true },
artistName: { type: String, required: true },
birthday: { type: String, required: true },
sex: { type: Number, required: true },
nationality: { type: Number, required: true },
status: { type: Number, required: true },
address: { type: String, required: true },
field: { type: Number, required: true },
work: { type: Number, required: true },
qualification: { type: Number, required: true },
artistLevel: { type: Number, required: true },
phoneNumber: { type: String, required: true },
email: { type: String, required: true },
facebook: { type: String, required: true },
facebookMessage: { type: String, required: true },
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: [
'update:isOpenNewArtistDialog',
'click:CloseBtn',
'update:artistCode',
'update:fullName',
'update:artistName',
'update:birthday',
'update:email',
'update:facebook',
'update:facebookMessage',
'update:instagram',
'update:whatsapp',
'update:address',
'update:phoneNumber',
'update:sex',
'update:nationality',
'update:field',
'update:work',
'update:qualification',
'update:artistLevel',
'update:status',
'addNewArtist',
],
});
......@@ -6,7 +6,6 @@ import UploadImage from '../../upload-image/index.vue';
export default defineComponent({
props: {
id: { type: Number, required: true },
artistCode: { type: String, required: true },
avatar: { type: String, required: true },
fullName: { type: String, required: true },
......@@ -37,6 +36,17 @@ export default defineComponent({
UploadImage,
},
setup() {
const selectedFile = (value: FileList) => {
console.log(value);
console.log(URL.createObjectURL(value[0]));
};
const upload = ref(null);
const uploadBanner = () => {
// eslint-disable-next-line
// @ts-ignore
// eslint-disable-next-line
upload.value?.click();
};
const artistCodeRules = [
(val?: string) =>
(val && val.trim().length) ||
......@@ -126,18 +136,6 @@ export default defineComponent({
'artist.artistInformation.validateMessages.requireArtistLevel'
),
];
const selectedFile = (value: FileList) => {
console.log(value);
console.log(URL.createObjectURL(value[0]));
};
const upload = ref(null);
const uploadBanner = () => {
// eslint-disable-next-line
// @ts-ignore
// eslint-disable-next-line
upload.value?.click();
};
return {
artistCodeRules,
fullNameRules,
......
......@@ -104,6 +104,7 @@
@addNewBankAccount="addAccBank"
@click:CloseBtn="isOpenAddAccountBankDialog = false"
></AddNewBankAccountDialog>
<EditBankAccountDialog
v-model:is-open-edit-account-bank-dialog="isOpenEditAccountBankDialog"
:card-bank-options="cardBankOptions"
......@@ -114,18 +115,21 @@
@editBankAccount="editAccBank"
@click:CloseBtn="isOpenEditAccountBankDialog = false"
></EditBankAccountDialog>
<UploadEmbedDialog
v-model:is-open-dialog-embed="isOpenDialogEmbed"
v-model:social-embedded="socialEmbedded"
@uploadEmbed="isOpenDialogEmbed = false"
@click:CloseBtn="isOpenDialogEmbed = false"
></UploadEmbedDialog>
<AddHotProductDialog
@insertData="pushData"
v-model:status-hot-product="statusHotProduct"
v-model:open-add-hot-product="openAddHotProduct"
@click:CloseBtnAddHotProduct="openAddHotProduct = false"
></AddHotProductDialog>
<UpdateHotProduct
:dataUpdate="DataUpdateHotProduct"
@UpdateData="UpdateData($event)"
......@@ -155,5 +159,4 @@
</div>
</div>
</template>
<script lang="ts" src="./updateInformationArtist.ts"></script>
......@@ -125,7 +125,7 @@ export default defineComponent({
// avatar.value = ArtistInformation.avatar
avatar.value =
'https://lh3.googleusercontent.com/proxy/cL5mHGDvQFU8xR-Gn60kKHN9otMevrqQ0wRv3_fEQi4030JNccyLBSBmJoyL3KOYhObYR5WPnRZr8FwphGhYenMklss0tYuiIzhE2BrnNeUJJ76_ztQizomVS3RsPP8';
'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;
......
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