From e2d8b5d0ba04a941d97d375ac907bce2c9e68aee Mon Sep 17 00:00:00 2001 From: zhoulingpo Date: Thu, 25 May 2023 16:39:14 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportProcess/components/reportForm.vue | 105 ++++++++++++++---- 1 file changed, 85 insertions(+), 20 deletions(-) diff --git a/src/views/reportProcess/components/reportForm.vue b/src/views/reportProcess/components/reportForm.vue index f58dc78..2826129 100644 --- a/src/views/reportProcess/components/reportForm.vue +++ b/src/views/reportProcess/components/reportForm.vue @@ -115,16 +115,46 @@ value: orgTableVal, valueName: orgTableValName }" :workNumFlag="true" :isOrg="true" :maxSelected="1" @confirm="isTreeOk"> - - - -
点击或拖拽上传文件
+ :class="{'disable':formControl}"> +
+ 上传文件 +
+
+
+ + + + + + + + + + +
@@ -160,6 +190,8 @@ export default { }, data() { return { + total:0, + fileLists:[], delIds:[], dialogFile:false, privacyLevelOptions, @@ -292,12 +324,30 @@ export default { id:item.fileId } }) + this.handleCurrentChange(1) } }, immediate: true } }, methods: { + handleSizeChange(size){ + this.q.pageSize=size + this.handleCurrentChange() + }, + handleCurrentChange(current){ + setTimeout(() => { + current = current ? current : this.q.pageNo + this.q.pageNo = current + this.fileLists = this.fileList.slice(this.q.pageSize * (current - 1), this.q.pageSize * current) + // console.log(this.pages.size, this.pages.size * (current - 1), this.pages.size * this.pages.current, this.list) + if (this.fileLists.length < 1 && current > 1) { + this.handleCurrentChange(current - 1) + return false + } + this.total = this.fileList.length + },500) + }, handlePreview(file){ let lastName=file.name.split('.') let list=['xls','xlsx'] @@ -461,17 +511,13 @@ export default { this.dialogUser = true }, handleRemove(file, fileList) { - if(this.prcType == '5' || this.$route.query.taskDefinitionKey == 'reEdit'){ - // 记录删除的文件id - this.delIds.push(file.id) - } - this.fileList = fileList - this.form.fileList = this.fileList.map(item=>{ - return { - fileId:item.id, - fileName:item.name + this.form.fileList = this.fileList.filter(item=>{ + if(item.id!=file.id){ + return item } }) + this.fileList=this.form.fileList + this.handleCurrentChange(1) }, //用递归方式去除children getTreeData(data) { @@ -495,6 +541,7 @@ export default { onSuccess(res, file,fileList){ if(res.ok){ // this.fileList.push({url:res.data.fullurl})//以前的错误代码 + debugger this.fileList=fileList this.form.fileList = this.fileList.map(item=>{ return { @@ -502,7 +549,14 @@ export default { fileName:item.response?item.response.data.name:item.name } }) + this.fileList= this.form.fileList.map(item=>{ + return { + id:item.fileId, + name:item.fileName + } + }) this.$refs.processFormRef.clearValidate(['fileList']) + this.handleCurrentChange(1) } console.log( res," this.fileList3") }, @@ -601,11 +655,6 @@ export default { } } } - -.uploadBtn { - vertical-align: super; -} - .uploadFile { margin-left: -35px; height: 36px; @@ -663,4 +712,20 @@ export default { } } +.table_top{ + padding: 10px 13px; + text-align: left; +} +.table { + width: 500px; + margin: 0 14px 0 13px; + min-height: 200px; + ::v-deep .vxe-table--body-wrapper{ + height: 200px; + overflow: auto; + } + .uploadBtn{ + margin: 10px; + } +}