shaogen1995 1 年之前
父節點
當前提交
1eb39ddeef

+ 3 - 3
src/components/ZRichText/index.module.scss

@@ -9,9 +9,9 @@
         display: none;
       }
 
-      .bf-content {
-        height: 300px;
-      }
+      // .bf-content {
+      //   height: 300px;
+      // }
 
       .bf-controlbar {
         position: relative;

+ 4 - 2
src/components/ZupTypes/index.tsx

@@ -44,6 +44,7 @@ type Props = {
   imgLength?: number; //图片数量限制
   audioSize?: number; //音频大小限制
   videoSize?: number; //视频大小限制
+  videoTit?: string; //视频上传的提示语
 };
 
 function ZupTypes(
@@ -58,6 +59,7 @@ function ZupTypes(
     imgLength = 9,
     audioSize = 10,
     videoSize = 500,
+    videoTit = "",
   }: Props,
   ref: any
 ) {
@@ -284,7 +286,7 @@ function ZupTypes(
                   ? `仅支持4dage格式的模型文件,大小不能超过${modelSize}M。`
                   : type === "audio"
                   ? `仅支持mp3格式的音频文件,大小不得超过${audioSize}MB。`
-                  : `仅支持mp4格式的视频文件,大小不得超过${videoSize}MB。`}
+                  : `仅支持mp4格式的视频文件,大小不得超过${videoSize}MB。${videoTit}`}
               </div>
             </>
           )}
@@ -292,7 +294,7 @@ function ZupTypes(
       );
       return dom;
     },
-    [audioSize, fileList, modelSize, typeCheck, upFileFu, videoSize]
+    [audioSize, fileList, modelSize, typeCheck, upFileFu, videoSize, videoTit]
   );
 
   // ------------让父组件调用的 回显

+ 1 - 1
src/pages/A4exhibit/A4add/index.tsx

@@ -151,7 +151,7 @@ function A4add({ addId, closeFu, addTableFu, editTableFu }: Props) {
                 format={["image/jpeg", "image/png"]}
                 formatTxt="png、jpg和jpeg"
                 checkTxt="请上传封面图"
-                upTxt="最多1张"
+                upTxt="最多1张。建议封面图比例 16 : 9"
                 myType="thumb"
               />
             </div>

+ 2 - 0
src/pages/A5goods/A5add/index.tsx

@@ -261,6 +261,8 @@ function A5add({ addId, closeFu, addTableFu, editTableFu }: Props) {
                 myUrl="cms/goods/upload"
                 // 音频大小
                 audioSize={50}
+                // 视频上传的提示语
+                videoTit="建议视频尺寸比例 16 : 9"
               />
             </div>
           </div>

+ 0 - 107
src/pages/A6_1ques/A6Qadd/index.module.scss

@@ -14,7 +14,6 @@
       width: 100%;
       height: 100%;
       overflow-y: auto;
-      padding-bottom: 30px;
 
       #basic {
         width: 1092px;
@@ -36,112 +35,6 @@
 
         .formRight {
           width: calc(100% - 92px);
-
-          // 题目的定制化样式
-          .A6Qlist2 {
-            width: 100%;
-
-            .A6Qlist2Son {
-              margin-top: 20px;
-              width: 100%;
-              position: relative;
-              border-radius: 6px;
-              border: 1px solid #ccc;
-              padding: 15px;
-
-              .A6Q2del {
-                position: absolute;
-                top: 0px;
-                left: -50px;
-                width: 32px;
-                height: 32px;
-                text-align: center;
-                line-height: 32px;
-                border-radius: 4px;
-                color: #fff;
-                background-color: var(--themeColor);
-                font-size: 20px;
-                cursor: pointer;
-              }
-
-              .A6Q2_1 {
-                display: flex;
-                width: 100%;
-
-                &>div {
-                  &:nth-of-type(1) {
-                    &>span {
-                      color: #ff4d4f;
-                    }
-
-                    width: 70px;
-                  }
-
-                  &:nth-of-type(2) {
-                    width: calc(100% - 70px);
-                  }
-
-                  .A6text {
-                    textarea {
-                      min-height: 70px !important;
-                    }
-                  }
-                }
-              }
-
-              .A6Q2_2 {
-                padding-left: 70px;
-                margin-top: 15px;
-
-                .A6Q2_21main {
-                  .A6Q2_21Son {
-                    margin-top: 15px;
-                    display: flex;
-                    align-items: center;
-
-                    &>div {
-                      &:nth-of-type(1) {
-                        &>span {
-                          color: #ff4d4f;
-                        }
-
-                        width: 70px;
-                      }
-
-                      &:nth-of-type(2) {
-                        width: calc(100% - 350px);
-                      }
-                    }
-
-                    .A6Q2del2 {
-                      margin-left: 15px;
-                      width: 32px;
-                      height: 32px;
-                      text-align: center;
-                      line-height: 32px;
-                      border-radius: 4px;
-                      color: #fff;
-                      background-color: var(--themeColor);
-                      font-size: 20px;
-                      cursor: pointer;
-                    }
-                    .A6Q2skip2{
-                      margin-left: 15px;
-                    }
-                  }
-
-                }
-
-                .A6Q2_22 {
-                  margin-top: 15px;
-                }
-              }
-            }
-
-            .A6Qlist2SonErr {
-              border-color: #ff4d4f;
-            }
-          }
         }
       }
     }

+ 1 - 1
src/pages/A6_1ques/A6Qadd/index.tsx

@@ -88,7 +88,7 @@ function A6Qadd({ sInfo, closeFu }: Props) {
             <div className="formRight">
               <ZRichText
                 check={false}
-                dirCode="A6Q"
+                dirCode="A6QText"
                 isLook={false}
                 ref={ZRichTextRef}
                 // 待完善路径

+ 22 - 18
src/pages/A6_1ques/A6Qtopic/QTadd.tsx

@@ -22,21 +22,21 @@ const oneObj: A6QListType = {
 };
 
 type Props = {
-  moId: number;
+  moInfo: { id: number; num: number };
   closeFu: () => void;
-  tableLen: number;
+  tableLen: number; //当前已经有的题目数量(表格)
 };
 
-function QTadd({ moId, closeFu, tableLen }: Props) {
+function QTadd({ moInfo, closeFu, tableLen }: Props) {
   const getInfoFu = useCallback(async (id: number) => {}, []);
 
   useEffect(() => {
-    if (moId > 0) getInfoFu(moId);
+    if (moInfo.id > 0) getInfoFu(moInfo.id);
     else {
       // 新增
       setList([oneObj]);
     }
-  }, [getInfoFu, moId]);
+  }, [getInfoFu, moInfo.id]);
 
   // 是否 已经点击过确定
   const [fileCheck, setFileCheck] = useState(false);
@@ -98,7 +98,7 @@ function QTadd({ moId, closeFu, tableLen }: Props) {
     [list]
   );
 
-  // 信息的改变(去掉跳题)
+  // 信息的改变(不包含 选择跳题 题目的下拉框)
   const dataChangeFu = useCallback(
     (
       e: string | boolean,
@@ -141,7 +141,7 @@ function QTadd({ moId, closeFu, tableLen }: Props) {
     [list]
   );
 
-  // 跳题的改变
+  // 选择跳题 题目的下拉框
   const skipChangeFu = useCallback(
     (e: number, id: number, len: 1 | 2) => {
       if (len === 1) {
@@ -179,11 +179,16 @@ function QTadd({ moId, closeFu, tableLen }: Props) {
   const oneFlag = useCallback((info: A6QListType) => {
     let flag = false;
 
+    // 题目和选项是否填写
     if (!info.name) flag = true;
     else if (info.type !== "填空") {
       flag = info.sList.some((v) => !v.txt);
     }
 
+    // 下拉框勾选了选项跳题,但是子选项一个跳题都没有勾选
+    if (info.skip === "选项跳题" && info.sList.every((v) => !v.skip2))
+      flag = true;
+
     return flag;
   }, []);
 
@@ -191,12 +196,11 @@ function QTadd({ moId, closeFu, tableLen }: Props) {
   const btnOkFu = useCallback(() => {
     setFileCheck(true);
 
-    // 待完善
-    if (!fileCheck) return MessageFu.warning("请规范填写题目信息!");
-
-    const dom = document.querySelector(".A6Qlist2SonErr");
+    const dom = document.querySelector(".A6Qlist2SonErrBox");
     if (dom) return MessageFu.warning("请规范填写题目信息!");
-  }, [fileCheck]);
+
+    console.log("------验证通过----");
+  }, []);
 
   return (
     <Modal
@@ -204,11 +208,9 @@ function QTadd({ moId, closeFu, tableLen }: Props) {
       open={true}
       title={
         <div className="QTatitle">
-          <div>{moId > 0 ? "编辑" : "新增"}题目</div>
+          <div>{moInfo.id > 0 ? "编辑" : "新增"}题目</div>
           <div>
-            <span className="QTatitleS">
-              最多支持50题,还能新增{50 - tableLen - list.length}题
-            </span>
+            <span className="QTatitleS">最多支持50题</span>
             &emsp;
             <Button
               type="primary"
@@ -231,7 +233,8 @@ function QTadd({ moId, closeFu, tableLen }: Props) {
               <div
                 className={classNames(
                   "A6Qlist2Son",
-                  oneFlag(v) && fileCheck ? "A6Qlist2SonErr" : ""
+                  oneFlag(v) && fileCheck ? "A6Qlist2SonErr" : "",
+                  oneFlag(v) ? "A6Qlist2SonErrBox" : ""
                 )}
                 key={v.id}
               >
@@ -251,7 +254,8 @@ function QTadd({ moId, closeFu, tableLen }: Props) {
                 {/* 题目 */}
                 <div className="A6Q2_1">
                   <div>
-                    <span>*</span> 题目 {i + 1}
+                    <span>*</span> 题目{" "}
+                    {moInfo.id > 0 ? moInfo.num : tableLen + i + 1}
                   </div>
                   <div>
                     <TextArea

+ 8 - 4
src/pages/A6_1ques/A6Qtopic/index.tsx

@@ -18,13 +18,13 @@ function A6Qtopic({ sId, closeFu }: Props) {
   }, [getInfoFu, sId]);
 
   // 弹窗的显示和隐藏
-  const [moId, setMoId] = useState(0);
+  const [moInfo, setMoInfo] = useState({ id: 0, num: 0 });
 
   return (
     <div className={styles.A6Qtopic}>
       <div className="QTtop">
         <Button onClick={closeFu}>返回</Button>&emsp;
-        <Button type="primary" onClick={() => setMoId(-1)}>
+        <Button type="primary" onClick={() => setMoInfo({ id: -1, num: 0 })}>
           新增
         </Button>
       </div>
@@ -38,8 +38,12 @@ function A6Qtopic({ sId, closeFu }: Props) {
         /> */}
       </div>
       {/* 待完善  tableLen*/}
-      {moId ? (
-        <QTadd moId={moId} closeFu={() => setMoId(0)} tableLen={10} />
+      {moInfo.id ? (
+        <QTadd
+          moInfo={moInfo}
+          closeFu={() => setMoInfo({ id: 0, num: 0 })}
+          tableLen={10}
+        />
       ) : null}
     </div>
   );