shaogen1995 1 jaar geleden
bovenliggende
commit
eabdcf8ea2
5 gewijzigde bestanden met toevoegingen van 190 en 5 verwijderingen
  1. 4 2
      package.json
  2. 3 3
      src/components/ZupTypes/index.tsx
  3. 28 0
      src/pages/A6_1ques/index.module.scss
  4. 148 0
      src/pages/A6_1ques/index.tsx
  5. 7 0
      src/pages/Layout/data.ts

+ 4 - 2
package.json

@@ -29,7 +29,9 @@
     "redux-thunk": "^2.4.1",
     "sass": "^1.55.0",
     "typescript": "^4.8.4",
-    "web-vitals": "^2.1.4"
+    "web-vitals": "^2.1.4",
+    "html2canvas": "^1.3.2",
+    "jspdf": "^2.4.0"
   },
   "scripts": {
     "dev": "react-app-rewired start",
@@ -62,4 +64,4 @@
     "react-app-rewired": "^2.2.1"
   },
   "homepage": "."
-}
+}

+ 3 - 3
src/components/ZupTypes/index.tsx

@@ -135,7 +135,7 @@ function ZupTypes(
         } else if (fileOneType === "model") {
           anType = [""];
           anTit1 = "只支持4dage格式!";
-          anTit2 = `最大支持${500}M!`;
+          anTit2 = `最大支持${modelSize}M!`;
           anSize = modelSize * 1024 * 1024;
         }
 
@@ -281,7 +281,7 @@ function ZupTypes(
 
               <div className="ZTboxTit">
                 {type === "model"
-                  ? "仅支持4dage格式的模型文件,大小不能超过500M。"
+                  ? `仅支持4dage格式的模型文件,大小不能超过${modelSize}M。`
                   : type === "audio"
                   ? `仅支持mp3格式的音频文件,大小不得超过${audioSize}MB。`
                   : `仅支持mp4格式的视频文件,大小不得超过${videoSize}MB。`}
@@ -292,7 +292,7 @@ function ZupTypes(
       );
       return dom;
     },
-    [audioSize, fileList, typeCheck, upFileFu, videoSize]
+    [audioSize, fileList, modelSize, typeCheck, upFileFu, videoSize]
   );
 
   // ------------让父组件调用的 回显

+ 28 - 0
src/pages/A6_1ques/index.module.scss

@@ -0,0 +1,28 @@
+.A6_1ques {
+  :global {
+    .A6_1top {
+      padding: 15px 24px;
+      border-radius: 10px;
+      background-color: #fff;
+      display: flex;
+      justify-content: space-between;
+    }
+
+    .A6_1tableBox {
+      border-radius: 10px;
+      margin-top: 15px;
+      height: calc(100% - 77px);
+      background-color: #fff;
+      // overflow: hidden;
+      overflow-y: auto;
+      text-align: center;
+
+      img {
+        display: block;
+        margin: 10px auto;
+        max-width: 800px;
+        max-height: 500px;
+      }
+    }
+  }
+}

+ 148 - 0
src/pages/A6_1ques/index.tsx

@@ -0,0 +1,148 @@
+import React, { useCallback, useEffect, useRef, useState } from "react";
+import styles from "./index.module.scss";
+import { Button, Input } from "antd";
+import { useDispatch } from "react-redux";
+function A6_1ques() {
+  const dispatch = useDispatch();
+
+  const [fromData, setFromData] = useState({
+    pageNum: 1,
+    pageSize: 10,
+    searchKey: "",
+  });
+
+  const getListFu = useCallback(() => {
+    // dispatch(A4_APIgetList(fromData));
+    console.log(123);
+  }, []);
+
+  useEffect(() => {
+    getListFu();
+  }, [getListFu]);
+
+  const [inputKey, setInputKey] = useState(1);
+
+  // 标题的输入
+  const timeRef = useRef(-1);
+  const fromKeyChangeFu = useCallback(
+    (e: React.ChangeEvent<HTMLInputElement>, key: "searchKey") => {
+      clearTimeout(timeRef.current);
+      timeRef.current = window.setTimeout(() => {
+        setFromData({ ...fromData, [key]: e.target.value, pageNum: 1 });
+      }, 500);
+    },
+    [fromData]
+  );
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setInputKey(Date.now());
+    setFromData({
+      pageNum: 1,
+      pageSize: 10,
+      searchKey: "",
+    });
+  }, []);
+
+  // 点击新增和编辑
+  const [addId, setAddId] = useState(0);
+
+  return (
+    <div className={styles.A6_1ques}>
+      <div className="pageTitle">问卷管理</div>
+
+      {/* 顶部筛选 */}
+      <div className="A6_1top">
+        <div>
+          <span>搜索项:</span>
+          <Input
+            key={inputKey}
+            maxLength={50}
+            style={{ width: 300 }}
+            placeholder="请输入名称"
+            allowClear
+            onChange={(e) => fromKeyChangeFu(e, "searchKey")}
+          />
+        </div>
+        <div>
+          <Button onClick={resetSelectFu}>重置</Button>
+          &emsp;&emsp;
+          <Button type="primary" onClick={() => setAddId(-1)}>
+            新增
+          </Button>
+        </div>
+      </div>
+
+      {/* 表格主体 */}
+      <div className="A6_1tableBox">
+        <img
+          src="https://sit-chaozhoubwg.4dage.com/poster/tab2Poster/thumb/20240129_1114311892.jpg"
+          alt=""
+        />
+
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+        <h1>9999999999</h1>
+
+        <img
+          src="https://sit-chaozhoubwg.4dage.com/exhibition/img/1.jpg"
+          alt=""
+        />
+
+        {/* <MyTable
+          yHeight={625}
+          list={tableInfo.list}
+          columnsTemp={A4tableC}
+          lastBtn={tableLastBtn}
+          pageNum={fromData.pageNum}
+          pageSize={fromData.pageSize}
+          total={tableInfo.total}
+          onChange={(pageNum, pageSize) =>
+            setFromData({ ...fromData, pageNum, pageSize })
+          }
+        /> */}
+      </div>
+    </div>
+  );
+}
+
+const MemoA6_1ques = React.memo(A6_1ques);
+
+export default MemoA6_1ques;

+ 7 - 0
src/pages/Layout/data.ts

@@ -48,6 +48,13 @@ const tabLeftArr: RouterType = [
         Com: React.lazy(() => import("../A6hot")),
         done: true,
       },
+      {
+        id: "1.7",
+        name: "问卷管理",
+        path: "/ques",
+        Com: React.lazy(() => import("../A6_1ques")),
+        done: true,
+      },
     ],
   },
   {