多文件上传
This commit is contained in:
@@ -621,6 +621,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 覆盖默认的上传行为,实现多个文件一起上传 */
|
||||
httpRequest(params) {
|
||||
const file = params.file
|
||||
// 根据后台需求数据格式
|
||||
|
||||
@@ -193,6 +193,7 @@
|
||||
name="file"
|
||||
:file-list="fillFileList"
|
||||
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF"
|
||||
:http-request="httpRequest"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:before-remove="handleBeforeRemove"
|
||||
:on-success="handleOnsuccess"
|
||||
@@ -320,6 +321,7 @@ import {
|
||||
getBusStandFileByAttId,
|
||||
saveinboundTask,
|
||||
saveTaskForPub,
|
||||
upFile
|
||||
} from "@/api/process.js"
|
||||
|
||||
export default {
|
||||
@@ -542,6 +544,21 @@ export default {
|
||||
})
|
||||
this.rh_pageData.fillFile = this.fillFileList
|
||||
},
|
||||
/** 覆盖默认的上传行为,实现多个文件一起上传 */
|
||||
httpRequest(params) {
|
||||
const file = params.file
|
||||
// 根据后台需求数据格式
|
||||
const form = new FormData()
|
||||
// 文件对象
|
||||
form.append("file", file)
|
||||
upFile(form).then(res=>{
|
||||
if (res.ok) {
|
||||
this.handleOnsuccess(res)
|
||||
} else {
|
||||
this.$message.warning('上传失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 文件上传成功
|
||||
handleOnsuccess(res, file, fileList) {
|
||||
if (res.ok) {
|
||||
|
||||
@@ -366,6 +366,7 @@
|
||||
drag
|
||||
:file-list="reData"
|
||||
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF"
|
||||
:http-request="httpRequest"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:before-remove="handleBeforeRemove"
|
||||
:on-success="handleOnsuccess"
|
||||
@@ -405,7 +406,7 @@ import {
|
||||
saveinboundTask,
|
||||
getBusStandFileByAttId,
|
||||
saveTaskForPub,
|
||||
changeAssigneeNew
|
||||
changeAssigneeNew,upFile
|
||||
} from "@/api/process.js"
|
||||
|
||||
export default {
|
||||
@@ -547,6 +548,21 @@ export default {
|
||||
this.reData = this.fileListData.fillFile
|
||||
this.upDialog = true
|
||||
},
|
||||
/** 覆盖默认的上传行为,实现多个文件一起上传 */
|
||||
httpRequest(params) {
|
||||
const file = params.file
|
||||
// 根据后台需求数据格式
|
||||
const form = new FormData()
|
||||
// 文件对象
|
||||
form.append("file", file)
|
||||
upFile(form).then(res=>{
|
||||
if (res.ok) {
|
||||
this.handleOnsuccess(res)
|
||||
} else {
|
||||
this.$message.warning('上传失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 文件上传成功
|
||||
handleOnsuccess(res, file, fileList) {
|
||||
if (res.ok) {
|
||||
|
||||
@@ -389,6 +389,7 @@ export default {
|
||||
this.reData = this.fileListData.material
|
||||
this.upDialog = true
|
||||
},
|
||||
/** 覆盖默认的上传行为,实现多个文件一起上传 */
|
||||
httpRequest(params) {
|
||||
const file = params.file
|
||||
// 根据后台需求数据格式
|
||||
@@ -477,6 +478,7 @@ export default {
|
||||
this.upThemeDialog = true
|
||||
|
||||
},
|
||||
/** 覆盖默认的上传行为,实现多个文件一起上传 */
|
||||
httpRequestTheme(params) {
|
||||
const file = params.file
|
||||
// 根据后台需求数据格式
|
||||
@@ -553,6 +555,7 @@ export default {
|
||||
|
||||
/** 其他资料上传 */
|
||||
|
||||
/** 覆盖默认的上传行为,实现多个文件一起上传 */
|
||||
httpRequestOther(params) {
|
||||
const file = params.file
|
||||
// 根据后台需求数据格式
|
||||
|
||||
@@ -309,6 +309,7 @@
|
||||
drag
|
||||
:file-list="ch_pageData.fileTextList"
|
||||
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF"
|
||||
:http-request="httpRequest"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:before-remove="handleBeforeRemove"
|
||||
:on-success="handleOnsuccess"
|
||||
@@ -352,7 +353,7 @@ import {
|
||||
startProcess, queryTaskFirst,
|
||||
saveTaskFirst, completeTask,
|
||||
taskDel, workGroup, processBack,
|
||||
getBusStandFileByAttId
|
||||
getBusStandFileByAttId,upFile
|
||||
} from '@/api/process.js'
|
||||
|
||||
export default {
|
||||
@@ -546,6 +547,21 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 覆盖默认的上传行为,实现多个文件一起上传 */
|
||||
httpRequest(params) {
|
||||
const file = params.file
|
||||
// 根据后台需求数据格式
|
||||
const form = new FormData()
|
||||
// 文件对象
|
||||
form.append("file", file)
|
||||
upFile(form).then(res=>{
|
||||
if (res.ok) {
|
||||
this.handleOnsuccess(res)
|
||||
} else {
|
||||
this.$message.warning('上传失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 文件上传成功
|
||||
handleOnsuccess(res, file, fileList) {
|
||||
if (res.ok) {
|
||||
|
||||
@@ -299,6 +299,7 @@ export default {
|
||||
uploadFile (val) {
|
||||
this.fileListData = val
|
||||
},
|
||||
/** 覆盖默认的上传行为,实现多个文件一起上传 */
|
||||
httpRequest(params) {
|
||||
const file = params.file
|
||||
// 根据后台需求数据格式
|
||||
|
||||
Reference in New Issue
Block a user