🐛 fix: 保留上传收尾提示并支持重试取件码
* 在上传框持续显示校验提示、进度和明确的收尾失败状态 * 提供复用原上传会话的取件码重试入口,避免重复上传 * 调整忙碌与错误布局,验证桌面及手机状态提示和按钮可见性
This commit is contained in:
1 parent
b67d36d8a0
commit
9d29489be1
9 files changed
+85
-10
No files matched your search
@@ -36,6 +36,9 @@ export function useSendFlow() {
|
||||
const cleanupPending = ref(false)
|
||||
const submitMessage = ref('')
|
||||
const isFinalizing = ref(false)
|
||||
const uploadErrorMessage = ref('')
|
||||
const completionRetryPending = ref(false)
|
||||
const uploadStatus = computed(() => isFinalizing.value ? 'confirming' : isSubmitting.value ? 'uploading' : uploadErrorMessage.value ? 'error' : 'idle')
|
||||
const fileHash = ref('')
|
||||
const sendRecords = computed(() => fileDataStore.shareData)
|
||||
const uploadDescription = computed(() =>
|
||||
@@ -62,7 +65,7 @@ export function useSendFlow() {
|
||||
alertStore.showAlert(message, type)
|
||||
}
|
||||
const sentRecordActions = createSentRecordActions(notifyCopyResult)
|
||||
const { requestCancel, needsCleanup, retryCleanup, isUploadInterrupted, resetPresignUpload, submitFile, submitText } = useSendSubmit({
|
||||
const { requestCancel, needsCleanup, retryCleanup, isUploadInterrupted, canRetryCompletion, resetPresignUpload, submitFile, submitText } = useSendSubmit({
|
||||
getMaxFileSize: () => configStore.uploadSizeLimit,
|
||||
getChunkSizeMB: () => config.value.chunkSizeMB,
|
||||
notify: (message, type) => alertStore.showAlert(message, type),
|
||||
@@ -78,6 +81,11 @@ export function useSendFlow() {
|
||||
}
|
||||
})
|
||||
|
||||
watch([selectedFile, selectedFiles], () => {
|
||||
uploadErrorMessage.value = ''
|
||||
completionRetryPending.value = false
|
||||
})
|
||||
|
||||
const checkOpenUpload = () => {
|
||||
if (config.value.openUpload === 0 && !adminStore.hasToken) {
|
||||
alertStore.showAlert(t('send.messages.guestUploadDisabled'), 'error')
|
||||
@@ -224,6 +232,8 @@ export function useSendFlow() {
|
||||
if (isSubmitting.value || cleanupPending.value) return
|
||||
isSubmitting.value = true
|
||||
submitMessage.value = ''
|
||||
uploadErrorMessage.value = ''
|
||||
completionRetryPending.value = false
|
||||
|
||||
try {
|
||||
if (sendType.value === 'file' && !selectedFile.value && selectedFiles.value.length === 0) {
|
||||
@@ -302,6 +312,10 @@ export function useSendFlow() {
|
||||
} else {
|
||||
cleanupPending.value = needsCleanup()
|
||||
submitMessage.value = cleanupPending.value ? '传输已停止,临时文件清理未完成,请重试中断' : getErrorMessage(error, t('send.messages.sendFailed'))
|
||||
completionRetryPending.value = isFinalizing.value && Boolean(selectedFile.value) && canRetryCompletion(error) && !cleanupPending.value
|
||||
uploadErrorMessage.value = completionRetryPending.value
|
||||
? t('send.uploadArea.status.confirmationFailed')
|
||||
: submitMessage.value
|
||||
alertStore.showAlert(submitMessage.value, 'error')
|
||||
}
|
||||
} finally {
|
||||
@@ -364,6 +378,7 @@ export function useSendFlow() {
|
||||
isSubmitting,
|
||||
isCancelling, cleanupPending, submitMessage, cancelUpload,
|
||||
isFinalizing,
|
||||
uploadStatus, uploadErrorMessage, completionRetryPending,
|
||||
sendRecords,
|
||||
uploadDescription,
|
||||
expirationOptions,
|
||||
|
||||
Reference in new issue
Block a user