|
@@ -35,8 +35,11 @@ function A1add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
|
|
|
// 表单的ref
|
|
|
const FormBoxRef = useRef<FormInstance>(null);
|
|
|
|
|
|
- // 封面图的ref
|
|
|
- const ZupThumbRef = useRef<any>(null);
|
|
|
+ // pc封面图的ref
|
|
|
+ const ZupPcRef = useRef<any>(null);
|
|
|
+
|
|
|
+ // 移动端封面图的ref
|
|
|
+ const ZupAppRef = useRef<any>(null);
|
|
|
|
|
|
// 富文本的ref
|
|
|
const ZRichTextRef = useRef<any>(null);
|
|
@@ -84,9 +87,13 @@ function A1add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
|
|
|
FormBoxRef.current?.setFieldsValue(obj);
|
|
|
|
|
|
// 设置封面图
|
|
|
- ZupThumbRef.current?.setFileComFileFu({
|
|
|
+ ZupPcRef.current?.setFileComFileFu({
|
|
|
+ fileName: "",
|
|
|
+ filePath: data.thumbPc,
|
|
|
+ });
|
|
|
+ ZupAppRef.current?.setFileComFileFu({
|
|
|
fileName: "",
|
|
|
- filePath: data.thumb,
|
|
|
+ filePath: data.thumbApp,
|
|
|
});
|
|
|
}
|
|
|
}, []);
|
|
@@ -132,10 +139,13 @@ function A1add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
|
|
|
dateStart = dayjs(timeLong2[0]).format("YYYY-MM-DD");
|
|
|
dateEnd = dayjs(timeLong2[1]).format("YYYY-MM-DD");
|
|
|
}
|
|
|
+ const thumbPc = ZupPcRef.current?.fileComFileResFu();
|
|
|
+ // 没有传 封面图
|
|
|
+ if (!thumbPc.filePath) return MessageFu.warning("请上传PC端封面!");
|
|
|
|
|
|
- const coverUrl1 = ZupThumbRef.current?.fileComFileResFu();
|
|
|
+ const thumbApp = ZupAppRef.current?.fileComFileResFu();
|
|
|
// 没有传 封面图
|
|
|
- if (!coverUrl1.filePath) return MessageFu.warning("请上传封面图!");
|
|
|
+ if (!thumbApp.filePath) return MessageFu.warning("请上传移动端封面!");
|
|
|
|
|
|
// 发布日期
|
|
|
const datePublish = dayjs(values.myTime).format("YYYY-MM-DD");
|
|
@@ -149,7 +159,8 @@ function A1add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
|
|
|
...values,
|
|
|
id: editInfo.id > 0 ? editInfo.id : null,
|
|
|
datePublish,
|
|
|
- thumb: coverUrl1.filePath,
|
|
|
+ thumbPc: thumbPc.filePath,
|
|
|
+ thumbApp: thumbApp.filePath,
|
|
|
rtf: JSON.stringify(rtf.val || ""),
|
|
|
dateStart,
|
|
|
dateEnd,
|
|
@@ -227,11 +238,33 @@ function A1add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
|
|
|
<div className="formRow">
|
|
|
<div className="formLeft">
|
|
|
<span>* </span>
|
|
|
- 封面:
|
|
|
+ PC端封面:
|
|
|
+ </div>
|
|
|
+ <div className="formRight">
|
|
|
+ <ZupOne
|
|
|
+ ref={ZupPcRef}
|
|
|
+ isLook={editInfo.txt === "查看"}
|
|
|
+ fileCheck={fileCheck}
|
|
|
+ size={5}
|
|
|
+ dirCode={dirCode}
|
|
|
+ myUrl="cms/event/upload"
|
|
|
+ format={["image/jpeg", "image/png"]}
|
|
|
+ formatTxt="png、jpg和jpeg"
|
|
|
+ checkTxt="请上传封面图!"
|
|
|
+ upTxt="最多1张"
|
|
|
+ myType="thumb"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="formRow">
|
|
|
+ <div className="formLeft">
|
|
|
+ <span>* </span>
|
|
|
+ 移动端封面:
|
|
|
</div>
|
|
|
<div className="formRight">
|
|
|
<ZupOne
|
|
|
- ref={ZupThumbRef}
|
|
|
+ ref={ZupAppRef}
|
|
|
isLook={editInfo.txt === "查看"}
|
|
|
fileCheck={fileCheck}
|
|
|
size={5}
|