Merge pull request 'fix : 修复文件不能预览时的提示' (#751) from de into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/751
This commit is contained in:
2024-09-07 10:23:07 +00:00

View File

@@ -14,6 +14,8 @@
</template>
<script setup>
import {ElNotification} from "element-plus";
const emit = defineEmits(["update:fileUrl"])
const props = defineProps({
fileUrl: {
@@ -35,14 +37,20 @@ const props = defineProps({
}
})
const showPreview = ref(true)
const checkImgType=(fileType)=>{
if(fileType=='png'||fileType=='jpg'||fileType=='jpeg'||fileType=='ico'||fileType=='PNG'||fileType=='JPG'){
return true
}else {
return false
}
}
console.info("🚀 ~method:fileType -----", props.fileType)
const checkImgType=(fileType)=>{
return fileType == 'png' || fileType == 'jpg' || fileType == 'jpeg' || fileType == 'ico' || fileType == 'PNG' || fileType == 'JPG';
}
console.info("🚀 ~method:checkImgType(props.fileType) -----", checkImgType(props.fileType))
if(props.fileType!=='pdf'&&props.fileType!=='docx'&&!checkImgType(props.fileType)){
showPreview.value=false
ElNotification({
title: '提示',
message: props.fileName+' 文件不支持预览!',
type: 'error'
})
}
</script>
<style lang="scss">