Browse Source

图片

qin_26
liwenxuan 5 months ago
parent
commit
6c5ab4debb
  1. 29
      src/components/DesignForm/public/expand/lowcodeImage.vue

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

@ -67,6 +67,7 @@ const value = computed({
get: () => {
if (props.data.control.imgUrl == "") {
return props.modelValue ? props.modelValue : errimg;
//return props.modelValue ? props.modelValue : '';
} else {
return props.data.control.imgUrl;
}
@ -99,21 +100,27 @@ onMounted(()=>{
} */
}else{
if(props.type==2&&hasELCard(ancestors)){
if(value.value=="/src/assets/404_images/imgNotFound.png"){
}else{
props.data.control.uploadedImgs = completionImageDetails(value.value)
if(props.data.control.useDefaultImg==false&&props.data.control.onSiteShot==""){
toShow.value = true
}
}
}
},1000)
}
},100)
})
function completionImageDetails(urlString:string) {
// URL
const urls = urlString.split(',').map(url => url.trim()).filter(url => url);
//console.log(urls)
if (urls.length === 0) {
/* throw new Error('未提供有效的图片URL'); */
return {}
}
@ -131,7 +138,9 @@ function completionImageDetails(urlString:string) {
// 18ID
const randomId = Math.floor(Math.random() * 9e17) + 1e17;
if(url=="/src/assets/404_images/imgNotFound.png"){
return {}
}else{
return {
name: fileName,
percentage: 100,
@ -151,6 +160,10 @@ function completionImageDetails(urlString:string) {
msg: "成功!"
}
};
}
});
}
@ -287,7 +300,15 @@ function selectFile(){
</script>
<template>
<img
v-if="props.data.control.useDefaultImg&&props.type==4"
:src="props.modelValue"
class="avatar"
:style="getFormItemInputStyle(configStyle, 2)"
/>
<el-upload
v-if="props.type!=4"
v-bind="$props"
class="upload-demo"
:action="uploadUrl"
@ -403,7 +424,7 @@ function selectFile(){
<el-dialog v-model="dialogVisible">
<el-dialog v-model="dialogVisible" style="width:90%">
<img w-full :src="dialogImageUrl" alt="Preview Image" />
</el-dialog>
</template>

Loading…
Cancel
Save