Commit 4962b894 authored by 田翔's avatar 田翔

fix: 附件必填校验bug

parent 6163ddd5
{
"name": "panda-xform",
"version": "2.3.7",
"description": "2.3.7: 时间格式自动补全年月日,关联表单只读形态修复,提示语样式调整",
"version": "2.3.8",
"description": "2.3.8: 附件必填校验bug",
"keywords": [
"panda-xform"
],
......
......@@ -134,9 +134,15 @@ const FileUpload = (props) => {
}
useEffect(() => {
if (value || presetValue) {
let fileList = [];
let list = (value || presetValue) && !(value || presetValue).includes('拍照相册') ? (value || presetValue).split(',') : []
if (presetValue && !presetValue.includes('拍照相册')) {
onChange(presetValue)
}
}, [presetValue])
useEffect(() => {
if (value) {
let fileList = []
let list = value ? value.split(',') : []
list.forEach((item, index) => {
if (item) { // @Tips: 直接过滤掉名字中有异常字符的文件
let uid = index + '_' + Math.random()
......@@ -158,7 +164,7 @@ const FileUpload = (props) => {
})
setShowList(JSON.stringify(fileList))
}
}, [value, presetValue])
}, [value])
return (
<div className={styles.uploadBox}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment