|
|
|
@ -109,7 +109,7 @@ |
|
|
|
<el-button :disabled="getDisabled()" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" |
|
|
|
size="small" type="primary">点击上传</el-button> |
|
|
|
<span v-if="error" class="atta-tips">请上传附件</span> |
|
|
|
<div slot="tip" class="el-upload__tip">支持扩展名:.rar .zip .doc .docx .pdf .jpg,文件大小不超过2MB</div> |
|
|
|
<div slot="tip" class="el-upload__tip">支持扩展名:.{{allowedTypes.join('. ')}},文件大小不超过2MB</div> |
|
|
|
</el-upload> |
|
|
|
</template> |
|
|
|
<div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-wrapper" |
|
|
|
@ -341,8 +341,8 @@ export default { |
|
|
|
picker.$emit('pick', new Date()); |
|
|
|
} |
|
|
|
}] |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
allowedTypes: ["zip","rar","doc","docx","pdf","jpg"], |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
@ -423,13 +423,11 @@ export default { |
|
|
|
handleChange(file, fileList) { |
|
|
|
// 如果是新添加的文件(status为ready),进行验证 |
|
|
|
if (file.status === 'ready') { |
|
|
|
const isAllowedType = ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', |
|
|
|
'application/x-rar-compressed', 'application/zip', |
|
|
|
'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'].includes(file.raw.type) |
|
|
|
const suffix = file.name.split('.').pop().toLowerCase(); |
|
|
|
const isAllowedType = this.allowedTypes.includes(suffix) |
|
|
|
const isLt2M = file.size / 1024 / 1024 < 2 |
|
|
|
|
|
|
|
if (!isAllowedType) { |
|
|
|
this.$message.error(`文件 ${file.name} 格式不支持!只能上传 JPG/PNG/GIF/PDF/RAR/ZIP/DOC/DOCX 格式的文件`) |
|
|
|
this.$message.error(`文件 ${file.name} 格式不支持!只能上传 ${this.allowedTypes.join('/')} 格式的文件`) |
|
|
|
// 从fileList中移除该文件 |
|
|
|
const index = fileList.indexOf(file); |
|
|
|
if (index > -1) { |
|
|
|
@ -1744,16 +1742,16 @@ export default { |
|
|
|
.clickable, |
|
|
|
.el-date-editor, |
|
|
|
.el-checkbox__inner { |
|
|
|
border-color: #ff5d5d !important; |
|
|
|
border: 1px solid #ff5d5d !important; |
|
|
|
box-shadow: 0 0 6px #ffc3c3 !important; |
|
|
|
|
|
|
|
&:focus { |
|
|
|
border-color: #ff5d5d !important; |
|
|
|
border: 1px solid #ff5d5d !important; |
|
|
|
box-shadow: 0 0 6px #ffc3c3 !important; |
|
|
|
} |
|
|
|
|
|
|
|
&:hover { |
|
|
|
border-color: #ff5d5d; |
|
|
|
border: 1px solid #ff5d5d !important; |
|
|
|
box-shadow: 0 0 6px #ffc3c3 !important; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1761,14 +1759,14 @@ export default { |
|
|
|
// 为 el-select 和 el-date-picker 添加错误边框样式 |
|
|
|
.el-select .el-input__inner, |
|
|
|
.el-date-editor .el-input__inner .el-checkbox__inner { |
|
|
|
border-color: #ff5d5d; |
|
|
|
border: 1px solid #ff5d5d !important; |
|
|
|
box-shadow: 0 0 6px #ffc3c3 !important; |
|
|
|
} |
|
|
|
|
|
|
|
// 处理 DecimalInput 组件的错误边框样式 |
|
|
|
:deep(.el-input-number) { |
|
|
|
.el-input-number { |
|
|
|
.el-input__inner { |
|
|
|
border-color: #ff5d5d; |
|
|
|
border: 1px solid #ff5d5d !important; |
|
|
|
box-shadow: 0 0 6px #ffc3c3 !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|