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

fix: 附件必填校验bug

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