Explorar o código

查看附件名称处理

duy %!s(int64=2) %!d(string=hai) anos
pai
achega
b28bf8d41b
Modificáronse 1 ficheiros con 8 adicións e 3 borrados
  1. 8 3
      src/views/tentative/detect/test.vue

+ 8 - 3
src/views/tentative/detect/test.vue

@@ -580,6 +580,11 @@ const viewAttachmentModalClose = () => {
 const uploadData = ref({})
 const fileListData=ref([])
 const listuploadref=ref('1')
+//截取文件名称
+const splitFileName=(str)=>{
+    let a=str.split('//')[2].split('/')[2]
+    return a
+}
 //查看当前文件pdf
 const viewCurFile = (item) => {
     curFileData.value=item
@@ -592,17 +597,17 @@ const viewCurFile = (item) => {
     })
     if(tabTypeKey.value=='productionCertificate'&&item.productionCertificate.length>0){
         let arr=[]
-        arr.push({name:item.productionCertificateName,url:item.productionCertificate})
+        arr.push({name:splitFileName(item.productionCertificateName),url:item.productionCertificate})
         fileListData.value =getArrValue(arr)
         listuploadref.value='1'
     }else if(tabTypeKey.value=='qualityInspectionReport'&&item.qualityInspectionReport.length>0){
          let arr=[]
-         arr.push({name:item.qualityInspectionReportName,url:item.qualityInspectionReport})
+         arr.push({name:splitFileName(item.qualityInspectionReportName),url:item.qualityInspectionReport})
          fileListData.value =getArrValue(arr)
          listuploadref.value='2'
     }else if(tabTypeKey.value=='otherAccessories'&&item.otherAccessories.length>0){
           let arr=[]
-        arr.push({name:item.otherAccessoriesName,url:item.otherAccessories})
+        arr.push({name:splitFileName(item.otherAccessoriesName),url:item.otherAccessories})
          fileListData.value =getArrValue(arr)
          listuploadref.value='3'
     }else{