shaogen1995 2 năm trước cách đây
mục cha
commit
669f46413f

+ 16 - 0
后台/src/components/ZA_Table/index.module.scss

@@ -52,4 +52,20 @@
       border-top: 2px dashed var(--themeColor) !important;
     }
   }
+}
+
+.ZA_Table2 {
+  :global {
+    .ant-table-row{
+      cursor: default !important;
+    }
+    // 表头拖拽样式
+    .drop-over-downward td {
+      border-bottom: 0px dashed transparent !important;
+    }
+
+    .drop-over-upward td {
+      border-top: 0px dashed transparent !important;
+    }
+  }
 }

+ 47 - 16
后台/src/components/ZA_Table/index.tsx

@@ -12,12 +12,18 @@ import { A2_APIdel, A2_APIgetList, A2_APIsort } from "@/store/action/A2Country";
 import { A2TableType } from "@/types";
 import { ExclamationCircleFilled } from "@ant-design/icons";
 import { forwardRef, useImperativeHandle } from "react";
+import classNames from "classnames";
 
 // 表格拖动排序-----------------
 import { DndProvider, useDrag, useDrop } from "react-dnd";
 import { HTML5Backend } from "react-dnd-html5-backend";
 import { MessageFu } from "@/utils/message";
 import ImageLazy from "../ImageLazy";
+import { A3_APIgetList } from "@/store/action/A3History";
+import { A6_APIgetList } from "@/store/action/A6Custom";
+import { A7_APIgetList } from "@/store/action/A7Project";
+import { A4_APIgetList } from "@/store/action/A4Craft";
+import { A5_APIgetList } from "@/store/action/A5Maestro";
 
 type Props = {
   setEditId: (id: number, flag: boolean) => void; //点击新增/编辑/查看
@@ -41,6 +47,11 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
 
   const getListFu = useCallback(() => {
     if (myType === "national") dispatch(A2_APIgetList(getData));
+    else if (myType === "history") dispatch(A3_APIgetList(getData));
+    else if (myType === "custom") dispatch(A6_APIgetList(getData));
+    else if (myType === "project") dispatch(A7_APIgetList(getData));
+    else if (myType === "craft") dispatch(A4_APIgetList(getData));
+    else if (myType === 'master') dispatch(A5_APIgetList(getData));
   }, [dispatch, getData, myType]);
 
   useEffect(() => {
@@ -104,7 +115,10 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
           <div className="moveTit">
             序号
             <Tooltip title="按住鼠标可拖动表格调整顺序">
-              <div className="inco" hidden={tableInfo.list.length < 2}>
+              <div
+                className="inco"
+                hidden={tableInfo.list.length < 2 || myType === "craft"}
+              >
                 <ExclamationCircleFilled />
               </div>
             </Tooltip>
@@ -167,7 +181,12 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
               cancelText="取消"
               onConfirm={() => delTableFu(item.id!)}
             >
-              <Button size="small" type="text" danger>
+              <Button
+                size="small"
+                type="text"
+                danger
+                hidden={myType === "craft"}
+              >
                 删除
               </Button>
             </Popconfirm>
@@ -220,7 +239,7 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
           };
         },
         drop: (item: { index: number }) => {
-          if (moveRow) moveRow(item.index, index);
+          if (moveRow && myType !== "craft") moveRow(item.index, index);
         },
       });
       // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -242,7 +261,7 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
         />
       );
     },
-    []
+    [myType]
   );
 
   const components = {
@@ -262,7 +281,6 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
       let resUrl = "block";
 
       if (myType === "master") resUrl = "master";
-      else if (myType === "craft") resUrl = "craft";
 
       const res = await A2_APIsort(beforeId, afterId, resUrl);
 
@@ -278,7 +296,12 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
   }));
 
   return (
-    <div className={styles.ZA_Table}>
+    <div
+      className={classNames(
+        styles.ZA_Table,
+        myType === "craft" ? styles.ZA_Table2 : ""
+      )}
+    >
       {/* 顶部搜索 */}
       <div className="top">
         <span>标题:</span>
@@ -293,7 +316,11 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
         &emsp;&emsp;
         <Button onClick={resetSelectFu}>重置</Button>
         &emsp;&emsp;
-        <Button type="primary" onClick={() => setEditId(-1, false)}>
+        <Button
+          type="primary"
+          onClick={() => setEditId(-1, false)}
+          hidden={myType === "craft"}
+        >
           新增
         </Button>
       </div>
@@ -306,15 +333,19 @@ function ZA_Table({ myType, setEditId, tableInfo }: Props, ref: any) {
             dataSource={tableInfo.list}
             components={components}
             rowKey="id"
-            pagination={{
-              showQuickJumper: true,
-              position: ["bottomCenter"],
-              showSizeChanger: true,
-              current: getData.pageNum,
-              pageSize: getData.pageSize,
-              total: tableInfo.total,
-              onChange: paginationChange(),
-            }}
+            pagination={
+              myType === "craft"
+                ? false
+                : {
+                    showQuickJumper: true,
+                    position: ["bottomCenter"],
+                    showSizeChanger: true,
+                    current: getData.pageNum,
+                    pageSize: getData.pageSize,
+                    total: tableInfo.total,
+                    onChange: paginationChange(),
+                  }
+            }
             onRow={(_, index) => {
               const attr = {
                 index,

+ 3 - 1
后台/src/components/Z_upFileOne/index.tsx

@@ -27,6 +27,7 @@ type Props = {
   formatTxt?: string; //上传图片提示
   sizeTxt?: string; //后面的建议尺寸信息
   fromData?: any;
+  checkTxt?:string
 };
 
 function Z_upFileOne({
@@ -39,6 +40,7 @@ function Z_upFileOne({
   myUrl,
   format = ["image/jpeg", "image/png"],
   formatTxt = "png、jpg和jpeg",
+  checkTxt='请上传封面图!',
   sizeTxt,
   fromData,
 }: Props) {
@@ -151,7 +153,7 @@ function Z_upFileOne({
             !cover && coverCheck ? "noUpThumbAc" : ""
           )}
         >
-          请上传封面图!
+          {checkTxt}
         </div>
       </div>
     </div>

+ 5 - 0
后台/src/pages/A2Country/A2Edit/index.module.scss

@@ -69,8 +69,13 @@
           opacity: 0;
         }
 
+        .ant-input-affix-wrapper-disabled {
+          background-color: transparent;
+        }
+
         .ant-input {
           border: transparent;
+          color: black !important;
         }
 
         .ant-input-data-count {

+ 90 - 37
后台/src/pages/A2Country/A2Edit/index.tsx

@@ -1,4 +1,10 @@
-import React, { useCallback, useEffect, useRef, useState } from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
 import { Button, Form, FormInstance, Input, Popconfirm } from "antd";
 import TextArea from "antd/es/input/TextArea";
@@ -39,8 +45,9 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
         });
         setDirCode(info.dirCode);
         setCover(info.thumb);
+        if (myType === "master") setBacImg(info.imgBack);
         setFileList(file);
-        setVideoFile({ name: info.videoName || "视频", path: info.video });
+        setVideoFile({ name: info.videoName, path: info.video });
       }
     },
     [myType]
@@ -63,6 +70,9 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
   // 封面图
   const [cover, setCover] = useState("");
 
+  // 背景图
+  const [bacImg, setBacImg] = useState("");
+
   // 多张图
   const [fileList, setFileList] = useState([] as FileImgListType[]);
 
@@ -78,7 +88,9 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
   const onFinish = useCallback(
     async (value: any) => {
       setCheck(true);
-      if (!cover) return;
+      if (!cover && myType !== "craft") return;
+
+      if (myType === "master" && !bacImg) return;
 
       const obj = {
         ...value,
@@ -89,6 +101,8 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
         type: myType,
         video: videoFile.path,
         videoName: videoFile.name,
+        // 大师独有
+        imgBack: bacImg,
       };
 
       let resUrl = "block";
@@ -110,6 +124,7 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
     },
     [
       addFu,
+      bacImg,
       closeFu,
       cover,
       dirCode,
@@ -122,6 +137,15 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
     ]
   );
 
+  const myUrlRes = useMemo(() => {
+    let sta = "";
+    let arr = ["national", "history", "custom", "project"];
+    if (arr.includes(myType)) sta = `cms/block/upload/${myType}`;
+    else if (myType === "craft") sta = "cms/craft/upload";
+    else if (myType === "master") sta = "cms/master/upload";
+    return sta;
+  }, [myType]);
+
   return (
     <div className={styles.A2Edit}>
       <div
@@ -142,7 +166,12 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
               rules={[{ required: true, message: "请输入标题!" }]}
               getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
             >
-              <Input maxLength={20} showCount placeholder="请输入内容" />
+              <Input
+                disabled={myType === "craft"}
+                maxLength={20}
+                showCount
+                placeholder="请输入内容"
+              />
             </Form.Item>
 
             <Form.Item
@@ -173,30 +202,52 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
             </Form.Item>
 
             {/* 封面图 */}
-            <div className="e_row">
-              <div className="e_rowL">
-                <span>* </span>封面:
+            {myType === "craft" ? null : (
+              <div className="e_row">
+                <div className="e_rowL">
+                  <span>* </span>封面:
+                </div>
+                <div className="e_rowR">
+                  <UpFileOne
+                    myUrl={myUrlRes}
+                    cover={cover}
+                    setCover={(val) => setCover(val)}
+                    isLook={isLook}
+                    coverCheck={check}
+                    size={5}
+                    dirCode={dirCode}
+                    sizeTxt={myType === "project" ? "376 x 349" : "783 x 362"}
+                  />
+                </div>
               </div>
-              <div className="e_rowR">
-                <UpFileOne
-                  myUrl={`cms/block/upload/${myType}`}
-                  cover={cover}
-                  setCover={(val) => setCover(val)}
-                  isLook={isLook}
-                  coverCheck={check}
-                  size={5}
-                  dirCode={dirCode}
-                  sizeTxt={myType === "project" ? "376 x 349" : "783 x 362"}
-                />
+            )}
+            {myType === "master" ? (
+              <div className="e_row">
+                <div className="e_rowL">
+                  <span>* </span>背景图:
+                </div>
+                <div className="e_rowR">
+                  <UpFileOne
+                    myUrl={myUrlRes}
+                    cover={bacImg}
+                    setCover={(val) => setBacImg(val)}
+                    isLook={isLook}
+                    coverCheck={check}
+                    size={5}
+                    dirCode={dirCode}
+                    sizeTxt="756 x 1708"
+                    checkTxt="请上传背景图!"
+                  />
+                </div>
               </div>
-            </div>
+            ) : null}
 
             {/* 多张图片 */}
             <div className="e_row" hidden={isLook && fileList.length === 0}>
               <div className="e_rowL">图片:</div>
               <div className="e_rowR">
                 <UpFileMore
-                  myUrl={`cms/block/upload/${myType}`}
+                  myUrl={myUrlRes}
                   max={15}
                   fileList={fileList}
                   setFileList={(data) => setFileList(data)}
@@ -208,24 +259,26 @@ function A2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
               </div>
             </div>
 
-            {/* 多张图片 */}
-            <div className="e_row" hidden={isLook && !videoFile.path}>
-              <div className="e_rowL">视频:</div>
-              <div className="e_rowR">
-                <UpFileOther
-                  fileUrl={videoFile}
-                  setFileUrl={(val) => setVideoFile(val)}
-                  isLook={isLook}
-                  fileCheck={false}
-                  size={500}
-                  dirCode={dirCode}
-                  myUrl={`cms/block/upload/${myType}`}
-                  myType="video"
-                  format={["video/mp4"]}
-                  formatTxt="mp4"
-                />
+            {/* 视频附件 */}
+            {myType === "master" ? null : (
+              <div className="e_row" hidden={isLook && !videoFile.path}>
+                <div className="e_rowL">视频:</div>
+                <div className="e_rowR">
+                  <UpFileOther
+                    fileUrl={videoFile}
+                    setFileUrl={(val) => setVideoFile(val)}
+                    isLook={isLook}
+                    fileCheck={false}
+                    size={500}
+                    dirCode={dirCode}
+                    myUrl={myUrlRes}
+                    myType="video"
+                    format={["video/mp4"]}
+                    formatTxt="mp4"
+                  />
+                </div>
               </div>
-            </div>
+            )}
 
             {/* 确定和取消按钮 */}
             <br />

+ 4 - 4
后台/src/pages/A2Country/index.module.scss

@@ -1,5 +1,5 @@
-.A2Country{
-  :global{
+// .A2Country{
+//   :global{
     
-  }
-}
+//   }
+// }

+ 4 - 4
后台/src/pages/A3History/index.module.scss

@@ -1,5 +1,5 @@
-.A3History{
-  :global{
+// .A3History{
+//   :global{
     
-  }
-}
+//   }
+// }

+ 44 - 5
后台/src/pages/A3History/index.tsx

@@ -1,12 +1,51 @@
-import React from "react";
+import React, { useCallback, useRef, useState } from "react";
 import styles from "./index.module.scss";
- function A3History() {
-  
+import ZATable from "@/components/ZA_Table";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+import A2Edit from "../A2Country/A2Edit";
+
+function A3History() {
+  //点击新增/编辑/查看
+  const [editId, setEditId] = useState(0);
+  const [isLook, setIsLook] = useState(false);
+  const openPageFu = useCallback((id: number, flag: boolean) => {
+    setIsLook(flag);
+    setEditId(id);
+  }, []);
+
+  // 从仓库中获取数据
+  const { tableInfo } = useSelector((state: RootState) => state.A3History);
+
+  const childRef = useRef<any>(null);
+
   return (
     <div className={styles.A3History}>
-      <div className="pageTitle">历史</div>
+      <div className="pageTitle">
+        {editId ? (isLook ? "查看" : editId > 0 ? "编辑" : "新增") : "历史"}
+      </div>
+
+      {/* 内容主体 */}
+      <ZATable
+        ref={childRef}
+        setEditId={(id, flag) => openPageFu(id, flag)}
+        myType="history"
+        tableInfo={tableInfo}
+      />
+
+      {/* 新增/编辑/查看 */}
+      {editId ? (
+        <A2Edit
+          editId={editId}
+          isLook={isLook}
+          closeFu={() => setEditId(0)}
+          editFu={() => childRef.current?.getListFu()}
+          addFu={() => childRef.current?.resetSelectFu()}
+          myType="history"
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA3History = React.memo(A3History);

+ 44 - 5
后台/src/pages/A4Craft/index.tsx

@@ -1,12 +1,51 @@
-import React from "react";
+import React, { useCallback, useRef, useState } from "react";
 import styles from "./index.module.scss";
- function A4Craft() {
-  
+import ZATable from "@/components/ZA_Table";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+import A2Edit from "../A2Country/A2Edit";
+
+function A4Craft() {
+  //点击新增/编辑/查看
+  const [editId, setEditId] = useState(0);
+  const [isLook, setIsLook] = useState(false);
+  const openPageFu = useCallback((id: number, flag: boolean) => {
+    setIsLook(flag);
+    setEditId(id);
+  }, []);
+
+  // 从仓库中获取数据
+  const { tableInfo } = useSelector((state: RootState) => state.A4Craft);
+
+  const childRef = useRef<any>(null);
+
   return (
     <div className={styles.A4Craft}>
-      <div className="pageTitle">工艺</div>
+      <div className="pageTitle">
+        {editId ? (isLook ? "查看" : editId > 0 ? "编辑" : "新增") : "工艺"}
+      </div>
+
+      {/* 内容主体 */}
+      <ZATable
+        ref={childRef}
+        setEditId={(id, flag) => openPageFu(id, flag)}
+        myType="craft"
+        tableInfo={tableInfo}
+      />
+
+      {/* 新增/编辑/查看 */}
+      {editId ? (
+        <A2Edit
+          editId={editId}
+          isLook={isLook}
+          closeFu={() => setEditId(0)}
+          editFu={() => childRef.current?.getListFu()}
+          addFu={() => childRef.current?.resetSelectFu()}
+          myType="craft"
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA4Craft = React.memo(A4Craft);

+ 44 - 5
后台/src/pages/A5Maestro/index.tsx

@@ -1,12 +1,51 @@
-import React from "react";
+import React, { useCallback, useRef, useState } from "react";
 import styles from "./index.module.scss";
- function A5Maestro() {
-  
+import ZATable from "@/components/ZA_Table";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+import A2Edit from "../A2Country/A2Edit";
+
+function A5Maestro() {
+  //点击新增/编辑/查看
+  const [editId, setEditId] = useState(0);
+  const [isLook, setIsLook] = useState(false);
+  const openPageFu = useCallback((id: number, flag: boolean) => {
+    setIsLook(flag);
+    setEditId(id);
+  }, []);
+
+  // 从仓库中获取数据
+  const { tableInfo } = useSelector((state: RootState) => state.A5Maestro);
+
+  const childRef = useRef<any>(null);
+
   return (
     <div className={styles.A5Maestro}>
-      <div className="pageTitle">大师</div>
+      <div className="pageTitle">
+        {editId ? (isLook ? "查看" : editId > 0 ? "编辑" : "新增") : "大师"}
+      </div>
+
+      {/* 内容主体 */}
+      <ZATable
+        ref={childRef}
+        setEditId={(id, flag) => openPageFu(id, flag)}
+        myType="master"
+        tableInfo={tableInfo}
+      />
+
+      {/* 新增/编辑/查看 */}
+      {editId ? (
+        <A2Edit
+          editId={editId}
+          isLook={isLook}
+          closeFu={() => setEditId(0)}
+          editFu={() => childRef.current?.getListFu()}
+          addFu={() => childRef.current?.resetSelectFu()}
+          myType="master"
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA5Maestro = React.memo(A5Maestro);

+ 44 - 5
后台/src/pages/A6Custom/index.tsx

@@ -1,12 +1,51 @@
-import React from "react";
+import React, { useCallback, useRef, useState } from "react";
 import styles from "./index.module.scss";
- function A6Custom() {
-  
+import ZATable from "@/components/ZA_Table";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+import A2Edit from "../A2Country/A2Edit";
+
+function A6Custom() {
+  //点击新增/编辑/查看
+  const [editId, setEditId] = useState(0);
+  const [isLook, setIsLook] = useState(false);
+  const openPageFu = useCallback((id: number, flag: boolean) => {
+    setIsLook(flag);
+    setEditId(id);
+  }, []);
+
+  // 从仓库中获取数据
+  const { tableInfo } = useSelector((state: RootState) => state.A6Custom);
+
+  const childRef = useRef<any>(null);
+
   return (
     <div className={styles.A6Custom}>
-      <div className="pageTitle">定制</div>
+      <div className="pageTitle">
+        {editId ? (isLook ? "查看" : editId > 0 ? "编辑" : "新增") : "定制"}
+      </div>
+
+      {/* 内容主体 */}
+      <ZATable
+        ref={childRef}
+        setEditId={(id, flag) => openPageFu(id, flag)}
+        myType="custom"
+        tableInfo={tableInfo}
+      />
+
+      {/* 新增/编辑/查看 */}
+      {editId ? (
+        <A2Edit
+          editId={editId}
+          isLook={isLook}
+          closeFu={() => setEditId(0)}
+          editFu={() => childRef.current?.getListFu()}
+          addFu={() => childRef.current?.resetSelectFu()}
+          myType="custom"
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA6Custom = React.memo(A6Custom);

+ 45 - 2
后台/src/pages/A7Project/index.tsx

@@ -1,9 +1,49 @@
-import React from "react";
+import React, { useCallback, useRef, useState } from "react";
 import styles from "./index.module.scss";
+import ZATable from "@/components/ZA_Table";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+import A2Edit from "../A2Country/A2Edit";
+
 function A7Project() {
+  //点击新增/编辑/查看
+  const [editId, setEditId] = useState(0);
+  const [isLook, setIsLook] = useState(false);
+  const openPageFu = useCallback((id: number, flag: boolean) => {
+    setIsLook(flag);
+    setEditId(id);
+  }, []);
+
+  // 从仓库中获取数据
+  const { tableInfo } = useSelector((state: RootState) => state.A7Project);
+
+  const childRef = useRef<any>(null);
+
   return (
     <div className={styles.A7Project}>
-      <div className="pageTitle">工程</div>
+      <div className="pageTitle">
+        {editId ? (isLook ? "查看" : editId > 0 ? "编辑" : "新增") : "工程"}
+      </div>
+
+      {/* 内容主体 */}
+      <ZATable
+        ref={childRef}
+        setEditId={(id, flag) => openPageFu(id, flag)}
+        myType="project"
+        tableInfo={tableInfo}
+      />
+
+      {/* 新增/编辑/查看 */}
+      {editId ? (
+        <A2Edit
+          editId={editId}
+          isLook={isLook}
+          closeFu={() => setEditId(0)}
+          editFu={() => childRef.current?.getListFu()}
+          addFu={() => childRef.current?.resetSelectFu()}
+          myType="project"
+        />
+      ) : null}
     </div>
   );
 }
@@ -11,3 +51,6 @@ function A7Project() {
 const MemoA7Project = React.memo(A7Project);
 
 export default MemoA7Project;
+
+
+

+ 2 - 2
后台/src/store/action/A2Country.ts

@@ -2,7 +2,7 @@ import http from "@/utils/http";
 import { AppDispatch } from "..";
 
 /**
- * 获取 国礼-历史-定制-工程 列表
+ * 获取 列表
  */
 export const A2_APIgetList = (data: any) => {
   return async (dispatch: AppDispatch) => {
@@ -43,4 +43,4 @@ export const A2_APIdel = (id: number, resUrl: string) => {
  */
 export const A2_APIgetInfo = (id: number, resUrl: string) => {
   return http.get(`cms/${resUrl}/detail/${id}`);
-};
+};

+ 18 - 0
后台/src/store/action/A3History.ts

@@ -0,0 +1,18 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ * 获取 列表
+ */
+export const A3_APIgetList = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/block/pageList", data);
+    if (res.code === 0) {
+      const { records, total } = res.data;
+      dispatch({
+        type: "A3History/getList",
+        payload: { list: records, total: total },
+      });
+    }
+  };
+};

+ 18 - 0
后台/src/store/action/A4Craft.ts

@@ -0,0 +1,18 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ * 获取 列表
+ */
+export const A4_APIgetList = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/craft/pageList", data);
+    if (res.code === 0) {
+      const { records, total } = res.data;
+      dispatch({
+        type: "A4History/getList",
+        payload: { list: records, total: total },
+      });
+    }
+  };
+};

+ 18 - 0
后台/src/store/action/A5Maestro.ts

@@ -0,0 +1,18 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ * 获取 列表
+ */
+export const A5_APIgetList = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/master/pageList", data);
+    if (res.code === 0) {
+      const { records, total } = res.data;
+      dispatch({
+        type: "A5History/getList",
+        payload: { list: records, total: total },
+      });
+    }
+  };
+};

+ 18 - 0
后台/src/store/action/A6Custom.ts

@@ -0,0 +1,18 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ * 获取 列表
+ */
+export const A6_APIgetList = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/block/pageList", data);
+    if (res.code === 0) {
+      const { records, total } = res.data;
+      dispatch({
+        type: "A6History/getList",
+        payload: { list: records, total: total },
+      });
+    }
+  };
+};

+ 18 - 0
后台/src/store/action/A7Project.ts

@@ -0,0 +1,18 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ * 获取 列表
+ */
+export const A7_APIgetList = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/block/pageList", data);
+    if (res.code === 0) {
+      const { records, total } = res.data;
+      dispatch({
+        type: "A7Project/getList",
+        payload: { list: records, total: total },
+      });
+    }
+  };
+};

+ 28 - 0
后台/src/store/reducer/A3History.ts

@@ -0,0 +1,28 @@
+import { A2TableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as A2TableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type Props = {
+  type: "A3History/getList";
+  payload: { list: A2TableType[]; total: number };
+};
+
+// 频道 reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "A3History/getList":
+      return { ...state, tableInfo: action.payload };
+
+    default:
+      return state;
+  }
+}

+ 28 - 0
后台/src/store/reducer/A4Craft.ts

@@ -0,0 +1,28 @@
+import { A2TableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as A2TableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type Props = {
+  type: "A4History/getList";
+  payload: { list: A2TableType[]; total: number };
+};
+
+// 频道 reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "A4History/getList":
+      return { ...state, tableInfo: action.payload };
+
+    default:
+      return state;
+  }
+}

+ 28 - 0
后台/src/store/reducer/A5Maestro.ts

@@ -0,0 +1,28 @@
+import { A2TableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as A2TableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type Props = {
+  type: "A5History/getList";
+  payload: { list: A2TableType[]; total: number };
+};
+
+// 频道 reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "A5History/getList":
+      return { ...state, tableInfo: action.payload };
+
+    default:
+      return state;
+  }
+}

+ 28 - 0
后台/src/store/reducer/A6Custom.ts

@@ -0,0 +1,28 @@
+import { A2TableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as A2TableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type Props = {
+  type: "A6History/getList";
+  payload: { list: A2TableType[]; total: number };
+};
+
+// 频道 reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "A6History/getList":
+      return { ...state, tableInfo: action.payload };
+
+    default:
+      return state;
+  }
+}

+ 28 - 0
后台/src/store/reducer/A7Project.ts

@@ -0,0 +1,28 @@
+import { A2TableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as A2TableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type Props = {
+  type: "A7Project/getList";
+  payload: { list: A2TableType[]; total: number };
+};
+
+// 频道 reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "A7Project/getList":
+      return { ...state, tableInfo: action.payload };
+
+    default:
+      return state;
+  }
+}

+ 10 - 0
后台/src/store/reducer/index.ts

@@ -5,6 +5,11 @@ import { combineReducers } from "redux";
 import A0Layout from "./layout";
 import A1Plate from "./A1Plate";
 import A2Country from "./A2Country";
+import A3History from "./A3History";
+import A4Craft from "./A4Craft";
+import A5Maestro from "./A5Maestro";
+import A6Custom from "./A6Custom";
+import A7Project from "./A7Project";
 import D1User from "./D1User";
 import D2Log from "./D2Log";
 
@@ -13,6 +18,11 @@ const rootReducer = combineReducers({
   A0Layout,
   A1Plate,
   A2Country,
+  A3History,
+  A4Craft,
+  A5Maestro,
+  A6Custom,
+  A7Project,
   D1User,
   D2Log,
 });