From 4c1255535e6007f704dc66202c20fbb339e9a505 Mon Sep 17 00:00:00 2001 From: puri-ph4tt Date: Thu, 7 Dec 2023 10:33:28 +0700 Subject: [PATCH 1/8] chore: remove search log --- Services/client/src/modules/01_user/components/SearchBar.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/Services/client/src/modules/01_user/components/SearchBar.vue b/Services/client/src/modules/01_user/components/SearchBar.vue index 3f864d5..94e8ff2 100644 --- a/Services/client/src/modules/01_user/components/SearchBar.vue +++ b/Services/client/src/modules/01_user/components/SearchBar.vue @@ -95,8 +95,6 @@ async function searchSubmit() { `${import.meta.env.VITE_API_ENDPOINT}/search`, submitSearchData.value, ) - console.log(submitSearchData) - getFoundFile(res.data) isSearch.value = true } catch (error) { From 58f478a380f0b7b259d7a7434dc12eaae1ec2cb8 Mon Sep 17 00:00:00 2001 From: puri-ph4tt Date: Thu, 7 Dec 2023 10:39:45 +0700 Subject: [PATCH 2/8] fix: filePath, delete timeout, header --- .../client/src/components/FileSearched.vue | 2 +- Services/client/src/components/PageLayout.vue | 2 +- .../01_user/components/FileDownload.vue | 21 ++++++++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Services/client/src/components/FileSearched.vue b/Services/client/src/components/FileSearched.vue index 8a4409a..1d5c5bf 100644 --- a/Services/client/src/components/FileSearched.vue +++ b/Services/client/src/components/FileSearched.vue @@ -156,7 +156,7 @@ function confirmDelete() { setTimeout(() => { isActFoundFile.value = true - }, 300) + }, 1000) } } diff --git a/Services/client/src/components/PageLayout.vue b/Services/client/src/components/PageLayout.vue index 888d255..2822f4f 100644 --- a/Services/client/src/components/PageLayout.vue +++ b/Services/client/src/components/PageLayout.vue @@ -55,7 +55,7 @@ onMounted(getCabinet)
จัดเก็บเอกสาร
-
สืบค้นเอกสาร
+
สืบค้นผลงาน
diff --git a/Services/client/src/modules/01_user/components/FileDownload.vue b/Services/client/src/modules/01_user/components/FileDownload.vue index 1ad279f..a9d2ee8 100644 --- a/Services/client/src/modules/01_user/components/FileDownload.vue +++ b/Services/client/src/modules/01_user/components/FileDownload.vue @@ -10,6 +10,8 @@ import FileIcon from '@/components/FileIcon.vue' const { isFilePreview, fileInfo } = storeToRefs(useFileInfoStore()) const { getType, getFormatDate, getSize } = useFileInfoStore() +const filePath = + (fileInfo.value?.pathname || '').split('/').slice(0, -1).join(' / ') + ' / ' async function downloadSubmit(path: string | undefined) { if (path) { @@ -66,6 +68,9 @@ async function downloadSubmit(path: string | undefined) { {{ fileInfo?.title }} + + {{ filePath }} +
@@ -113,7 +118,7 @@ async function downloadSubmit(path: string | undefined) {
-
+
ชื่อไฟล์
@@ -122,7 +127,7 @@ async function downloadSubmit(path: string | undefined) {
-
+
ชื่อเรื่อง
@@ -131,7 +136,7 @@ async function downloadSubmit(path: string | undefined) {
-
+
รายละเอียด
@@ -140,7 +145,7 @@ async function downloadSubmit(path: string | undefined) {
-
+
กลุ่ม/หมวดหมู่
@@ -149,7 +154,7 @@ async function downloadSubmit(path: string | undefined) {
-
+
คำสำคัญ
@@ -158,7 +163,7 @@ async function downloadSubmit(path: string | undefined) {
-
+
ขนาดไฟล์
@@ -167,7 +172,7 @@ async function downloadSubmit(path: string | undefined) {
-
+
ประเภทไฟล์
@@ -176,7 +181,7 @@ async function downloadSubmit(path: string | undefined) {
-
+
วันที่อัปโหลด
From 4f9ca4bd1734488dfb8556cd2283275725524304 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Thu, 7 Dec 2023 09:42:36 +0700 Subject: [PATCH 3/8] refactor: dialog --- .../src/components/UploadExistDialog.vue | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Services/client/src/components/UploadExistDialog.vue b/Services/client/src/components/UploadExistDialog.vue index a34619f..3fdfd81 100644 --- a/Services/client/src/components/UploadExistDialog.vue +++ b/Services/client/src/components/UploadExistDialog.vue @@ -15,19 +15,23 @@ defineEmits(['update:notification', 'confirm', 'cancel']) > -
- เตือนพบไฟล์ชื่อซ้ำในระบบ +
+
+
+ +
+
+
+
ยืนยันการเพิ่มข้อมูล
+

+ พบข้อมูลในระบบ หากดำเนินการต่อ + ข้อมูลที่มีอยู่จะถูกแทนที่ด้วยข้อมูลใหม่ + ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ +

+
- - หากดำเนินการต่อข้อมูลจะถูกเขียนทับ - - From 458c1663bf7108f4d439da592ee1cc4a2543971f Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Thu, 7 Dec 2023 09:42:49 +0700 Subject: [PATCH 4/8] refactor: reset on leave --- Services/client/src/components/FileForm.vue | 5 ++++- Services/client/src/components/FileItem.vue | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Services/client/src/components/FileForm.vue b/Services/client/src/components/FileForm.vue index 1222d70..0bda271 100644 --- a/Services/client/src/components/FileForm.vue +++ b/Services/client/src/components/FileForm.vue @@ -38,6 +38,10 @@ const emit = defineEmits([ 'submit', ]) +defineExpose({ + reset, +}) + function keydown(e: KeyboardEvent) { if (e.key === 'Escape' && props.open === true) { emit('update:open', false) @@ -63,7 +67,6 @@ function submit() { keyword: props.keyword, category: props.category, }) - emit('update:open', !open), reset() } const createKeyword = ((val, done) => { diff --git a/Services/client/src/components/FileItem.vue b/Services/client/src/components/FileItem.vue index 4285180..d7c1cbb 100644 --- a/Services/client/src/components/FileItem.vue +++ b/Services/client/src/components/FileItem.vue @@ -64,6 +64,7 @@ const fileFormData = ref<{ const fileFormType = ref<'edit' | 'create'>('create') const fileFormError = ref<{ fileExist?: boolean; fileName2Long?: boolean }>({}) const fileExistNotification = ref(false) +const fileFormComponent = ref>() function triggerFolderDelete(pathname: string) { deleteFormType.value = 'deleteFolder' @@ -176,6 +177,7 @@ async function submitFileForm( fileFormData.value = {} fileFormState.value = false currentParam.value = undefined + fileFormComponent.value?.reset() } @@ -379,6 +381,7 @@ async function submitFileForm(
Date: Thu, 7 Dec 2023 10:45:58 +0700 Subject: [PATCH 5/8] feat: click outside of drawer should close drawer --- Services/client/src/components/FileForm.vue | 1 + Services/client/src/components/FileItem.vue | 4 +- .../client/src/components/FileItemAction.vue | 45 ++++++++++++++----- Services/client/src/components/FolderForm.vue | 3 +- Services/client/src/components/ListView.vue | 12 +++-- 5 files changed, 46 insertions(+), 19 deletions(-) diff --git a/Services/client/src/components/FileForm.vue b/Services/client/src/components/FileForm.vue index 0bda271..5289238 100644 --- a/Services/client/src/components/FileForm.vue +++ b/Services/client/src/components/FileForm.vue @@ -111,6 +111,7 @@ const file = ref() class="q-pa-md" side="right" tabindex="0" + v-click-outside="() => $emit('update:open', false)" :width="300" :breakpoint="500" :model-value="open" diff --git a/Services/client/src/components/FileItem.vue b/Services/client/src/components/FileItem.vue index d7c1cbb..93c7abe 100644 --- a/Services/client/src/components/FileItem.vue +++ b/Services/client/src/components/FileItem.vue @@ -246,7 +246,7 @@ async function submitFileForm( alignItems: 'center', padding: currentDept > 2 ? '.5rem 0' : '.5rem', }" - @click="() => triggerFolderCreate()" + @click.stop="() => triggerFolderCreate()" id="triggerFolderCreateFileItem" >
+import { ref } from 'vue' + defineEmits(['edit', 'delete']) -const props = - defineProps<{ - nameId: string - - }>() - +const props = defineProps<{ + nameId: string +}>() +const open = ref(false)