2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 23:00:56 +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>
<div
class="
relative
bg-white
border
rounded-full
flex-center
overflow-hidden
group
"
class="relative bg-white border flex-center overflow-hidden group"
:class="{
'w-20 h-20': size !== 'small',
'w-12 h-12': size === 'small',
'rounded': size === 'form',
'w-20 h-20 rounded-full': size !== 'small' && size !== 'form',
'w-12 h-12 rounded-full': size === 'small',
}"
:title="df?.label"
:style="imageSizeStyle"
>
<img :src="value" v-if="value" />
<div :class="[!isReadOnly ? 'group-hover:opacity-90' : '']" v-else>
@ -113,6 +107,12 @@ export default defineComponent({
},
},
computed: {
imageSizeStyle() {
if (this.size === 'form') {
return { width: '135px', height: '135px' };
}
return {};
},
shouldClear() {
return !!this.value;
},

View File

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