Merge branch 'methapon' into development

This commit is contained in:
Methapon2001 2023-12-07 14:30:22 +07:00
commit 8d9ab5e3af
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
3 changed files with 11 additions and 3 deletions

View file

@ -272,7 +272,7 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
<q-btn
outline
push
class="q-px-md q-ml-md q-py-sm"
class="q-px-md q-ml-md"
:label="'สร้าง' + currentLevel"
type="submit"
color="primary"
@ -377,7 +377,7 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
v-if="props.mode == 'admin'"
outline
push
class="q-px-md q-ml-md q-py-sm"
class="q-px-md q-ml-md"
label="สร้างเอกสาร"
type="submit"
color="primary"

View file

@ -48,7 +48,13 @@ async function submitFolderForm(value: {
}
}
onMounted(getCabinet)
onMounted(async () => {
await getCabinet()
const sessionCurrentPath = sessionStorage.getItem('currentPath')
if (sessionCurrentPath) await getFolder(sessionCurrentPath)
})
</script>
<template>
<section id="header" class="q-px-md q-pt-md q-pb-none">

View file

@ -62,6 +62,8 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
async function getFolder(pathname: string, updateStatus = true) {
loader.show()
sessionStorage.setItem('currentPath', pathname)
const pathArray: string[] = pathname.split('/').filter(Boolean)
currentDept.value = pathArray.length