From 470a3ef06352c3beba93afc06bd9c006b9e0ac34 Mon Sep 17 00:00:00 2001 From: zyn Date: Fri, 13 Jan 2023 14:33:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=A0=87=E5=87=86=E6=B5=81?= =?UTF-8?q?=E7=A8=8B-=E5=8F=91=E5=B8=83-=E9=99=84=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=94=AF=E6=8C=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qbrk-product/common/uploadFile.vue | 186 ++++++++++++++++++ .../creatProcess/qbrk-product/step13.vue | 114 ++++++----- 2 files changed, 256 insertions(+), 44 deletions(-) create mode 100644 src/pages/processCenter/pages/creatProcess/qbrk-product/common/uploadFile.vue diff --git a/src/pages/processCenter/pages/creatProcess/qbrk-product/common/uploadFile.vue b/src/pages/processCenter/pages/creatProcess/qbrk-product/common/uploadFile.vue new file mode 100644 index 000000000..bc559fbdc --- /dev/null +++ b/src/pages/processCenter/pages/creatProcess/qbrk-product/common/uploadFile.vue @@ -0,0 +1,186 @@ + + + + + diff --git a/src/pages/processCenter/pages/creatProcess/qbrk-product/step13.vue b/src/pages/processCenter/pages/creatProcess/qbrk-product/step13.vue index e9b75c5ea..c6982c76b 100644 --- a/src/pages/processCenter/pages/creatProcess/qbrk-product/step13.vue +++ b/src/pages/processCenter/pages/creatProcess/qbrk-product/step13.vue @@ -232,25 +232,37 @@ > - + + + + + + + + + + + + + + + + + + + -
- -

点击或拖拽上传文件

-
-
+ +
{ @@ -2087,7 +2101,7 @@ }, // 文件预览及下载 handleFilePreview(file) { - const attId = file.response.data.id + const attId = file.response ? file.response.data.id : file.id if (this.preview) { if (attId) { window.location.href = '/api/att/attFile/downloadFileForSarNew?fileId=' + attId @@ -2095,22 +2109,23 @@ this.$message.warning('文件不存在,下载失败') } } else { - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else { - const nowTime = new Date().getTime() - // window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName) - } - } - }).catch(e => { - console.log(e) - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) + // this.getBusStandFileByAttId(attId) + // .then(res => { + // if(res){ + // const editFileInfo = res + // if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ + // window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) + // }else { + // const nowTime = new Date().getTime() + // // window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); + // window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName) + // } + // } + // }).catch(e => { + // console.log(e) + // this.$message.warning('文件不存在,预览失败') + // }) } }, // 导入标准数据成功后执行 @@ -2126,35 +2141,43 @@ switch (this.fileType){ case 'FBGBUSS': this.FBGBUSSFileList = this.FBGBUSSFileList.filter ( item => item.response === undefined); - this.FBGBUSSFileList.push(fileObj) + if(this.FBGBUSSFileList.every(item => item.id !== fileObj.id)) + this.FBGBUSSFileList.push(fileObj) break; case 'BZSMBUSS' : this.BZSMBUSSFileList = this.BZSMBUSSFileList.filter ( item => item.response === undefined); - this.BZSMBUSSFileList.push(fileObj) + if(this.BZSMBUSSFileList.every(item => item.id !== fileObj.id)) + this.BZSMBUSSFileList.push(fileObj) break; case 'LSBBBUSS': this.LSBBBUSSFileList = this.LSBBBUSSFileList.filter ( item => item.response === undefined); - this.LSBBBUSSFileList.push(fileObj) + if(this.LSBBBUSSFileList.every(item => item.id !== fileObj.id)) + this.LSBBBUSSFileList.push(fileObj) break; case 'QTWJBUSS': this.QTWJBUSSFileList = this.QTWJBUSSFileList.filter ( item => item.response === undefined); - this.QTWJBUSSFileList.push(fileObj) + if(this.QTWJBUSSFileList.every(item => item.id !== fileObj.id)) + this.QTWJBUSSFileList.push(fileObj) break; case 'GLWJBUSS': this.GLWJBUSSFileList = this.GLWJBUSSFileList.filter ( item => item.response === undefined); - this.GLWJBUSSFileList.push(fileObj) + if(this.GLWJBUSSFileList.every(item => item.id !== fileObj.id)) + this.GLWJBUSSFileList.push(fileObj) break; case 'summaryFile': this.summaryFileList = this.summaryFileList.filter ( item => item.response === undefined); - this.summaryFileList.push(fileObj) + if(this.summaryFileList.every(item => item.id !== fileObj.id)) + this.summaryFileList.push(fileObj) break; case 'madelSub': this.madelSubList = this.madelSubList.filter ( item => item.response === undefined); - this.madelSubList.push(fileObj) + if(this.madelSubList.every(item => item.id !== fileObj.id)) + this.madelSubList.push(fileObj) break; case 'XGD': this.XGDFileList = this.XGDFileList.filter ( item => item.response === undefined); - this.XGDFileList.push(fileObj) + if(this.XGDFileList.every(item => item.id !== fileObj.id)) + this.XGDFileList.push(fileObj) break; default : ; } @@ -2164,6 +2187,8 @@ message: response.message, type: 'success' }) + // 关闭上传弹框 + this.fileMadel = false } }, downloadFile (data) { @@ -2235,6 +2260,7 @@ default : ; } this.formKey++ + this.fileMadel = false }, popoverHideBusVs (checkedIds, checkedData,isShow,isLoadChild,topId) { if(checkedData) {