Commit 0c261995 authored by Tình Trương's avatar Tình Trương

update

parent 8d1d8147
...@@ -30,77 +30,79 @@ ...@@ -30,77 +30,79 @@
style="max-height: calc(100vh - 10rem)" style="max-height: calc(100vh - 10rem)"
> >
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12"> <div class="col-6">
<div class="row flex-center"> <div class="row flex-center">
<div> <div>
<q-card style="margin-bottom: 8px" v-if="image !== null"> <q-card class="q-mb-sm" v-if="image !== null">
<q-img <q-img
:src="image"
style="height: 268px; width: 350px"
@click="uploadAvatar" @click="uploadAvatar"
> :src="image"
</q-img> style="height: 380px; width: 350px; cursor: pointer"
></q-img>
<q-icon <q-icon
name="mdi-close-circle" name="mdi-close-circle"
color="red" color="red"
style="position: absolute; right: 0; font-size: 18px" style="
position: absolute;
right: 0;
font-size: 18px;
cursor: pointer;
"
@click="deleteAvatar" @click="deleteAvatar"
></q-icon> ></q-icon>
</q-card> </q-card>
<q-card v-else style="margin-bottom: 8px"> <div
<q-img @click="uploadAvatar"
src="~/assets/noavatar.png" v-else
style="height: 268px; width: 350px" class="q-mb-sm"
></q-img> style="
</q-card> height: 380px;
width: 350px;
<q-card @click="uploadAvatar"> border: 2px dashed #5d319e;
<div align="center" class="flex flex-center q-py-xs"> border-radius: 4px;
cursor: pointer;
"
>
<div
style="
height: 380px;
width: 350px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
"
>
<q-icon <q-icon
style="color: #5d319e" style="color: #5d319e"
name="mdi-plus-circle-outline" name="mdi-cloud-upload"
:size="'xs'" size="xl"
></q-icon> ></q-icon>
<div class="q-mt-xs"> Tải ảnh lên
{{ $t('post.uploadImg') }}
</div>
</div> </div>
</div>
<div>
<input <input
ref="upload" ref="upload"
hidden hidden
type="file"
@change="selectedFile($event.target.files)" @change="selectedFile($event.target.files)"
type="file"
accept="image/png, image/jpeg" accept="image/png, image/jpeg"
/> />
</q-card> </div>
</div> </div>
</div> </div>
</div>
<div class="q-ml-md q-mt-lg q-mr-md"> <div class="col-6">
<q-select
:model-value="category"
@update:model-value="$emit('update:category', $event)"
:label="$t('post.dialogLabel.postLabels.category')"
:rules="categoryRules"
:options="categoryOptions"
map-options
option-value="id"
option-label="name"
type="text"
class="q-my-sm"
outlined
></q-select>
</div>
<q-tabs <q-tabs
v-model="tab" v-model="tab"
dense dense
class="text-grey" align="left"
active-color="primary" active-color="primary"
indicator-color="primary" indicator-color="primary"
align="left"
narrow-indicator narrow-indicator
:breakpoint="0"
> >
<q-tab <q-tab
v-for="(info, index) in languageOptions" v-for="(info, index) in languageOptions"
...@@ -116,23 +118,49 @@ ...@@ -116,23 +118,49 @@
v-for="(info, index) in languageOptions" v-for="(info, index) in languageOptions"
:key="`${info.language.id}-${index}`" :key="`${info.language.id}-${index}`"
:name="info.language.code" :name="info.language.code"
class="q-pt-none; q-pa-none"
> >
<q-input <q-input
v-model="info.name" v-model="info.name"
:label="$t('post.dialogLabel.postLabels.name')" :label="$t('post.dialogLabel.postLabels.name')"
type="text" type="text"
class="q-my-sm"
outlined outlined
lazy-rules
:rules="nameRules" :rules="nameRules"
clearable clearable
></q-input> ></q-input>
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
<q-select
:model-value="category"
@update:model-value="$emit('update:category', $event)"
:label="$t('post.dialogLabel.postLabels.category')"
:rules="categoryRules"
:options="categoryOptions"
map-options
class="q-py-sm"
option-value="id"
option-label="name"
type="text"
outlined
></q-select>
<div class="q-pt-md">
<span class="text-body1">{{
$t('post.dialogLabel.postLabels.status')
}}</span
><q-toggle
:model-value="status"
:true-value="1"
:false-value="2"
@update:model-value="$emit('update:status', $event)"
/>
</div>
</div>
<div class="col-12 q-mt-md">
<q-tabs <q-tabs
v-model="tabContent" v-model="tabContent"
dense dense
class="text-grey"
active-color="primary" active-color="primary"
indicator-color="primary" indicator-color="primary"
align="left" align="left"
...@@ -148,12 +176,12 @@ ...@@ -148,12 +176,12 @@
</q-tabs> </q-tabs>
<q-separator /> <q-separator />
<q-tab-panels v-model="tabContent" animated> <q-tab-panels v-model="tabContent" animated>
<q-tab-panel <q-tab-panel
v-for="(info, index) in languageOptions" v-for="(info, index) in languageOptions"
:key="`${info.language.id}-${index}`" :key="`${info.language.id}-${index}`"
:name="info.language.code" :name="info.language.code"
class="q-pt-none; q-pa-none"
> >
<q-editor <q-editor
v-model="info.content" v-model="info.content"
...@@ -252,18 +280,6 @@ ...@@ -252,18 +280,6 @@
/> />
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
<div class="q-pl-md">
<span class="text-body1">{{
$t('post.dialogLabel.postLabels.status')
}}</span
><q-toggle
:model-value="status"
:true-value="1"
:false-value="2"
@update:model-value="$emit('update:status', $event)"
/>
</div>
</div> </div>
</div> </div>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</div> </div>
<div class="col-12 q-mt-sm"> <div class="col-12 q-mt-sm">
<div class="row q-col-gutter-lg"> <div class="row q-col-gutter-lg">
<div class="col-6" style="height: 100%"> <div class="col-6">
<q-carousel <q-carousel
v-if="banners.length" v-if="banners.length"
v-model="slide" v-model="slide"
...@@ -79,8 +79,7 @@ ...@@ -79,8 +79,7 @@
</q-carousel-slide> </q-carousel-slide>
</q-carousel> </q-carousel>
<UploadImage <UploadImage
v-if="banners.length" v-if="banners.length !== null"
class="q-mt-sm"
:isBtn="true" :isBtn="true"
@selectedFile="uploadBanner" @selectedFile="uploadBanner"
></UploadImage> ></UploadImage>
...@@ -178,12 +177,7 @@ ...@@ -178,12 +177,7 @@
</div> </div>
</div> </div>
<div class="col-12 q-mt-sm"> <div class="col-12 q-mt-sm">
<div <div class="row q-col-gutter-lg q-pb-md" align="center" justify="center">
class="row q-col-gutter-lg"
style="margin-bottom: 111px"
align="center"
justify="center"
>
<div class="col-4"> <div class="col-4">
<div class="flex flex-center"> <div class="flex flex-center">
<div class="text-h6 text-weight-regular q-py-md"> <div class="text-h6 text-weight-regular q-py-md">
...@@ -214,7 +208,7 @@ ...@@ -214,7 +208,7 @@
<div <div
@click="$emit('openDialogUploadEmbed')" @click="$emit('openDialogUploadEmbed')"
class="flex flex-center" class="flex flex-center"
:style="socialEmbedded !== null ? 'height: 100%;' : 'height: 100%'" :style="socialEmbedded !== null ? 'height: 85%;' : 'height: 85%'"
> >
<iframe <iframe
v-if="socialEmbedded !== null" v-if="socialEmbedded !== null"
...@@ -231,6 +225,7 @@ ...@@ -231,6 +225,7 @@
border: 2px dashed #5d319e; border: 2px dashed #5d319e;
border-radius: 5px; border-radius: 5px;
cursor: pointer; cursor: pointer;
flex-direction: column;
" "
class="flex flex-center" class="flex flex-center"
> >
...@@ -261,7 +256,7 @@ ...@@ -261,7 +256,7 @@
</div> </div>
<div <div
class="flex flex-center" class="flex flex-center"
:style="stories.length ? 'height: 100%' : 'height: 100%;'" :style="stories.length ? 'height: 85%' : 'height: 85%;'"
bordered bordered
v-if="!stories.length" v-if="!stories.length"
> >
...@@ -275,6 +270,7 @@ ...@@ -275,6 +270,7 @@
border: 2px dashed #5d319e; border: 2px dashed #5d319e;
border-radius: 5px; border-radius: 5px;
cursor: pointer; cursor: pointer;
flex-direction: column;
" "
> >
<q-icon <q-icon
...@@ -318,14 +314,14 @@ ...@@ -318,14 +314,14 @@
" "
@click="deleteStory(storyIdx)" @click="deleteStory(storyIdx)"
></q-icon> ></q-icon>
<q-input
type="textarea"
class="q-px-sm"
:model-value="story.content"
@update:model-value="$emit('update:content', $event)"
readonly
></q-input>
</div> </div>
<q-input
type="textarea"
class="q-px-sm"
:model-value="story.content"
@update:model-value="$emit('update:content', $event)"
readonly
></q-input>
</q-carousel-slide> </q-carousel-slide>
</q-carousel> </q-carousel>
</div> </div>
...@@ -333,7 +329,7 @@ ...@@ -333,7 +329,7 @@
<div class="col-4"> <div class="col-4">
<div class="text-h6 text-weight-regular q-py-md">Lịch</div> <div class="text-h6 text-weight-regular q-py-md">Lịch</div>
<q-date <q-date
style="width: 100%; height: 100%" style="width: 100%; height: 85%"
:model-value="formatSchedules" :model-value="formatSchedules"
@update:model-value="$emit('update:formatSchedules', $event)" @update:model-value="$emit('update:formatSchedules', $event)"
multiple multiple
......
...@@ -5,6 +5,7 @@ import moment from 'moment'; ...@@ -5,6 +5,7 @@ import moment from 'moment';
import { FieldType, NationalityType } from 'src/assets/type'; import { FieldType, NationalityType } from 'src/assets/type';
export default defineComponent({ export default defineComponent({
props: { props: {
hidden_img: { type: Boolean, required: true },
id: { type: Number, required: true }, id: { type: Number, required: true },
artistCode: { type: String, required: true }, artistCode: { type: String, required: true },
avatar: { type: String, required: true }, avatar: { type: String, required: true },
...@@ -59,10 +60,13 @@ export default defineComponent({ ...@@ -59,10 +60,13 @@ export default defineComponent({
setup(_, context) { setup(_, context) {
const BirthdayDatePicker = ref(moment().format('YYYY/MM/DD')); const BirthdayDatePicker = ref(moment().format('YYYY/MM/DD'));
const selectedFile = (value: FileList) => { const selectedFile = (value: FileList) => {
context.emit('SetAvatar', { if (value.length !== 0) {
file: value[0], context.emit('SetAvatar', {
url: URL.createObjectURL(value[0]), file: value[0],
}); url: URL.createObjectURL(value[0]),
});
context.emit('update:hidden_img', false);
}
}; };
const upload = ref(null); const upload = ref(null);
...@@ -170,6 +174,7 @@ export default defineComponent({ ...@@ -170,6 +174,7 @@ export default defineComponent({
'update:works', 'update:works',
'update:qualification', 'update:qualification',
'update:artistLevel', 'update:artistLevel',
'update:hidden_img',
'update:status', 'update:status',
'addNewArtist', 'addNewArtist',
'SetAvatar', 'SetAvatar',
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<q-img <q-img
@click="uploadBanner" @click="uploadBanner"
:src="avatar" :src="avatar"
style="height: 265px; width: 195px; cursor: pointer" style="height: 263px; width: 195px; cursor: pointer"
></q-img> ></q-img>
<q-icon <q-icon
name="mdi-close-circle" name="mdi-close-circle"
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
v-else v-else
class="q-mb-sm" class="q-mb-sm"
style=" style="
height: 265px; height: 263px;
width: 195px; width: 195px;
border: 2px dashed #5d319e; border: 2px dashed #5d319e;
border-radius: 4px; border-radius: 4px;
...@@ -54,24 +54,23 @@ ...@@ -54,24 +54,23 @@
></q-icon> ></q-icon>
Tải ảnh lên Tải ảnh lên
</div> </div>
<q-img
@click="uploadBanner"
style="height: 265px; width: 195px"
></q-img>
</div> </div>
<div> <div>
<input <input
ref="upload" ref="upload"
hidden hidden
@change="selectedFile($event.target.files)"
type="file" type="file"
accept="image/png, image/jpeg" accept="image/png, image/jpeg"
@change="selectedFile($event.target.files)"
/> />
</div> </div>
<div v-if="hidden_img" style="color: #c10015; font-size: 12px">
Không được để trống
</div>
</div> </div>
</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.artistCode') }} {{ $t('artist.artistInformation.titleDataField.artistCode') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -83,13 +82,14 @@ ...@@ -83,13 +82,14 @@
@update:model-value="$emit('update:artistCode', $event)" @update:model-value="$emit('update:artistCode', $event)"
:error="artistCodeRules" :error="artistCodeRules"
:error-message="errorMessArtistCode" :error-message="errorMessArtistCode"
class="q-my-sm"
outlined outlined
dense dense
hide-bottom-space hide-bottom-space
></q-input> ></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.fullName') }} {{ $t('artist.artistInformation.titleDataField.fullName') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -100,13 +100,14 @@ ...@@ -100,13 +100,14 @@
@update:model-value="$emit('update:fullName', $event)" @update:model-value="$emit('update:fullName', $event)"
:error="fullNameRules" :error="fullNameRules"
:error-message="errorMessFullName" :error-message="errorMessFullName"
class="q-my-sm"
outlined outlined
dense dense
hide-bottom-space hide-bottom-space
></q-input> ></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.artistName') }} {{ $t('artist.artistInformation.titleDataField.artistName') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -117,13 +118,14 @@ ...@@ -117,13 +118,14 @@
@update:model-value="$emit('update:artistName', $event)" @update:model-value="$emit('update:artistName', $event)"
:error="artistNameRules" :error="artistNameRules"
:error-message="errorMessArtistName" :error-message="errorMessArtistName"
class="q-my-sm"
outlined outlined
dense dense
hide-bottom-space hide-bottom-space
></q-input> ></q-input>
</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.birthday') }} {{ $t('artist.artistInformation.titleDataField.birthday') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -207,12 +209,11 @@ ...@@ -207,12 +209,11 @@
class="q-my-sm" class="q-my-sm"
outlined outlined
hide-bottom-space hide-bottom-space
clearable
dense dense
></q-select> ></q-select>
</div> </div>
</div> </div>
<div class="row q-mt-xs q-mb-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.address') }} {{ $t('artist.artistInformation.titleDataField.address') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -225,13 +226,14 @@ ...@@ -225,13 +226,14 @@
:error-message="errorMessAddress" :error-message="errorMessAddress"
outlined outlined
hide-bottom-space hide-bottom-space
class="q-my-sm"
dense dense
></q-input> ></q-input>
</div> </div>
</div> </div>
</div> </div>
<div class="col-5 q-ml-xl"> <div class="col-5 q-ml-xl">
<div class="row q-mt-xs 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.field') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -332,7 +334,7 @@ ...@@ -332,7 +334,7 @@
></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.phoneNumber') }} {{ $t('artist.artistInformation.titleDataField.phoneNumber') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -344,13 +346,14 @@ ...@@ -344,13 +346,14 @@
:error="phoneNumberRules" :error="phoneNumberRules"
:error-message="errorMessPhoneNumber" :error-message="errorMessPhoneNumber"
mask="##########" mask="##########"
class="q-my-sm"
outlined outlined
dense dense
hide-bottom-space hide-bottom-space
></q-input> ></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.email') }} {{ $t('artist.artistInformation.titleDataField.email') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -362,13 +365,14 @@ ...@@ -362,13 +365,14 @@
:error="emailRules" :error="emailRules"
:error-message="errorMessEmail" :error-message="errorMessEmail"
outlined outlined
class="q-my-sm"
dense dense
hide-bottom-space hide-bottom-space
></q-input> ></q-input>
</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.phoneNumberAdminister') $t('artist.artistInformation.titleDataField.phoneNumberAdminister')
...@@ -382,13 +386,14 @@ ...@@ -382,13 +386,14 @@
:error="phoneNumberAdministerRules" :error="phoneNumberAdministerRules"
:error-message="errorMessPhoneNumberAdminister" :error-message="errorMessPhoneNumberAdminister"
mask="##########" mask="##########"
class="q-my-sm"
outlined outlined
dense dense
hide-bottom-space hide-bottom-space
></q-input> ></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.emailAdminister') }} {{ $t('artist.artistInformation.titleDataField.emailAdminister') }}
<span style="color: red">*</span> <span style="color: red">*</span>
...@@ -400,13 +405,14 @@ ...@@ -400,13 +405,14 @@
:error="emailAdministerRules" :error="emailAdministerRules"
:error-message="errorMessEmailAdminister" :error-message="errorMessEmailAdminister"
outlined outlined
class="q-my-sm"
dense dense
hide-bottom-space hide-bottom-space
></q-input> ></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.facebook') }} {{ $t('artist.artistInformation.titleDataField.facebook') }}
</div> </div>
...@@ -415,11 +421,12 @@ ...@@ -415,11 +421,12 @@
:model-value="facebook" :model-value="facebook"
@update:model-value="$emit('update:facebook', $event)" @update:model-value="$emit('update:facebook', $event)"
outlined outlined
class="q-my-sm"
dense dense
></q-input> ></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.facebookMessage') }} {{ $t('artist.artistInformation.titleDataField.facebookMessage') }}
</div> </div>
...@@ -428,11 +435,12 @@ ...@@ -428,11 +435,12 @@
:model-value="facebookMessage" :model-value="facebookMessage"
@update:model-value="$emit('update:facebookMessage', $event)" @update:model-value="$emit('update:facebookMessage', $event)"
outlined outlined
class="q-my-sm"
dense dense
></q-input> ></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.instagram') }} {{ $t('artist.artistInformation.titleDataField.instagram') }}
</div> </div>
...@@ -441,11 +449,12 @@ ...@@ -441,11 +449,12 @@
:model-value="instagram" :model-value="instagram"
@update:model-value="$emit('update:instagram', $event)" @update:model-value="$emit('update:instagram', $event)"
outlined outlined
class="q-my-sm"
dense dense
></q-input> ></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.whatsapp') }} {{ $t('artist.artistInformation.titleDataField.whatsapp') }}
</div> </div>
...@@ -454,6 +463,7 @@ ...@@ -454,6 +463,7 @@
:model-value="whatsapp" :model-value="whatsapp"
@update:model-value="$emit('update:whatsapp', $event)" @update:model-value="$emit('update:whatsapp', $event)"
outlined outlined
class="q-my-sm"
dense dense
></q-input> ></q-input>
</div> </div>
......
...@@ -213,6 +213,7 @@ ...@@ -213,6 +213,7 @@
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<div v-if="check_artistList">Không được để trống</div>
</div> </div>
<!-- ngân hàng --> <!-- ngân hàng -->
...@@ -502,6 +503,7 @@ export default defineComponent({ ...@@ -502,6 +503,7 @@ export default defineComponent({
type: Boolean, type: Boolean,
required: true, required: true,
}, },
check_artistList: { type: Boolean, required: true },
isUpdate: { type: Boolean, default: false }, isUpdate: { type: Boolean, default: false },
fieldsOptions: { type: Array, required: true }, fieldsOptions: { type: Array, required: true },
fields: { type: Number, required: true }, fields: { type: Number, required: true },
...@@ -846,6 +848,7 @@ export default defineComponent({ ...@@ -846,6 +848,7 @@ export default defineComponent({
'update:address', 'update:address',
'update:status', 'update:status',
'update:artistList', 'update:artistList',
'update:check_artistList',
'addNewUnit', 'addNewUnit',
], ],
}); });
......
<template> <template>
<q-card @click="uploadBanner"> <div @click="uploadBanner">
<div <div
align="center" style="
:class="{ border: 2px dashed #5d319e;
'full-height full-width flex flex-center ': isBtn, border-radius: 5px;
}" cursor: pointer;
flex-direction: column;
"
class="flex flex-center"
> >
<q-icon <q-icon
style="color: #5d319e" style="color: #5d319e"
name="mdi-cloud-upload" name="mdi-cloud-upload"
:size="isBtn ? 'md' : 'md'" :size="isBtn ? 'md' : 'md'"
></q-icon> ></q-icon>
<span>{{ $t('uploadImage.uploadBanner') }}</span> <span>Tải lên ảnh bìa</span>
</div> </div>
<input <input
ref="upload" ref="upload"
...@@ -20,7 +23,7 @@ ...@@ -20,7 +23,7 @@
accept="image/png, image/jpeg" accept="image/png, image/jpeg"
@change="$emit('selectedFile', $event.target.files)" @change="$emit('selectedFile', $event.target.files)"
/> />
</q-card> </div>
</template> </template>
<script lang="ts" src="./UploadImage.ts"></script> <script lang="ts" src="./UploadImage.ts"></script>
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
</div> </div>
<AddUpdatePostDialog <AddUpdatePostDialog
v-if="addPostDialogIsOpened"
v-model:isOpened="addPostDialogIsOpened" v-model:isOpened="addPostDialogIsOpened"
v-model:name="name" v-model:name="name"
v-model:category="category" v-model:category="category"
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
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"
v-model:hidden_img="hidden_img"
:errorMessPhoneNumber="errorMessPhoneNumber" :errorMessPhoneNumber="errorMessPhoneNumber"
:errorMessEmail="errorMessEmail" :errorMessEmail="errorMessEmail"
:errorMessPhoneNumberAdminister="errorMessPhoneNumberAdminister" :errorMessPhoneNumberAdminister="errorMessPhoneNumberAdminister"
......
...@@ -119,6 +119,7 @@ export default defineComponent({ ...@@ -119,6 +119,7 @@ export default defineComponent({
const facebookMessage: Ref<string | null | undefined> = ref(); const facebookMessage: Ref<string | null | undefined> = ref();
const instagram: Ref<string | null | undefined> = ref(); const instagram: Ref<string | null | undefined> = ref();
const whatsapp: Ref<string | null | undefined> = ref(); const whatsapp: Ref<string | null | undefined> = ref();
const hidden_img = ref(false);
// 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([]);
...@@ -654,6 +655,10 @@ export default defineComponent({ ...@@ -654,6 +655,10 @@ export default defineComponent({
const checkValidate = () => { const checkValidate = () => {
let hasError = false; let hasError = false;
if (!avatarFile.value) {
hasError = true;
hidden_img.value = true;
}
if (!artistCode.value || !artistCode.value?.trim().length) { if (!artistCode.value || !artistCode.value?.trim().length) {
hasError = true; hasError = true;
artistCodeRules.value = true; artistCodeRules.value = true;
...@@ -856,6 +861,7 @@ export default defineComponent({ ...@@ -856,6 +861,7 @@ export default defineComponent({
void getTypeCardOptions(); void getTypeCardOptions();
}); });
return { return {
hidden_img,
tab, tab,
getInformationArtist, getInformationArtist,
id, id,
......
...@@ -142,6 +142,7 @@ ...@@ -142,6 +142,7 @@
v-model:representative="unitRepresentative" v-model:representative="unitRepresentative"
v-model:status="unitStatus" v-model:status="unitStatus"
v-model:artistList="unitArtistList" v-model:artistList="unitArtistList"
v-model:check_artistList="check_artistList"
isUpdate isUpdate
@addNewUnit="addNewUnit" @addNewUnit="addNewUnit"
/> />
...@@ -158,6 +159,7 @@ ...@@ -158,6 +159,7 @@
v-model:representative="unitRepresentative" v-model:representative="unitRepresentative"
v-model:status="unitStatus" v-model:status="unitStatus"
v-model:artistList="unitArtistList" v-model:artistList="unitArtistList"
v-model:check_artistList="check_artistList"
@addNewUnit="updateNewUnit" @addNewUnit="updateNewUnit"
/> />
</div> </div>
...@@ -291,6 +293,7 @@ export default defineComponent({ ...@@ -291,6 +293,7 @@ export default defineComponent({
const unitStatus: Ref<number> = ref(UnitStatus.active); const unitStatus: Ref<number> = ref(UnitStatus.active);
const unitArtistList: Ref<unknown[]> = ref([]); const unitArtistList: Ref<unknown[]> = ref([]);
const unitId: Ref<number | undefined> = ref(undefined); const unitId: Ref<number | undefined> = ref(undefined);
const check_artistList = ref(false);
const getListUnits = async () => { const getListUnits = async () => {
try { try {
...@@ -443,32 +446,39 @@ export default defineComponent({ ...@@ -443,32 +446,39 @@ export default defineComponent({
//add //add
const addNewUnit = async () => { const addNewUnit = async () => {
const data = { let hasError = false;
name: unitName.value, if (unitArtistList.value.length !== 0) {
code: unitCode.value, hasError = true;
representative: unitRepresentative.value, check_artistList.value = true;
address: unitAddress.value, }
email: unitEmail.value, if (hasError === false) {
phoneNumber: unitPhoneNumber.value, const data = {
status: unitStatus.value, name: unitName.value,
fields: unitField.value, code: unitCode.value,
contracts: unitArtistList.value, representative: unitRepresentative.value,
}; address: unitAddress.value,
const response = (await api({ email: unitEmail.value,
url: API_PATHS.artistOwnerAdd, phoneNumber: unitPhoneNumber.value,
method: 'POST', status: unitStatus.value,
data, fields: unitField.value,
})) as AxiosResponse<BaseResponseBody<ArtistOwnerAdd[]>>; contracts: unitArtistList.value,
if (response.data.error.code === config.API_RES_CODE.OK.code) { };
addUnitDialogIsOpened.value = false; const response = (await api({
Notify.create({ url: API_PATHS.artistOwnerAdd,
type: 'positive', method: 'POST',
message: i18n.global.t( data,
'managingUnit.actionMessages.addNewManagingUnitsAccess' })) as AxiosResponse<BaseResponseBody<ArtistOwnerAdd[]>>;
), if (response.data.error.code === config.API_RES_CODE.OK.code) {
actions: [{ icon: 'close', color: 'white' }], addUnitDialogIsOpened.value = false;
}); Notify.create({
void getListUnits(); type: 'positive',
message: i18n.global.t(
'managingUnit.actionMessages.addNewManagingUnitsAccess'
),
actions: [{ icon: 'close', color: 'white' }],
});
void getListUnits();
}
} }
}; };
...@@ -477,6 +487,7 @@ export default defineComponent({ ...@@ -477,6 +487,7 @@ export default defineComponent({
void getFieldOptions(); void getFieldOptions();
}); });
return { return {
check_artistList,
getDetailUnit, getDetailUnit,
addUnitDialogIsOpened, addUnitDialogIsOpened,
updateUnitDialogIsOpened, updateUnitDialogIsOpened,
......
...@@ -117,6 +117,7 @@ export default defineComponent({ ...@@ -117,6 +117,7 @@ export default defineComponent({
const facebookMessage: Ref<string | null | undefined> = ref(); const facebookMessage: Ref<string | null | undefined> = ref();
const instagram: Ref<string | null | undefined> = ref(); const instagram: Ref<string | null | undefined> = ref();
const whatsapp: Ref<string | null | undefined> = ref(); const whatsapp: Ref<string | null | undefined> = ref();
const hidden_img = ref(false);
// 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([]);
...@@ -590,6 +591,10 @@ export default defineComponent({ ...@@ -590,6 +591,10 @@ export default defineComponent({
}; };
const checkValidate = () => { const checkValidate = () => {
let hasError = false; let hasError = false;
if (!avatarFile.value) {
hasError = true;
hidden_img.value = true;
}
if (!artistCode.value || !artistCode.value?.trim().length) { if (!artistCode.value || !artistCode.value?.trim().length) {
hasError = true; hasError = true;
artistCodeRules.value = true; artistCodeRules.value = true;
...@@ -766,6 +771,7 @@ export default defineComponent({ ...@@ -766,6 +771,7 @@ export default defineComponent({
const deleteAvatar = () => { const deleteAvatar = () => {
avatar.value = null; avatar.value = null;
avatarFile.value = null;
}; };
const confirmChangeIsDefault = (item: changeIsDefault) => { const confirmChangeIsDefault = (item: changeIsDefault) => {
if (item.isDefault === 2) { if (item.isDefault === 2) {
...@@ -782,6 +788,7 @@ export default defineComponent({ ...@@ -782,6 +788,7 @@ export default defineComponent({
void getTypeCardOptions(); void getTypeCardOptions();
}); });
return { return {
hidden_img,
tab, tab,
id, id,
route, route,
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
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"
v-model:hidden_img="hidden_img"
:errorMessPhoneNumber="errorMessPhoneNumber" :errorMessPhoneNumber="errorMessPhoneNumber"
:errorMessEmail="errorMessEmail" :errorMessEmail="errorMessEmail"
:errorMessPhoneNumberAdminister="errorMessPhoneNumberAdminister" :errorMessPhoneNumberAdminister="errorMessPhoneNumberAdminister"
......
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