shaogen1995 1 vuosi sitten
vanhempi
commit
37e90394d5

+ 12 - 3
src/components/ZRichTexts/index.tsx

@@ -44,7 +44,14 @@ type Props = {
 };
 
 function ZRichTexts(
-  { check, dirCode, isLook, myUrl, isOne = false, upAudioBtnNone = false }: Props,
+  {
+    check,
+    dirCode,
+    isLook,
+    myUrl,
+    isOne = false,
+    upAudioBtnNone = false,
+  }: Props,
   ref: any
 ) {
   const [sectionArr, setSectionArr] = useState<SectionArrType[]>([
@@ -106,7 +113,8 @@ function ZRichTexts(
         let txt = "图片只支持png、jpg和jpeg格式!";
         let txt2 = "图片最大支持5M!";
 
-        const isVideoFlag = filesInfo.name.endsWith(".mp4");
+        const isVideoFlag =
+          filesInfo.name.endsWith(".mp4") || filesInfo.name.endsWith(".MP4");
 
         if (isVideoFlag) {
           // 上传视频
@@ -126,6 +134,7 @@ function ZRichTexts(
           e.target.value = "";
           return MessageFu.warning(txt2);
         }
+
         // 创建FormData对象
         const fd = new FormData();
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
@@ -350,7 +359,7 @@ function ZRichTexts(
                     readOnly={isLook}
                     value={item.name}
                     placeholder="请输入内容"
-                    maxLength={30}
+                    maxLength={100}
                     showCount
                     style={{ width: 400 }}
                     onChange={(e) => {

+ 42 - 9
src/pages/A1event/A1add/index.tsx

@@ -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}

+ 1 - 1
src/pages/A1event/index.tsx

@@ -119,7 +119,7 @@ function A1event() {
             <span>标题:</span>
             <Input
               key={inputKey}
-              maxLength={50}
+              maxLength={100}
               showCount
               style={{ width: 300 }}
               placeholder="请输入关键字"

+ 9 - 2
src/pages/A2exhibition/A2add/index.tsx

@@ -204,6 +204,12 @@ function A2add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
       // pc海报
       const coverUrl2 = ZupPcImgRef.current?.fileComFileResFu();
 
+      // 富文本标题集合
+      let rtfNameArr: string[] = [];
+      if (rtf.val && rtf.val.txtArr && rtf.val.txtArr.length) {
+        rtfNameArr = rtf.val.txtArr.map((v: any) => v.name);
+      }
+
       const obj = {
         ...values,
         id: editInfo.id > 0 ? editInfo.id : null,
@@ -222,6 +228,7 @@ function A2add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
         exhibitionFileIds: exhibitionFileIds.join(","),
         dirCode,
         typeRemark: timeVal,
+        rtfTitle: JSON.stringify(rtfNameArr),
       };
 
       // if (obj) {
@@ -390,7 +397,7 @@ function A2add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
                 {timeType === "long" ? (
                   <Input
                     style={{ width: 536 }}
-                    maxLength={50}
+                    maxLength={100}
                     showCount
                     value={timeVal}
                     onChange={(e) => setTimeVal(e.target.value)}
@@ -440,7 +447,7 @@ function A2add({ editInfo, closeFu, editTableFu, addTableFu }: Props) {
                 <Input
                   readOnly={editInfo.txt === "查看"}
                   style={{ width: 536, marginLeft: 14 }}
-                  maxLength={50}
+                  maxLength={100}
                   showCount
                   value={addrType.txt}
                   onChange={(e) => addrTypeChangeFu("txt", e.target.value)}

+ 1 - 1
src/pages/A2exhibition/index.tsx

@@ -124,7 +124,7 @@ function A2exhibition() {
             <span>标题:</span>
             <Input
               key={inputKey}
-              maxLength={50}
+              maxLength={100}
               showCount
               style={{ width: 300 }}
               placeholder="请输入关键字"

+ 2 - 2
src/pages/A3holding/A3add/index.tsx

@@ -243,7 +243,7 @@ function A3add({
           <Form.Item label="作者" name="author">
             <Input
               readOnly={editInfo.txt === "查看"}
-              maxLength={50}
+              maxLength={100}
               showCount
               placeholder="请输入内容"
             />
@@ -252,7 +252,7 @@ function A3add({
           <Form.Item label="尺寸" name="size">
             <Input
               readOnly={editInfo.txt === "查看"}
-              maxLength={50}
+              maxLength={100}
               showCount
               placeholder="请输入内容"
             />

+ 1 - 1
src/pages/A3holding/index.tsx

@@ -139,7 +139,7 @@ function A3holding() {
             <span>名称:</span>
             <Input
               key={inputKey}
-              maxLength={50}
+              maxLength={100}
               showCount
               style={{ width: 300 }}
               placeholder="请输入关键字"

+ 1 - 1
src/pages/A4study/index.tsx

@@ -120,7 +120,7 @@ function A4study() {
             <span>标题:</span>
             <Input
               key={inputKey}
-              maxLength={50}
+              maxLength={100}
               showCount
               style={{ width: 300 }}
               placeholder="请输入关键字"

+ 1 - 1
src/pages/A5publish/index.tsx

@@ -135,7 +135,7 @@ function A5publish() {
             <span>标题:</span>
             <Input
               key={inputKey}
-              maxLength={50}
+              maxLength={100}
               showCount
               style={{ width: 300 }}
               placeholder="请输入关键字"