refactor: add button FileCreate and FolderCreate

This commit is contained in:
somnetsak123 2023-12-07 14:33:46 +07:00
parent e7bf3d261c
commit a10e51d72b

View file

@ -17,7 +17,7 @@ const props = withDefaults(
action: false,
},
)
const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แฟ้ม', 'แฟ้มย่อย'] as const
const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แฟ้ม', 'แฟ้ม'] as const
const { getFileInfo } = useFileInfoStore()
const { currentFolder, currentFile, currentDept, currentPath } =
storeToRefs(useTreeDataStore())
@ -183,7 +183,22 @@ async function submitFileForm(
<template>
<div class="text-h6 q-mt-md" v-if="currentDept > 2">
{{ DEPT_NAME[currentDept] }}
<div class="flex justify-between">
{{ DEPT_NAME[currentDept] }}
<q-btn
v-if="currentDept != 4"
outline
push
class="q-px-md q-ml-md"
:label="'สร้าง' + DEPT_NAME[currentDept]"
type="submit"
color="primary"
dense
icon="add"
@click.stop="() => triggerFolderCreate()"
id="listViewFolderCreate"
/>
</div>
</div>
<div class="grid q-mt-md">
<div v-for="value in currentFolder" :data-pathname="value.pathname">
@ -278,7 +293,7 @@ async function submitFileForm(
}"
style="max-width: 100%"
>
สราง{{ DEPT_NAME[currentDept] }}ใหม
สราง{{ DEPT_NAME[currentDept] }}
</div>
</div>
</div>
@ -288,7 +303,21 @@ async function submitFileForm(
class="text-h6 q-mt-md"
v-if="currentDept > 2"
>
เอกสาร
<div class="flex justify-between">
เอกสาร
<q-btn
outline
push
class="q-px-md q-ml-md"
label="สร้างเอกสาร"
type="submit"
color="primary"
dense
icon="add"
@click.stop="() => triggerFileCreate()"
id="listViewFileCreate"
/>
</div>
</div>
<div class="grid q-mt-md">
<div v-for="(value, index) in currentFile" :data-pathname="value.pathname">
@ -374,7 +403,7 @@ async function submitFileForm(
class="text-overflow-handle block q-px-md text-center"
style="max-width: 100%"
>
สรางไฟลใหม
สรางเอกสาร
</div>
</div>
</div>
@ -480,4 +509,5 @@ async function submitFileForm(
.grid .box {
position: relative;
}
</style>