diff --git a/src/views/Darta/Create.vue b/src/views/Darta/Create.vue index 32a13dd..683a828 100644 --- a/src/views/Darta/Create.vue +++ b/src/views/Darta/Create.vue @@ -1,44 +1,190 @@ +const fileInputRef = ref(null); + +const onClose = () => { + DartaTowserStore.close(); + resetForm(); +}; + +const onSave = () => { + submitForm(); +}; + +const triggerFileInput = () => { + fileInputRef.value?.click(); +}; + +const handleFileUpload = (event: Event) => { + const target = event.target as HTMLInputElement; + if (target.files) { + formData.attachments = [...formData.attachments, ...Array.from(target.files)]; + } +}; + +const removeFile = (index: number) => { + formData.attachments.splice(index, 1); +}; + +const resetForm = () => { + formData.documentNumber = ''; + formData.subject = ''; + formData.attachments = []; +}; + +const submitForm = async () => { + console.log("Submitting:", formData); + onClose(); +}; + \ No newline at end of file diff --git a/src/views/Darta/Darta.vue b/src/views/Darta/Darta.vue index 5eeb9fc..a2da26a 100644 --- a/src/views/Darta/Darta.vue +++ b/src/views/Darta/Darta.vue @@ -13,18 +13,17 @@ /> + + \ No newline at end of file