mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-08 08:04:37 +08:00
parent
18462296ae
commit
037da3a7fd
2 changed files with 19 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<div @dragover="handleDragover" @drop="handleDrop" @dragleave="handleDragleave">
|
||||
<div class="flex sm:flex-row flex-col justify-start gap-y-2 items-center gap-x-4" ref="toolRef">
|
||||
<div class="flex-shrink-0 flex sm:w-min w-full items-center justify-start">
|
||||
<el-tooltip :content="$t('file.back')" placement="top">
|
||||
|
|
@ -1407,6 +1407,23 @@ const getHostMount = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
const handleDrop = async (event: DragEvent) => {
|
||||
event.preventDefault();
|
||||
fileUpload.path = req.path;
|
||||
if (!uploadRef.value?.open) {
|
||||
await uploadRef.value?.handleDrop(event);
|
||||
}
|
||||
uploadRef.value.acceptParams(fileUpload);
|
||||
};
|
||||
|
||||
const handleDragover = (event: DragEvent) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
const handleDragleave = (event: { preventDefault: () => void }) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
if (localStorage.getItem('show-hidden') === null) {
|
||||
localStorage.setItem('show-hidden', 'true');
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ const acceptParams = (props: UploadFileProps) => {
|
|||
});
|
||||
};
|
||||
|
||||
defineExpose({ acceptParams });
|
||||
defineExpose({ acceptParams, handleDrop, open });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue