refactor: click file 2 preview & clean search comp

This commit is contained in:
puri-ph4tt 2023-11-23 18:00:43 +07:00
parent 37b8f64027
commit 43d009c35e
5 changed files with 191 additions and 9 deletions

View file

@ -3,13 +3,16 @@ import { onMounted, ref } from 'vue'
import { storeToRefs } from 'pinia'
import { useTreeDataStore } from '@/stores/tree-data'
import { useSearchDataStore } from '@/stores/searched-data'
import { useFileInfoStore } from '@/stores/file-info-data'
import FileItem from '@/components/FileItem.vue'
import TreeExplorer from '@/components/TreeExplorer.vue'
import SearchBar from '@/modules/01_user/components/SearchBar.vue'
import FileSearched from '@/components/FileSearched.vue'
import FileDownload from '@/modules/01_user/components/FileDownload.vue'
const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แฟ้ม', 'แฟ้มย่อย', 'ไฟล์']
const { isPreview } = storeToRefs(useFileInfoStore())
const { isSearch } = storeToRefs(useSearchDataStore())
const { data, currentDept } = storeToRefs(useTreeDataStore())
const { getCabinet, gotoParent } = useTreeDataStore()
@ -62,8 +65,8 @@ onMounted(getCabinet)
</div>
</div>
<div class="col">
<!-- <file-download /> -->
<div class="bg-white rounded-borders shadow-5 relative">
<file-download v-if="isPreview === true"/>
<div class="bg-white rounded-borders shadow-5 relative" v-if="isPreview === false">
<search-bar v-if="mode === 'user'" />
<div class="bg-white q-pa-md">
<div class="row items-center justify-between">
@ -72,12 +75,13 @@ onMounted(getCabinet)
flat
dense
class="q-mr-sm q-px-sm"
v-if="currentDept > 0"
v-if="currentDept > 0 && isSearch === false"
@click="() => gotoParent()"
>
<q-icon name="arrow_back" size="1rem" color="primary"
/></q-btn>
<span>{{ DEPT_NAME[currentDept] }}</span>
<span v-if="isSearch === false">{{ DEPT_NAME[currentDept] }}</span>
<span v-if="isSearch === true">ผลการค้นหา</span>
<q-btn
v-if="mode === 'admin' && viewMode === 'view_module'"
class="q-px-md q-ml-md"