mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
feat: 解决文件上传成功后再次点击“确认”会重新上传一遍的问题 (#826)
This commit is contained in:
parent
c0a1555c73
commit
18e171446e
@ -30,7 +30,7 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="handleClose" :disabled="loading">{{ $t('commons.button.cancel') }}</el-button>
|
<el-button @click="handleClose" :disabled="loading">{{ $t('commons.button.cancel') }}</el-button>
|
||||||
<el-button type="primary" @click="submit()" :disabled="loading">
|
<el-button type="primary" @click="submit()" :disabled="loading || uploaderFiles.length == 0">
|
||||||
{{ $t('commons.button.confirm') }}
|
{{ $t('commons.button.confirm') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
@ -54,8 +54,8 @@ const uploadRef = ref<UploadInstance>();
|
|||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
let uploadPrecent = ref(0);
|
let uploadPrecent = ref(0);
|
||||||
let open = ref(false);
|
const open = ref(false);
|
||||||
let path = ref();
|
const path = ref();
|
||||||
|
|
||||||
const em = defineEmits(['close']);
|
const em = defineEmits(['close']);
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
@ -115,6 +115,7 @@ const submit = async () => {
|
|||||||
if (uploadedChunkCount == chunkCount) {
|
if (uploadedChunkCount == chunkCount) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
uploadRef.value!.clearFiles();
|
uploadRef.value!.clearFiles();
|
||||||
|
uploaderFiles.value = [];
|
||||||
MsgSuccess(i18n.global.t('file.uploadSuccess'));
|
MsgSuccess(i18n.global.t('file.uploadSuccess'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user