|
|
@@ -195,10 +195,10 @@ function NewsAdd({
|
|
|
// 附件信息的校验
|
|
|
const fileCheckFu = useMemo(() => {
|
|
|
let flag = false;
|
|
|
- if (tableType === "news" && imgList.length === 0) flag = true;
|
|
|
if (tableType !== "news" && !fileOne.filePath) flag = true;
|
|
|
+ if (tableType === "news") flag = false;
|
|
|
return flag;
|
|
|
- }, [fileOne.filePath, imgList.length, tableType]);
|
|
|
+ }, [fileOne.filePath, tableType]);
|
|
|
|
|
|
// 没有通过校验
|
|
|
const onFinishFailed = useCallback(() => {
|
|
|
@@ -214,7 +214,7 @@ function NewsAdd({
|
|
|
if (fileCheckFu) return;
|
|
|
|
|
|
let thumb = "";
|
|
|
- if (tableType === "news") thumb = imgList[0].filePath;
|
|
|
+ if (tableType === "news") thumb = imgList[0] ? imgList[0].filePath : "";
|
|
|
else thumb = fileOne.filePath;
|
|
|
const obj = {
|
|
|
...values,
|
|
|
@@ -319,9 +319,7 @@ function NewsAdd({
|
|
|
|
|
|
{/* 上传附件图片 */}
|
|
|
<div className="myformBox">
|
|
|
- <div className="label">
|
|
|
- <span>*</span> 图片:
|
|
|
- </div>
|
|
|
+ <div className="label">图片:</div>
|
|
|
<>
|
|
|
<div className="fileBoxRow_r">
|
|
|
<div className="upImgBox">
|