Merge branch 'net' into development

This commit is contained in:
somnetsak123 2023-12-01 09:26:44 +07:00
commit 7b894383da
4 changed files with 27 additions and 27 deletions

View file

@ -29,7 +29,6 @@
"vue-router": "^4.2.5" "vue-router": "^4.2.5"
}, },
"devDependencies": { "devDependencies": {
"@mayank1513/vue-tag-input": "^1.2.0",
"@quasar/vite-plugin": "^1.6.0", "@quasar/vite-plugin": "^1.6.0",
"@rushstack/eslint-patch": "^1.6.0", "@rushstack/eslint-patch": "^1.6.0",
"@types/jsdom": "^21.1.6", "@types/jsdom": "^21.1.6",

View file

@ -19,8 +19,8 @@ const props = withDefaults(
mode: 'create' | 'edit' mode: 'create' | 'edit'
title?: string title?: string
description?: string description?: string
keyword?: string keyword?: string[]
category?: string category?: string[]
}>(), }>(),
{ {
open: false, open: false,

View file

@ -15,12 +15,13 @@ const props = withDefaults(
defineProps<{ action: boolean; viewMode: 'view_list' | 'view_module' }>(), defineProps<{ action: boolean; viewMode: 'view_list' | 'view_module' }>(),
{ {
action: false, action: false,
}, }
) )
const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แฟ้ม', 'แฟ้มย่อย'] as const const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แฟ้ม', 'แฟ้มย่อย'] as const
const { getFileInfo, getFileNameFormat } = useFileInfoStore() const { getFileInfo, getFileNameFormat } = useFileInfoStore()
const { currentFolder, currentFile, currentDept, currentPath } = const { currentFolder, currentFile, currentDept, currentPath } = storeToRefs(
storeToRefs(useTreeDataStore()) useTreeDataStore()
)
const { const {
createFolder, createFolder,
editFolder, editFolder,
@ -36,8 +37,8 @@ const currentIcon = computed(() =>
currentDept.value === 0 currentDept.value === 0
? 'mdi-file-cabinet' ? 'mdi-file-cabinet'
: currentDept.value === 1 : currentDept.value === 1
? 'inbox' ? 'inbox'
: 'o_folder_open', : 'o_folder_open'
) )
const dialogDeleteState = ref<boolean>(false) const dialogDeleteState = ref<boolean>(false)
@ -56,8 +57,8 @@ const fileFormData = ref<{
file?: File file?: File
title?: string title?: string
description?: string description?: string
keyword?: string keyword?: string[]
category?: string category?: string[]
}>({}) }>({})
const fileFormType = ref<'edit' | 'create'>('create') const fileFormType = ref<'edit' | 'create'>('create')
const fileFormError = ref<{ fileExist?: boolean }>({}) const fileFormError = ref<{ fileExist?: boolean }>({})
@ -109,10 +110,10 @@ function triggerFileEdit(
value: { value: {
title: string title: string
description: string description: string
keyword: string keyword: string[]
category: string category: string[]
}, },
pathname: string, pathname: string
) { ) {
fileFormState.value = true fileFormState.value = true
fileFormType.value = 'edit' fileFormType.value = 'edit'
@ -121,7 +122,7 @@ function triggerFileEdit(
title: value.title, title: value.title,
description: value.description, description: value.description,
keyword: value.keyword, keyword: value.keyword,
category: value.keyword, category: value.category,
} }
} }
@ -136,7 +137,7 @@ async function submitFileForm(
keyword: string[] keyword: string[]
category: string[] category: string[]
}, },
force = false, force = false
) { ) {
currentParam.value = value currentParam.value = value
@ -149,8 +150,8 @@ async function submitFileForm(
await uploadFile(currentPath.value, value.file, { await uploadFile(currentPath.value, value.file, {
title: value.title, title: value.title,
description: value.description, description: value.description,
keyword: value.keyword.join(''), keyword: value.keyword,
category: value.category.join(''), category: value.category,
}) })
} else { } else {
await updateFile( await updateFile(
@ -158,10 +159,10 @@ async function submitFileForm(
{ {
title: value.title, title: value.title,
description: value.description, description: value.description,
keyword: value.keyword.join(''), keyword: value.keyword,
category: value.category.join(''), category: value.category,
}, },
value.file, value.file
) )
} }
fileFormData.value = {} fileFormData.value = {}
@ -306,10 +307,10 @@ async function submitFileForm(
{ {
title: value.title, title: value.title,
description: value.description, description: value.description,
keyword: value.keyword.join(','), keyword: value.keyword,
category: value.category.join(','), category: value.category,
}, },
value.pathname, value.pathname
) )
" "
@delete="() => triggerFileDelete(value.pathname)" @delete="() => triggerFileDelete(value.pathname)"

View file

@ -246,8 +246,8 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
metadata: { metadata: {
title: string title: string
description: string description: string
keyword: string keyword: string[]
category: string category: string[]
}, },
) { ) {
loader.show() loader.show()
@ -294,8 +294,8 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
metadata: { metadata: {
title: string title: string
description: string description: string
keyword: string keyword: string[]
category: string category: string[]
}, },
file?: File, file?: File,
) { ) {