cleanup
This commit is contained in:
parent
e2a4487064
commit
d7e136a7c3
1 changed files with 3 additions and 17 deletions
|
|
@ -14,33 +14,19 @@
|
|||
|
||||
const totalSize = ref(0);
|
||||
const totalSizePercent = ref(0);
|
||||
const files = ref([]);
|
||||
|
||||
const visible = ref(false);
|
||||
|
||||
const toast = useToast();
|
||||
const filename = ref<string>("");
|
||||
|
||||
const onRemoveTemplatingFile = (file, removeFileCallback, index) => {
|
||||
const onRemoveTemplatingFile = (file: File, removeFileCallback: (arg0: number) => void, index: number) => {
|
||||
removeFileCallback(index);
|
||||
totalSize.value -= parseInt(formatSize(file.size));
|
||||
totalSizePercent.value = totalSize.value / 10;
|
||||
};
|
||||
|
||||
const onClearTemplatingUpload = (clear) => {
|
||||
clear();
|
||||
totalSize.value = 0;
|
||||
totalSizePercent.value = 0;
|
||||
};
|
||||
|
||||
const onSelectedFiles = (event) => {
|
||||
files.value = event.files;
|
||||
files.value.forEach((file) => {
|
||||
totalSize.value += parseInt(formatSize(file.size));
|
||||
});
|
||||
};
|
||||
|
||||
const uploadEvent = (callback) => {
|
||||
const uploadEvent = (callback: () => void) => {
|
||||
totalSizePercent.value = totalSize.value / 10;
|
||||
callback();
|
||||
};
|
||||
|
|
@ -59,7 +45,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
const formatSize = (bytes) => {
|
||||
const formatSize = (bytes: number) => {
|
||||
const k = 1024;
|
||||
const dm = 3;
|
||||
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
|
|
|||
Loading…
Reference in a new issue