diff --git a/src/components/Form/src/components/ErpUpload.vue b/src/components/Form/src/components/ErpUpload.vue index 0c3667f..0182ab1 100644 --- a/src/components/Form/src/components/ErpUpload.vue +++ b/src/components/Form/src/components/ErpUpload.vue @@ -200,7 +200,7 @@ const handlePreview = async (file) => { previewImage.value = file.response?.data?.fileUrl || file.fileUrl; previewVisible.value = true; - previewTitle.value = file.name || file.fileName; + previewTitle.value = file.name || file.fileOrg; }; const handleCancel = () => { diff --git a/src/components/Form/src/components/InputUpload.vue b/src/components/Form/src/components/InputUpload.vue index 1446672..2f56fd3 100644 --- a/src/components/Form/src/components/InputUpload.vue +++ b/src/components/Form/src/components/InputUpload.vue @@ -204,7 +204,9 @@ const handlePreview = async (file) => { const fileUrl = file.response?.data?.fileUrl || file.fileUrl; - const fileFullUrl = fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : location.origin + getAppEnvConfig().VITE_GLOB_API_URL + fileUrl; + const fileName = file.response?.data?.fileOrg || file.fileOrg; + let fileFullUrl = fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : location.origin + getAppEnvConfig().VITE_GLOB_API_URL + fileUrl; + fileFullUrl+="&fullfilename="+fileName; previewFile.value = getAppEnvConfig().VITE_GLOB_UPLOAD_PREVIEW + encodeURIComponent(Base64.encode(fileFullUrl)); previewVisible.value = true; diff --git a/src/components/Form/src/components/Upload.vue b/src/components/Form/src/components/Upload.vue index 938eb74..ec69555 100644 --- a/src/components/Form/src/components/Upload.vue +++ b/src/components/Form/src/components/Upload.vue @@ -342,7 +342,9 @@ const handlePreview = async (file) => { const fileUrl = file.response?.data?.fileUrl || file.fileUrl; - const fileFullUrl = fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : location.origin + getAppEnvConfig().VITE_GLOB_API_URL + fileUrl; + const fileName = file.response?.data?.fileOrg || file.fileOrg; + let fileFullUrl = fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : location.origin + getAppEnvConfig().VITE_GLOB_API_URL + fileUrl; + fileFullUrl+="&fullfilename="+fileName; previewFile.value = getAppEnvConfig().VITE_GLOB_UPLOAD_PREVIEW + encodeURIComponent(Base64.encode(fileFullUrl)); previewVisible.value = true; diff --git a/src/components/Form/src/components/UploadNew.vue b/src/components/Form/src/components/UploadNew.vue index a17c6d7..6341eb3 100644 --- a/src/components/Form/src/components/UploadNew.vue +++ b/src/components/Form/src/components/UploadNew.vue @@ -363,12 +363,11 @@ console.log(fileUrl, 'fileUrl', file) window.open(fileUrl) - // previewFile.value = getAppEnvConfig().VITE_GLOB_UPLOAD_PREVIEW + encodeURIComponent(Base64.encode(fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : getAppEnvConfig().VITE_GLOB_API_URL + fileUrl)); - - // previewVisible.value = true; - // previewTitle.value = file.name || file.fileName; - // console.log(previewFile.value, 99) - // console.log(fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : getAppEnvConfig().VITE_GLOB_API_URL + fileUrl); + const fileUrl = file.response?.data?.fileUrl || file.fileUrl; + const fileName = file.response?.data?.fileOrg || file.fileOrg; + let fileFullUrl = fileUrl.includes('http://') || fileUrl.includes('https://') ? fileUrl : location.origin + getAppEnvConfig().VITE_GLOB_API_URL + fileUrl; + fileFullUrl+="&fullfilename="+fileName; + previewFile.value = getAppEnvConfig().VITE_GLOB_UPLOAD_PREVIEW + encodeURIComponent(Base64.encode(fileFullUrl)); }; const handleCancel = () => {