fix: isPreview 2 isFilePreview & getFileNameFormat
This commit is contained in:
parent
3e570b71aa
commit
bc0212b0f1
7 changed files with 40 additions and 43 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue