feat: block upload file replace other system file
This commit is contained in:
parent
fb70e5174a
commit
b100da112d
4 changed files with 12 additions and 19 deletions
|
|
@ -22,12 +22,12 @@ const fileFormData = ref<{
|
|||
}>({})
|
||||
const fileFormType = ref<'edit' | 'create'>('create')
|
||||
const fileFormError = ref<{
|
||||
fileExistMetadata?: boolean
|
||||
externalFileExist?: boolean
|
||||
fileExist?: boolean
|
||||
fileName2Long?: boolean
|
||||
}>({})
|
||||
const fileExistNotification = ref<boolean>(false)
|
||||
const errorState = ref<'fileExist' | 'fileExistMetadata'>('fileExist')
|
||||
const errorState = ref<'fileExist' | 'externalFileExist'>('fileExist')
|
||||
const fileFormComponent = ref<InstanceType<typeof FileForm>>()
|
||||
const fileNameLabel = ref<string>()
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ async function submitFileForm(
|
|||
|
||||
if (fileInfo?.metadata && Object.keys(fileInfo.metadata).length > 0) {
|
||||
fileExistNotification.value = true
|
||||
errorState.value = 'fileExistMetadata'
|
||||
errorState.value = 'externalFileExist'
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ async function submitFileForm(
|
|||
@reset="() => (fileFormError = {})"
|
||||
@filechange="
|
||||
(name: string) => {
|
||||
fileFormError.fileExistMetadata = checkFileExistMetadata(name)
|
||||
fileFormError.externalFileExist = checkFileExistMetadata(name)
|
||||
;(fileFormError.fileExist = checkFileExist(name, fileNameLabel)),
|
||||
(fileFormError.fileName2Long = checkFileName2Long(
|
||||
name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue