修改文件上传为多个

This commit is contained in:
miao 2023-02-13 14:13:44 +08:00 committed by fangxiang
parent c35ff719c6
commit e4827b4fe6
1 changed files with 121 additions and 117 deletions

View File

@ -346,6 +346,7 @@
style="height: 69vh; width: 70%" style="height: 69vh; width: 70%"
:disable="uploader_loading" :disable="uploader_loading"
:url="getUrl" :url="getUrl"
multiple
method="post" method="post"
:headers="generatorFileUploadHeaders" :headers="generatorFileUploadHeaders"
:label="$t('select file') + ':'" :label="$t('select file') + ':'"
@ -687,7 +688,6 @@ export default defineComponent({
loading.value = false; loading.value = false;
}; };
const refresh_file_list_async = async () => { const refresh_file_list_async = async () => {
const response = await _request_list_files(path.value); const response = await _request_list_files(path.value);
_show_files(response); _show_files(response);
@ -1148,7 +1148,7 @@ export default defineComponent({
} }
}, 1); }, 1);
}, },
onUploaded() { onUploaded(info: any) {
uploading.value = false; uploading.value = false;
uploader.value.reset(); uploader.value.reset();
refresh_file_list(); refresh_file_list();
@ -1161,8 +1161,10 @@ export default defineComponent({
}); });
loading.value = false; loading.value = false;
}, },
onFailed(info: any) { async onFailed(info: any) {
console.log(info); let file_list: any = await _request_list_files(path.value);
setTimeout(() => {
if (files.value.length != file_list.files.length) {
$q.notify({ $q.notify({
type: "warning", type: "warning",
message: $t.t("file upload") + $t.t("fail") + "!", message: $t.t("file upload") + $t.t("fail") + "!",
@ -1170,7 +1172,9 @@ export default defineComponent({
timeout: 1500, timeout: 1500,
}); });
loading.value = false; loading.value = false;
loading.value = false; }
}, 500);
}, },
copyFile(file: FileEntity) { copyFile(file: FileEntity) {
if (file) { if (file) {