mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
43 lines
1.2 KiB
Vue
43 lines
1.2 KiB
Vue
<script lang="ts" setup>
|
|
import showDrawer from "@/lib/showDrawer";
|
|
import FileShareDrawer from "@/components/Drawer/FileShareDrawer.vue";
|
|
import FileUploadField from "@/components/Field/FileUploadField.vue";
|
|
import FormButton from "@/components/Field/FormButton.vue";
|
|
import PickupShareBtn from "@/components/PickupShareBtn.vue";
|
|
|
|
const emit = defineEmits<{
|
|
(e: "change", key: string): void;
|
|
}>();
|
|
|
|
const { t } = useI18n();
|
|
|
|
const handleFormSubmit = async (form: any) => {
|
|
const { file } = form?.values || {};
|
|
showDrawer({
|
|
render: ({ hide }) =>
|
|
h(FileShareDrawer, {
|
|
hide,
|
|
file,
|
|
onFileHandle: ({ type, config }) => {
|
|
form.setFieldValue("handle_type", type);
|
|
form.setFieldValue("config", config);
|
|
emit("change", "progress");
|
|
},
|
|
}),
|
|
});
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="gap-5 flex flex-col">
|
|
<div class="text-xl font-normal">{{ t("file.uploadFile") }}</div>
|
|
<FileUploadField name="file" rules="required" />
|
|
<div class="flex flex-row gap-3">
|
|
<FormButton @click="handleFormSubmit">
|
|
<LucideShare class="size-4" />{{ t("btn.submit") }}
|
|
</FormButton>
|
|
<PickupShareBtn />
|
|
</div>
|
|
</div>
|
|
</template>
|