feat: breadcrumbs
This commit is contained in:
parent
cbad753124
commit
fff9d62d80
1 changed files with 48 additions and 27 deletions
|
|
@ -16,8 +16,8 @@ const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แ
|
|||
|
||||
const { isFilePreview } = storeToRefs(useFileInfoStore())
|
||||
const { isSearch } = storeToRefs(useSearchDataStore())
|
||||
const { data, currentDept } = storeToRefs(useTreeDataStore())
|
||||
const { createFolder, getCabinet, gotoParent } = useTreeDataStore()
|
||||
const { data, currentDept, currentPath } = storeToRefs(useTreeDataStore())
|
||||
const { createFolder, getCabinet, gotoParent, getFolder } = useTreeDataStore()
|
||||
|
||||
const viewMode = ref<'view_list' | 'view_module'>('view_list')
|
||||
const inputSearch = ref<string>()
|
||||
|
|
@ -97,19 +97,29 @@ onMounted(getCabinet)
|
|||
<search-bar v-if="mode === 'user'" />
|
||||
<div class="bg-white q-pa-md">
|
||||
<div class="row items-center justify-between">
|
||||
<span class="text-h6">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
class="q-mr-sm q-px-sm"
|
||||
v-if="currentDept > 0 && isSearch === false"
|
||||
@click="() => gotoParent()"
|
||||
>
|
||||
<q-icon name="arrow_back" size="1rem" color="primary"
|
||||
/></q-btn>
|
||||
<span v-if="isSearch === false">{{
|
||||
DEPT_NAME[currentDept]
|
||||
}}</span>
|
||||
<span class="text-body1">
|
||||
<div class="row items-center">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
class="q-mr-sm q-px-sm"
|
||||
v-if="currentDept > 0 && isSearch === false"
|
||||
@click="() => gotoParent()"
|
||||
>
|
||||
<q-icon name="arrow_back" size="1rem" color="primary" />
|
||||
</q-btn>
|
||||
<q-breadcrumbs v-if="isSearch === false" active-color="primary">
|
||||
<q-breadcrumbs-el
|
||||
v-if="currentPath === '/' || !currentPath"
|
||||
label="ตู้เอกสารทั้งหมด"
|
||||
/>
|
||||
<q-breadcrumbs-el
|
||||
class="text-black"
|
||||
v-for="fragments in currentPath.split('/').filter(Boolean)"
|
||||
:label="fragments"
|
||||
/>
|
||||
</q-breadcrumbs>
|
||||
</div>
|
||||
<span v-if="isSearch === true">ผลการค้นหา</span>
|
||||
<q-btn
|
||||
v-if="
|
||||
|
|
@ -123,20 +133,31 @@ onMounted(getCabinet)
|
|||
color="primary"
|
||||
dense
|
||||
icon="add"
|
||||
@click="()=> triggerFolderCreate()"
|
||||
@click="() => triggerFolderCreate()"
|
||||
/>
|
||||
</span>
|
||||
<q-btn
|
||||
flat
|
||||
color="blue-grey-2"
|
||||
:icon="viewMode"
|
||||
@click="
|
||||
() => {
|
||||
viewMode =
|
||||
viewMode === 'view_list' ? 'view_module' : 'view_list'
|
||||
}
|
||||
"
|
||||
/>
|
||||
<div>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
color="blue-grey-2"
|
||||
icon="refresh"
|
||||
class="q-mr-sm"
|
||||
@click="() => getFolder(currentPath)"
|
||||
/>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
color="blue-grey-2"
|
||||
:icon="viewMode"
|
||||
@click="
|
||||
() => {
|
||||
viewMode =
|
||||
viewMode === 'view_list' ? 'view_module' : 'view_list'
|
||||
}
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<file-searched v-if="isSearch === true" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue