fix: update file upload settings to allow dynamic video extensions and improve input handling for other file types

This commit is contained in:
CaptainB 2025-04-22 16:20:01 +08:00
parent b97f4e16ba
commit f646102262
2 changed files with 10 additions and 5 deletions

View File

@ -345,7 +345,7 @@ const upload = ref()
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
const documentExtensions = ['pdf', 'docx', 'txt', 'xls', 'xlsx', 'md', 'html', 'csv']
const videoExtensions = ['mp4', 'avi', 'mov', 'mkv', 'flv']
const videoExtensions: any = []
const audioExtensions = ['mp3', 'wav', 'ogg', 'aac', 'm4a']
let otherExtensions = ['ppt', 'doc']

View File

@ -56,7 +56,7 @@
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.document') }}
<el-text class="color-secondary"
>{{
>{{
$t(
'views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText'
)
@ -86,7 +86,7 @@
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.image') }}
<el-text class="color-secondary"
>{{
>{{
$t(
'views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText'
)
@ -114,7 +114,7 @@
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.audio') }}
<el-text class="color-secondary"
>{{
>{{
$t(
'views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText'
)
@ -141,7 +141,7 @@
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.other') }}
<el-text class="color-secondary"
>{{
>{{
$t(
'views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText'
)
@ -244,6 +244,11 @@ const showInput = () => {
}
const handleInputConfirm = () => {
if (inputValue.value) {
if (form_data.value.otherExtensions.includes(inputValue.value)) {
inputVisible.value = false
inputValue.value = ''
return
}
form_data.value.otherExtensions.push(inputValue.value)
}
inputVisible.value = false