6363 }}
6464 </el-text >
6565 </p >
66- <p >TXT、MD、DOCX、HTML、CSV、XLSX、XLS、PDF </p >
66+ <p >{{ documentExtensions.map(s => s.toUpperCase()).join('、') }} </p >
6767 </div >
6868 </div >
6969 <el-checkbox
9393 }}
9494 </el-text >
9595 </p >
96- <p >JPG、JPEG、PNG、GIF </p >
96+ <p >{{ imageExtensions.map(s => s.toUpperCase()).join('、') }} </p >
9797 </div >
9898 </div >
9999 <el-checkbox v-model =" form_data.image" @change =" form_data.image = !form_data.image" />
121121 }}
122122 </el-text >
123123 </p >
124- <p >MP3、WAV、OGG、ACC、M4A </p >
124+ <p >{{ audioExtensions.map(s => s.toUpperCase()).join('、') }} </p >
125125 </div >
126126 </div >
127127 <el-checkbox v-model =" form_data.audio" @change =" form_data.audio = !form_data.audio" />
199199import { nextTick , ref } from ' vue'
200200import type { InputInstance } from ' element-plus'
201201import { cloneDeep } from ' lodash'
202+ import { MsgWarning } from ' @/utils/message'
203+ import { t } from ' @/locales'
202204
203205const emit = defineEmits ([' refresh' ])
204206const props = defineProps <{ nodeModel: any }>()
@@ -210,6 +212,10 @@ const loading = ref(false)
210212const fieldFormRef = ref ()
211213const InputRef = ref <InputInstance >()
212214
215+ const documentExtensions = [' txt' , ' md' , ' docx' , ' html' , ' csv' , ' xlsx' , ' xls' , ' pdf' ]
216+ const imageExtensions = [' jpg' , ' jpeg' , ' png' , ' gif' ]
217+ const audioExtensions = [' mp3' , ' wav' , ' ogg' , ' acc' , ' m4a' ]
218+
213219const form_data = ref ({
214220 maxFiles: 3 ,
215221 fileLimit: 50 ,
@@ -244,9 +250,15 @@ const showInput = () => {
244250}
245251const handleInputConfirm = () => {
246252 if (inputValue .value ) {
247- if (form_data .value .otherExtensions .includes (inputValue .value )) {
253+ if (
254+ form_data .value .otherExtensions .includes (inputValue .value ) ||
255+ documentExtensions .includes (inputValue .value ) ||
256+ imageExtensions .includes (inputValue .value ) ||
257+ audioExtensions .includes (inputValue .value )
258+ ) {
248259 inputVisible .value = false
249260 inputValue .value = ' '
261+ MsgWarning (t (' common.fileUpload.existingExtensionsTip' ))
250262 return
251263 }
252264 form_data .value .otherExtensions .push (inputValue .value )
0 commit comments