2
0
mirror of https://github.com/frappe/books.git synced 2024-11-12 16:36:27 +00:00

fix(ui): Square AttachImage with 2 row span

This commit is contained in:
18alantom 2023-04-14 13:53:35 +05:30
parent c5c01c52bf
commit c158ae8100
2 changed files with 13 additions and 11 deletions

View File

@ -1,19 +1,13 @@
<template> <template>
<div <div
class=" class="relative bg-white border flex-center overflow-hidden group"
relative
bg-white
border
rounded-full
flex-center
overflow-hidden
group
"
:class="{ :class="{
'w-20 h-20': size !== 'small', 'rounded': size === 'form',
'w-12 h-12': size === 'small', 'w-20 h-20 rounded-full': size !== 'small' && size !== 'form',
'w-12 h-12 rounded-full': size === 'small',
}" }"
:title="df?.label" :title="df?.label"
:style="imageSizeStyle"
> >
<img :src="value" v-if="value" /> <img :src="value" v-if="value" />
<div :class="[!isReadOnly ? 'group-hover:opacity-90' : '']" v-else> <div :class="[!isReadOnly ? 'group-hover:opacity-90' : '']" v-else>
@ -113,6 +107,12 @@ export default defineComponent({
}, },
}, },
computed: { computed: {
imageSizeStyle() {
if (this.size === 'form') {
return { width: '135px', height: '135px' };
}
return {};
},
shouldClear() { shouldClear() {
return !!this.value; return !!this.value;
}, },

View File

@ -21,11 +21,13 @@
:key="field.fieldname" :key="field.fieldname"
:class="[ :class="[
field.fieldtype === 'Table' ? 'col-span-2 text-base' : '', field.fieldtype === 'Table' ? 'col-span-2 text-base' : '',
field.fieldtype === 'AttachImage' ? 'row-span-2' : '',
field.fieldtype === 'Check' ? 'mt-auto' : 'mb-auto', field.fieldtype === 'Check' ? 'mt-auto' : 'mb-auto',
]" ]"
> >
<FormControl <FormControl
:ref="field.fieldname === 'name' ? 'nameField' : 'fields'" :ref="field.fieldname === 'name' ? 'nameField' : 'fields'"
:size="field.fieldtype === 'AttachImage' ? 'form' : undefined"
:show-label="true" :show-label="true"
:border="true" :border="true"
:df="field" :df="field"