refactor: LivstView Cabinet and Drawer can CRUD

This commit is contained in:
somnetsak123 2023-11-28 09:22:44 +07:00 committed by Methapon2001
parent a28bc7de6b
commit 3553164a8a
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
6 changed files with 183 additions and 42 deletions

View file

@ -10,6 +10,7 @@ import SearchBar from '@/modules/01_user/components/SearchBar.vue'
import FileSearched from '@/components/FileSearched.vue'
import FileDownload from '@/modules/01_user/components/FileDownload.vue'
import ListView from '@/components/ListView.vue'
import FromEdit from '@/components/FromEdit.vue'
const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แฟ้ม', 'แฟ้มย่อย', 'ไฟล์']
@ -17,6 +18,11 @@ const { isPreview } = storeToRefs(useFileInfoStore())
const { isSearch } = storeToRefs(useSearchDataStore())
const { data, currentDept } = storeToRefs(useTreeDataStore())
const { getCabinet, gotoParent } = useTreeDataStore()
const drawer = ref<boolean>(false)
const drawerFile = ref<boolean>(false)
const drawerStatus = ref<'create'>('create')
const viewMode = ref<'view_list' | 'view_module'>('view_list')
const inputSearch = ref<string>()
const props = defineProps<{
@ -66,8 +72,11 @@ onMounted(getCabinet)
</div>
</div>
<div class="col">
<file-download v-if="isPreview === true"/>
<div class="bg-white rounded-borders shadow-5 relative" v-if="isPreview === false">
<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">
@ -81,7 +90,9 @@ onMounted(getCabinet)
>
<q-icon name="arrow_back" size="1rem" color="primary"
/></q-btn>
<span v-if="isSearch === false">{{ DEPT_NAME[currentDept] }}</span>
<span v-if="isSearch === false">{{
DEPT_NAME[currentDept]
}}</span>
<span v-if="isSearch === true">ผลการค้นหา</span>
<q-btn
v-if="
@ -95,7 +106,13 @@ onMounted(getCabinet)
color="primary"
dense
icon="add"
@click=""
@click="
() => {
drawer = !drawer
drawerStatus = 'create'
drawerFile = false
}
"
/>
</span>
<q-btn
@ -123,6 +140,16 @@ onMounted(getCabinet)
</div>
</div>
</section>
<from-edit
v-if="currentDept === 0"
:drawer="drawer"
:drawerStatus="drawerStatus"
:DEPT_NAME="DEPT_NAME"
:currentDept="currentDept"
editPathname=""
@update:drawer="() => (drawer = !drawer)"
/>
</template>
<style lang="scss" scoped>