培训文件限制只能上传pdf
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-08-01 17:02:55 +08:00
parent b644098203
commit 233bcbb1d0
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@
<!-- 文件 --> <!-- 文件 -->
<el-form-item :label="$t('trials:attachment:form:file')"> <el-form-item :label="$t('trials:attachment:form:file')">
<div class="upload-container"> <div class="upload-container">
<el-upload class="upload-demo" action accept=".pdf,.mp4" :before-upload="beforeUpload" <el-upload class="upload-demo" action accept=".pdf" :before-upload="beforeUpload"
:http-request="handleUploadFile" :on-remove="handleRemoveFile" :show-file-list="true" :file-list="fileList" :http-request="handleUploadFile" :on-remove="handleRemoveFile" :show-file-list="true" :file-list="fileList"
:limit="1" :on-exceed="handleExceed" :disabled="form.FileTypeId === ''"> :limit="1" :on-exceed="handleExceed" :disabled="form.FileTypeId === ''">
<el-button size="small" type="primary" :disabled="form.FileTypeId === '' || saveBtnLoading" <el-button size="small" type="primary" :disabled="form.FileTypeId === '' || saveBtnLoading"
@ -218,7 +218,7 @@ export default {
}, },
// pdf // pdf
checkFileSuffix(fileName) { checkFileSuffix(fileName) {
var typeArr = ['pdf', 'mp4'] var typeArr = ['pdf']
var extendName = fileName.substring(fileName.lastIndexOf('.') + 1).toLocaleLowerCase() var extendName = fileName.substring(fileName.lastIndexOf('.') + 1).toLocaleLowerCase()
if (typeArr.indexOf(extendName) !== -1) { if (typeArr.indexOf(extendName) !== -1) {
return true return true