fix: check fileName2long? & close after submit
This commit is contained in:
parent
bb59390063
commit
0511d4285f
4 changed files with 36 additions and 13 deletions
|
|
@ -96,7 +96,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
|||
currentPath.value = pathname
|
||||
|
||||
const res = await axiosClient.get<EhrFolder[]>(
|
||||
`${apiEndpoint}${requestPath}`
|
||||
`${apiEndpoint}${requestPath}`,
|
||||
)
|
||||
|
||||
const list = res.data.map((v) => ({
|
||||
|
|
@ -248,7 +248,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
|||
description: string
|
||||
keyword: string
|
||||
category: string
|
||||
}
|
||||
},
|
||||
) {
|
||||
loader.show()
|
||||
|
||||
|
|
@ -268,7 +268,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
|||
{
|
||||
file: file.name,
|
||||
...metadata,
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
if (res && res.data.upload) {
|
||||
|
|
@ -297,7 +297,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
|||
keyword: string
|
||||
category: string
|
||||
},
|
||||
file?: File
|
||||
file?: File,
|
||||
) {
|
||||
loader.show()
|
||||
|
||||
|
|
@ -312,7 +312,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
|||
|
||||
const res = await axiosClient.patch<{ upload: string }>(
|
||||
`${apiEndpoint}${requestPath}`,
|
||||
{ file: file?.name, ...metadata }
|
||||
{ file: file?.name, ...metadata },
|
||||
)
|
||||
|
||||
if (res && res.data.upload) {
|
||||
|
|
@ -362,6 +362,10 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
|||
return currentFile.value.some((element) => element.fileName === fileName)
|
||||
}
|
||||
|
||||
function checkFileName(fileName: string) {
|
||||
return fileName.length >= 85
|
||||
}
|
||||
|
||||
return {
|
||||
data,
|
||||
currentFolder,
|
||||
|
|
@ -380,5 +384,6 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
|||
deleteFolder,
|
||||
editFolder,
|
||||
checkFile,
|
||||
checkFileName,
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue