From c4f63169684cbb800f0f41e38a8060df4b79f26e Mon Sep 17 00:00:00 2001 From: puri-ph4tt Date: Thu, 30 Nov 2023 16:49:13 +0700 Subject: [PATCH] refactor: search result (list view) & clear search --- .../client/src/components/FileSearched.vue | 166 +++++++++++++++--- Services/client/src/components/PageLayout.vue | 7 +- .../modules/01_user/components/SearchBar.vue | 9 +- 3 files changed, 152 insertions(+), 30 deletions(-) diff --git a/Services/client/src/components/FileSearched.vue b/Services/client/src/components/FileSearched.vue index 1c7ce4d..1453ec3 100644 --- a/Services/client/src/components/FileSearched.vue +++ b/Services/client/src/components/FileSearched.vue @@ -3,42 +3,128 @@ import { storeToRefs } from 'pinia' import { useSearchDataStore } from '@/stores/searched-data' import { useFileInfoStore } from '@/stores/file-info-data' import FileIcon from '@/components/FileIcon.vue' +import type { QTableProps } from 'quasar' + +defineProps<{ + viewMode: 'view_list' | 'view_module' +}>() const { foundFile } = storeToRefs(useSearchDataStore()) -const { getFileInfo } = useFileInfoStore() +const { getFileInfo, getSize, getType, getFileNameFormat } = useFileInfoStore() +const columns: QTableProps['columns'] = [ + { + name: 'name', + required: true, + label: 'ชื่อไฟล์', + align: 'left', + field: (row) => row.fileName, + format: (val) => `${val}`, + sortable: true, + style: 'width: 200px', + }, + { + name: 'title', + align: 'center', + label: 'ชื่อเรื่อง', + field: 'title', + style: 'width: 200px', + sortable: true, + }, + { + name: 'fileType', + align: 'center', + label: 'ประเภทของไฟล์', + field: 'fileType', + sortable: true, + style: 'width: 200px', + }, + { + name: 'actions', + align: 'center', + label: '', + field: '', + style: 'width: 20px', + }, +]