🐛 fix(frontend): 修复上传进度与八位取件码输入
This commit is contained in:
1 parent
988ae2429d
commit
7c6119b0c9
7 files changed
+29
-6
No files matched your search
@@ -25,7 +25,7 @@
|
||||
required
|
||||
:aria-invalid="error"
|
||||
:readonly="inputStatus.readonly"
|
||||
maxlength="5"
|
||||
maxlength="8"
|
||||
@focus="isInputFocused = true"
|
||||
@blur="isInputFocused = false"
|
||||
/>
|
||||
@@ -46,7 +46,7 @@
|
||||
<button
|
||||
type="submit"
|
||||
class="fcb-action fcb-button-primary group relative w-full overflow-hidden rounded-lg bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 px-4 py-3 font-bold text-white transition duration-300 hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 disabled:cursor-not-allowed disabled:opacity-50 motion-safe:disabled:hover:scale-100"
|
||||
:disabled="inputStatus.loading || code.trim().length !== 5"
|
||||
:disabled="inputStatus.loading || ![5, 8].includes(code.trim().length)"
|
||||
>
|
||||
<span class="flex items-center justify-center relative z-10">
|
||||
<span>{{ inputStatus.loading ? t('common.loading') : t('retrieve.submit') }}</span>
|
||||
@@ -101,4 +101,4 @@ defineExpose({
|
||||
.w-97-100 {
|
||||
width: calc(100% - 1rem);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -36,7 +36,7 @@ export function useRetrieveFlow() {
|
||||
const renderedContent = ref('')
|
||||
const normalizedCode = computed(() => code.value.trim())
|
||||
const isWorking = computed(() => isInspecting.value || isRetrieving.value)
|
||||
const hasValidCode = computed(() => normalizedCode.value.length === 5)
|
||||
const hasValidCode = computed(() => [5, 8].includes(normalizedCode.value.length))
|
||||
|
||||
const formatFileSize = (bytes: number) => {
|
||||
if (bytes === 0) return '0 ' + t('fileSize.bytes')
|
||||
|
||||
@@ -87,7 +87,7 @@ export const uploadChunkedFile = async (
|
||||
}
|
||||
|
||||
const start = index * chunkSize
|
||||
const end = Math.min(start + CHUNK_SIZE, file.size)
|
||||
const end = Math.min(start + chunkSize, file.size)
|
||||
const chunk = file.slice(start, end)
|
||||
const chunkResponse = await FileService.uploadChunk(
|
||||
uploadId,
|
||||
|
||||
@@ -106,7 +106,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
watch(code, (newCode) => {
|
||||
if (newCode.length === 5) {
|
||||
if ([5, 8].includes(newCode.length)) {
|
||||
void handleSubmit()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
:selected-file="selectedFile"
|
||||
:selected-files="selectedFiles"
|
||||
:progress="uploadProgress"
|
||||
:uploaded-bytes="uploadedBytes"
|
||||
:total-bytes="totalBytes"
|
||||
:disabled="isSubmitting"
|
||||
:upload-status="isFinalizing ? 'confirming' : isSubmitting ? 'uploading' : 'idle'"
|
||||
:description="uploadDescription"
|
||||
@@ -161,6 +163,8 @@ const {
|
||||
expirationMethod,
|
||||
expirationValue,
|
||||
uploadProgress,
|
||||
uploadedBytes,
|
||||
totalBytes,
|
||||
showDrawer,
|
||||
selectedRecord,
|
||||
isSubmitting,
|
||||
|
||||
Reference in new issue
Block a user