feat: update video file extensions and clean up code formatting in file upload settings

v3.2
wxg0103 2025-10-22 15:00:48 +08:00
parent b36e8f5350
commit 678122fe9e
3 changed files with 20 additions and 18 deletions

View File

@ -403,7 +403,7 @@ const upload = ref()
const imageExtensions = ['JPG', 'JPEG', 'PNG', 'GIF', 'BMP'] const imageExtensions = ['JPG', 'JPEG', 'PNG', 'GIF', 'BMP']
const documentExtensions = ['PDF', 'DOCX', 'TXT', 'XLS', 'XLSX', 'MD', 'HTML', 'CSV'] const documentExtensions = ['PDF', 'DOCX', 'TXT', 'XLS', 'XLSX', 'MD', 'HTML', 'CSV']
const videoExtensions: any = ['MP4', 'MOV', 'AVI'] const videoExtensions: any = ['MP4', 'AVI', 'MKV', 'MOV', 'FLV', 'WMV']
const audioExtensions = ['MP3', 'WAV', 'OGG', 'AAC', 'M4A'] const audioExtensions = ['MP3', 'WAV', 'OGG', 'AAC', 'M4A']
const otherExtensions = ref(['PPT', 'DOC']) const otherExtensions = ref(['PPT', 'DOC'])

View File

@ -523,6 +523,8 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean, other_para
: [], : [],
audio_list: audio_list:
other_params_data && other_params_data.audio_list ? other_params_data.audio_list : [], other_params_data && other_params_data.audio_list ? other_params_data.audio_list : [],
video_list:
other_params_data && other_params_data.video_list ? other_params_data.video_list : [],
other_list: other_list:
other_params_data && other_params_data.other_list ? other_params_data.other_list : [], other_params_data && other_params_data.other_list ? other_params_data.other_list : [],
}, },

View File

@ -51,7 +51,7 @@
> >
<div class="flex-between"> <div class="flex-between">
<div class="flex align-center"> <div class="flex align-center">
<img class="mr-12" src="@/assets/workflow/icon_file-doc.svg" alt="" /> <img class="mr-12" src="@/assets/workflow/icon_file-doc.svg" alt=""/>
<div> <div>
<p class="line-height-22 mt-4"> <p class="line-height-22 mt-4">
{{ $t('common.fileUpload.document') }} {{ $t('common.fileUpload.document') }}
@ -81,7 +81,7 @@
> >
<div class="flex-between"> <div class="flex-between">
<div class="flex align-center"> <div class="flex align-center">
<img class="mr-12" src="@/assets/workflow/icon_file-image.svg" alt="" /> <img class="mr-12" src="@/assets/workflow/icon_file-image.svg" alt=""/>
<div> <div>
<p class="line-height-22 mt-4"> <p class="line-height-22 mt-4">
{{ $t('common.fileUpload.image') }} {{ $t('common.fileUpload.image') }}
@ -96,7 +96,7 @@
<p>{{ imageExtensions.join('、') }}</p> <p>{{ imageExtensions.join('、') }}</p>
</div> </div>
</div> </div>
<el-checkbox v-model="form_data.image" @change="form_data.image = !form_data.image" /> <el-checkbox v-model="form_data.image" @change="form_data.image = !form_data.image"/>
</div> </div>
</el-card> </el-card>
@ -109,7 +109,7 @@
> >
<div class="flex-between"> <div class="flex-between">
<div class="flex align-center"> <div class="flex align-center">
<img class="mr-12" src="@/assets/workflow/icon_file-audio.svg" alt="" /> <img class="mr-12" src="@/assets/workflow/icon_file-audio.svg" alt=""/>
<div> <div>
<p class="line-height-22 mt-4"> <p class="line-height-22 mt-4">
{{ $t('common.fileUpload.audio') }} {{ $t('common.fileUpload.audio') }}
@ -124,10 +124,10 @@
<p>{{ audioExtensions.join('、') }}</p> <p>{{ audioExtensions.join('、') }}</p>
</div> </div>
</div> </div>
<el-checkbox v-model="form_data.audio" @change="form_data.audio = !form_data.audio" /> <el-checkbox v-model="form_data.audio" @change="form_data.audio = !form_data.audio"/>
</div> </div>
</el-card> </el-card>
<el-card <el-card
shadow="hover" shadow="hover"
class="card-checkbox cursor w-full mb-8" class="card-checkbox cursor w-full mb-8"
:class="form_data.video ? 'active' : ''" :class="form_data.video ? 'active' : ''"
@ -136,7 +136,7 @@
> >
<div class="flex-between"> <div class="flex-between">
<div class="flex align-center"> <div class="flex align-center">
<img class="mr-12" width="32" src="@/assets/workflow/icon_file-video.svg" alt="" /> <img class="mr-12" width="32" src="@/assets/workflow/icon_file-video.svg" alt=""/>
<div> <div>
<p class="line-height-22 mt-4"> <p class="line-height-22 mt-4">
{{ $t('common.fileUpload.video') }} {{ $t('common.fileUpload.video') }}
@ -151,7 +151,7 @@
<p>{{ videoExtensions.join('、') }}</p> <p>{{ videoExtensions.join('、') }}</p>
</div> </div>
</div> </div>
<el-checkbox v-model="form_data.video" @change="form_data.video = !form_data.video" /> <el-checkbox v-model="form_data.video" @change="form_data.video = !form_data.video"/>
</div> </div>
</el-card> </el-card>
<el-card <el-card
@ -163,7 +163,7 @@
> >
<div class="flex-between"> <div class="flex-between">
<div class="flex align-center"> <div class="flex align-center">
<img class="mr-12" :width="32" src="@/assets/fileType/unknown-icon.svg" alt="" /> <img class="mr-12" :width="32" src="@/assets/fileType/unknown-icon.svg" alt=""/>
<div> <div>
<p class="line-height-22 mt-4"> <p class="line-height-22 mt-4">
{{ $t('common.fileUpload.other') }} {{ $t('common.fileUpload.other') }}
@ -206,7 +206,7 @@
</el-space> </el-space>
</div> </div>
</div> </div>
<el-checkbox v-model="form_data.other" @change="form_data.other = !form_data.other" /> <el-checkbox v-model="form_data.other" @change="form_data.other = !form_data.other"/>
</div> </div>
</el-card> </el-card>
</el-form-item> </el-form-item>
@ -223,11 +223,11 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, ref } from 'vue' import {nextTick, ref} from 'vue'
import type { InputInstance } from 'element-plus' import type {InputInstance} from 'element-plus'
import { cloneDeep } from 'lodash' import {cloneDeep} from 'lodash'
import { MsgWarning } from '@/utils/message' import {MsgWarning} from '@/utils/message'
import { t } from '@/locales' import {t} from '@/locales'
const emit = defineEmits(['refresh']) const emit = defineEmits(['refresh'])
const props = defineProps<{ nodeModel: any }>() const props = defineProps<{ nodeModel: any }>()
@ -242,7 +242,7 @@ const InputRef = ref<InputInstance>()
const documentExtensions = ['TXT', 'MD', 'DOCX', 'HTML', 'CSV', 'XLSX', 'XLS', 'PDF'] const documentExtensions = ['TXT', 'MD', 'DOCX', 'HTML', 'CSV', 'XLSX', 'XLS', 'PDF']
const imageExtensions = ['JPG', 'JPEG', 'PNG', 'GIF'] const imageExtensions = ['JPG', 'JPEG', 'PNG', 'GIF']
const audioExtensions = ['MP3', 'WAV', 'OGG', 'ACC', 'M4A'] const audioExtensions = ['MP3', 'WAV', 'OGG', 'ACC', 'M4A']
const videoExtensions: any = ['MP4', 'MOV', 'AVI'] const videoExtensions: any = ['MP4', 'AVI', 'MKV', 'MOV', 'FLV', 'WMV']
const form_data = ref({ const form_data = ref({
maxFiles: 3, maxFiles: 3,
@ -258,7 +258,7 @@ const form_data = ref({
function open(data: any) { function open(data: any) {
dialogVisible.value = true dialogVisible.value = true
nextTick(() => { nextTick(() => {
form_data.value = { ...form_data.value, ...data } form_data.value = {...form_data.value, ...data}
}) })
} }