fix: isPreview 2 isFilePreview & getFileNameFormat

This commit is contained in:
puri-ph4tt 2023-11-29 11:16:50 +07:00 committed by Methapon2001
parent 3e570b71aa
commit bc0212b0f1
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
7 changed files with 40 additions and 43 deletions

View file

@ -15,11 +15,8 @@ const props = withDefaults(
action: false,
}
)
const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แฟ้ม', 'แฟ้มย่อย'] as const
const { isPreview } = storeToRefs(useFileInfoStore())
const { getFileInfo } = useFileInfoStore()
const { getFileInfo, getFileNameFormat } = useFileInfoStore()
const { currentFolder, currentFile, currentDept, currentPath } = storeToRefs(
useTreeDataStore()
)
@ -108,13 +105,6 @@ function triggerFileEdit(
}
}
function getFileNameFormat(fileName: string): string {
const dotIndex = fileName.lastIndexOf('.')
const fileNameOnly = fileName.substring(0, dotIndex)
return fileNameOnly
}
async function submitFileForm(value: {
mode: 'create' | 'edit'
file: File
@ -278,10 +268,7 @@ async function submitFileForm(value: {
class="inline-block"
>
<div class="box border-radius-inherit">
<q-card
flat
@click="() => (getFileInfo(currentFile[index]), (isPreview = true))"
>
<q-card flat @click="() => getFileInfo(currentFile[index])">
<q-card-section class="column justify-center relative q-px-xl">
<file-icon
size="preview"