上传应答文件更改

This commit is contained in:
ygs
2025-07-23 15:55:25 +08:00
parent 5b76717c10
commit 449a40828d

View File

@ -284,7 +284,8 @@ const Index: React.FC<IndexProps> = (props) => {
if (index == 'single') {
currentDate = val
setEndTime(new Date(val.endDate).getTime())
filetype = '.file'
// filetype = '.file'
filetype = '.rar,.zip,.doc,.docx,.xls,.xlsx,.pdf'
object = JSON.stringify(val)
path = '/' + val.createYear + '/' + val.tpId + '/' + val.sectionId + '/' + val.tdocId + '/uploadFile/' + val.tendererId
} else {
@ -323,10 +324,10 @@ const Index: React.FC<IndexProps> = (props) => {
/**
* 大文件上传完成后的组件返回
*
* @param file
* @param resumable
* @param callback
*
* @param file
* @param resumable
* @param callback
*/
const onUploadSuccess = (file: any, cache: any, callback: any) => {
cache.push({
@ -357,34 +358,42 @@ const Index: React.FC<IndexProps> = (props) => {
clearInterval(task);
} else {
if (switchBtn) {
getDecrypt(uuid).then((res) => {
if (res.code == 200) {
if (res.data.consumptionState == '2' || res.data.consumptionState == '4') {
if (res.data.stateMessage) {
message.error(res.data.stateMessage)
callback(cache.length - 1, res.data.stateMessage, 2);
} else {
message.error('验证错误,请刷新页面后重新上传!')
callback(cache.length - 1, "文件验证失败", 2);
}
switchBtn = false
clearInterval(task);
return;
} else if (res.data.consumptionState == '3') {
message.success(res.data.stateMessage)
setTimeout(() => {
message.destroy()
}, 3000)
test = 100;
callback(cache.length - 1, "文件验证成功", test);
switchBtn = false
clearInterval(task);
return;
} else {
callback(cache.length - 1, "文件验证中", test);
}
}
})
setTimeout(() => {
message.destroy()
}, 3000)
test = 100;
callback(cache.length - 1, "文件验证成功", test);
switchBtn = false;
clearInterval(task);
return;
// getDecrypt(uuid).then((res) => {
// if (res.code == 200) {
// if (res.data.consumptionState == '2' || res.data.consumptionState == '4') {
// if (res.data.stateMessage) {
// message.error(res.data.stateMessage)
// callback(cache.length - 1, res.data.stateMessage, 2);
// } else {
// message.error('验证错误,请刷新页面后重新上传!')
// callback(cache.length - 1, "文件验证失败", 2);
// }
// switchBtn = false
// clearInterval(task);
// return;
// } else if (res.data.consumptionState == '3') {
// message.success(res.data.stateMessage)
// setTimeout(() => {
// message.destroy()
// }, 3000)
// test = 100;
// callback(cache.length - 1, "文件验证成功", test);
// switchBtn = false
// clearInterval(task);
// return;
// } else {
// callback(cache.length - 1, "文件验证中", test);
// }
// }
// })
}
}
}, 3000);