Browse Source

图片fit

qin_26
liwenxuan 3 months ago
parent
commit
163dfa86be
  1. 4
      src/components/DesignForm/designLayout/pageSize.vue
  2. 22
      src/components/DesignForm/public/expand/lowcodeImage.vue

4
src/components/DesignForm/designLayout/pageSize.vue

@ -101,8 +101,8 @@ const objectFitOptions = [
label:"contain-包含",
},
{
value:"vover",
label:"vover-原始比例填充",
value:"cover",
label:"cover-原始比例填充",
},
{
value:"none",

22
src/components/DesignForm/public/expand/lowcodeImage.vue

@ -297,28 +297,41 @@ function selectFile(){
//fileUpload.handleStart();
fileUpload.value.$el.querySelector('input[type="file"]').click();
}
//const fit = props.data.styles.divStyle.objectFit!=undefined ? props.data.styles.divStyle.objectFit : 'fill'
const fit = computed(()=>{
if(props.data.styles.divStyle&&props.data.styles.divStyle.objectFit){
return props.data.styles.divStyle.objectFit
}else{
return 'fill'
}
})
</script>
<template>
<img
<el-image
v-if="(!hasELCard(ancestors))&&props.data.control.useDefaultImg&&props.type==5"
:src="value"
class="avatar"
:style="getFormItemInputStyle(configStyle, 2)"
:fit="fit"
/>
<img
<el-image
v-if="props.data.control.useDefaultImg&&props.type==4"
:src="props.modelValue"
class="avatar"
:style="getFormItemInputStyle(configStyle, 2)"
:fit="fit"
/>
<img
<el-image
v-if="props.data.control.useDefaultImg&&props.type!=4&&props.type!=5&&props.data.control.defaultAllowsChange=='0'"
:src="props.modelValue"
class="avatar"
:style="getFormItemInputStyle(configStyle, 2)"
:fit="fit"
/>
<el-upload
@ -331,11 +344,12 @@ function selectFile(){
:before-upload="beforeAvatarUpload"
v-loading="imgLoading"
>
<img
<el-image
v-if="props.data.control.useDefaultImg"
:src="props.modelValue"
class="avatar"
:style="getFormItemInputStyle(configStyle, 2)"
:fit="fit"
/>
</el-upload>
<!-- <img referrerpolicy="no-referrer" :src="url" :style="styleObject" :fit="fit" :class="[boderAndShadowClassIsActive ? boderAndShadowClass : '', radiusClassIsActive ? radiusClass : '',mp, floatFlag ? floatStyle : '']" /> -->

Loading…
Cancel
Save