fix: hide ImageUploadDialog footer

This commit is contained in:
puriphatt 2024-08-05 07:13:46 +00:00
parent 693c2fcb9a
commit 30787ff473
2 changed files with 13 additions and 5 deletions

View file

@ -359,6 +359,7 @@ function clearData() {
}
async function undo() {
isImageEdit.value = false;
formType.value = 'view';
imageUrl.value = prevImageUrl.value;
formData.value = prevFormData.value;
@ -390,6 +391,7 @@ function triggerCreate(
}
function drawerEdit() {
isImageEdit.value = true;
formType.value = 'edit';
prevFormData.value = {
...formData.value,

View file

@ -378,6 +378,7 @@ async function openDialog(
function undo() {
if (!infoPersonId.value) return;
isImageEdit.value = false;
infoDrawerEdit.value = false;
assignFormData(infoPersonId.value);
}
@ -396,6 +397,7 @@ function onClose() {
infoDrawer.value = false;
profileSubmit.value = false;
statusToggle.value = true;
isImageEdit.value = false;
Object.assign(formData.value, defaultFormData);
mapUserType(selectorLabel.value);
flowStore.rotate();
@ -624,9 +626,7 @@ async function assignFormData(idEdit: string) {
}
}
function openImageDialog(isEdit?: boolean) {
if (isEdit) isImageEdit.value = true;
else isImageEdit.value = false;
function openImageDialog() {
imageDialog.value = true;
}
@ -1532,7 +1532,11 @@ watch(
:submit="() => onSubmit()"
:close="() => onClose()"
:undo="() => undo()"
:editData="() => (infoDrawerEdit = true)"
:editData="
() => {
(infoDrawerEdit = true), (isImageEdit = true);
}
"
>
<InfoForm
:readonly="!infoDrawerEdit"
@ -1846,8 +1850,10 @@ watch(
}`"
>
<q-img
v-if="!modal"
v-if="infoDrawer"
fit="contain"
:src="`/no-img-${formData.gender === 'male' ? 'man' : 'female'}.png`"
style="height: 100%"
/>
<q-icon
v-else