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

+ 0 - 43
src/assets/styles/base.css

@@ -97,49 +97,6 @@ textarea {
 #root .ant-btn-text.ant-btn-dangerous {
   color: #ff4d4d;
 }
-#root .ant-pagination .ant-pagination-item {
-  border-radius: 50%;
-  border: 1px solid #999;
-  background-color: transparent !important;
-}
-#root .ant-pagination .ant-pagination-item-active {
-  background-color: var(--themeColor) !important;
-}
-#root .ant-pagination .ant-pagination-item-active a {
-  color: #fff !important;
-}
-#root .ant-pagination .ant-pagination-item:hover {
-  background-color: var(--themeColor) !important;
-}
-#root .ant-pagination .ant-pagination-item:hover a {
-  color: #fff !important;
-}
-#root .ant-pagination-prev {
-  border-radius: 50% !important;
-  border: 1px solid #999;
-}
-#root .ant-pagination-prev:hover {
-  background-color: var(--themeColor);
-}
-#root .ant-pagination-prev:hover button {
-  color: #fff;
-}
-#root .ant-pagination-next {
-  border-radius: 50% !important;
-  border: 1px solid #999;
-}
-#root .ant-pagination-next:hover {
-  background-color: var(--themeColor);
-}
-#root .ant-pagination-next:hover button {
-  color: #fff;
-}
-#root .ant-pagination-disabled {
-  border: 1px solid #ccc;
-}
-#root .ant-pagination-disabled:hover {
-  background-color: transparent;
-}
 #root .tableImgAuto {
   display: flex;
   justify-content: center;

+ 43 - 43
src/assets/styles/base.less

@@ -127,65 +127,65 @@ textarea {
   }
 
   /* antd分页器样式 */
-  .ant-pagination .ant-pagination-item {
-    border-radius: 50%;
-    border: 1px solid #999;
-    background-color: transparent !important;
-  }
+  // .ant-pagination .ant-pagination-item {
+  //   border-radius: 50%;
+  //   border: 1px solid #999;
+  //   background-color: transparent !important;
+  // }
 
-  .ant-pagination .ant-pagination-item-active {
-    background-color: var(--themeColor) !important;
-  }
+  // .ant-pagination .ant-pagination-item-active {
+  //   background-color: var(--themeColor) !important;
+  // }
 
 
-  .ant-pagination .ant-pagination-item-active a {
-    color: #fff !important;
-  }
+  // .ant-pagination .ant-pagination-item-active a {
+  //   color: #fff !important;
+  // }
 
-  .ant-pagination .ant-pagination-item:hover {
-    background-color: var(--themeColor) !important;
-  }
+  // .ant-pagination .ant-pagination-item:hover {
+  //   background-color: var(--themeColor) !important;
+  // }
 
-  .ant-pagination .ant-pagination-item:hover a {
-    color: #fff !important;
-  }
+  // .ant-pagination .ant-pagination-item:hover a {
+  //   color: #fff !important;
+  // }
 
-  .ant-pagination-prev {
-    border-radius: 50% !important;
-    border: 1px solid #999;
-  }
+  // .ant-pagination-prev {
+  //   border-radius: 50% !important;
+  //   border: 1px solid #999;
+  // }
 
-  .ant-pagination-prev:hover {
-    background-color: var(--themeColor);
-  }
+  // .ant-pagination-prev:hover {
+  //   background-color: var(--themeColor);
+  // }
 
-  .ant-pagination-prev:hover button {
-    color: #fff;
-  }
+  // .ant-pagination-prev:hover button {
+  //   color: #fff;
+  // }
 
 
 
-  .ant-pagination-next {
-    border-radius: 50% !important;
-    border: 1px solid #999;
-  }
+  // .ant-pagination-next {
+  //   border-radius: 50% !important;
+  //   border: 1px solid #999;
+  // }
 
 
-  .ant-pagination-next:hover {
-    background-color: var(--themeColor);
-  }
+  // .ant-pagination-next:hover {
+  //   background-color: var(--themeColor);
+  // }
 
-  .ant-pagination-next:hover button {
-    color: #fff;
-  }
+  // .ant-pagination-next:hover button {
+  //   color: #fff;
+  // }
 
-  .ant-pagination-disabled {
-    border: 1px solid #ccc;
-  }
+  // .ant-pagination-disabled {
+  //   border: 1px solid #ccc;
+  // }
 
-  .ant-pagination-disabled:hover {
-    background-color: transparent;
-  }
+  // .ant-pagination-disabled:hover {
+  //   background-color: transparent;
+  // }
 
 
   /* 表格的图片居中 */

+ 1 - 1
src/components/MyTable/index.tsx

@@ -87,7 +87,7 @@ function MyTable({
         txt: (item: any) => item[v[2]] || isNull,
         img: (item: any) => (
           <div className="tableImgAuto">
-            <ImageLazy width={60} height={60} src={item.thumb} />
+            <ImageLazy width={60} height={60} src={item[v[2]] || item.thumb} />
           </div>
         ),
         txtChange: (item: any) =>

+ 133 - 0
src/pages/A6home/A6add/index.module.scss

@@ -0,0 +1,133 @@
+.A6add {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 12;
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 24px;
+
+  :global {
+    .A6eMain {
+      width: 100%;
+      height: 100%;
+      overflow-y: auto;
+
+
+      .A6fromRow {
+        position: relative;
+        width: 800px;
+        height: 56px;
+
+        // &>div {
+        //   width: 100%;
+        // }
+
+        .A6_1Frow {
+          position: absolute;
+          top: 0px;
+          left: 600px;
+          width: 200px;
+        }
+
+        .A6_4Frow {
+          position: absolute;
+          left: 400px;
+          top: 4px;
+        }
+
+        .A6_6Frow {
+          position: absolute;
+          left: 200px;
+          top: 5px;
+          color: #999;
+          font-size: 12px;
+        }
+
+      }
+
+      .ant-form {
+        width: 800px;
+
+        // .ant-input-affix-wrapper{
+        //   width: 800px;
+        // }
+        .formRow {
+          display: flex;
+
+          .formLeft {
+            position: relative;
+            top: 3px;
+            width: 100px;
+            text-align: right;
+
+            &>span {
+              color: #ff4d4f;
+            }
+          }
+
+          .formRight {
+            width: calc(100% - 100px);
+          }
+
+
+          .formRight5Tit {
+            position: relative;
+            top: -10px;
+            transition: top .2s;
+            margin: 5px 0;
+            color: #ff4d4f;
+            opacity: 0;
+            pointer-events: none;
+          }
+
+          .formRight5TitErr {
+            opacity: 1;
+            top: 0;
+          }
+        }
+
+
+        .A6Ebtn {
+          position: absolute;
+          z-index: 10;
+          left: 1200px;
+          top: 50%;
+          transform: translateY(-50%);
+        }
+      }
+    }
+
+
+    // 从查看进入
+    .A6eMainLook {
+
+      // 左边的 label 也不让选中
+      label {
+        pointer-events: none;
+      }
+
+      .ant-picker {
+        pointer-events: none;
+      }
+
+      .ant-checkbox-wrapper {
+        pointer-events: none;
+      }
+
+      .ant-input-number {
+        pointer-events: none;
+      }
+
+      .ant-select {
+        pointer-events: none;
+      }
+
+      .ant-radio-wrapper {
+        pointer-events: none;
+      }
+    }
+  }
+}

+ 219 - 0
src/pages/A6home/A6add/index.tsx

@@ -0,0 +1,219 @@
+import React, { useCallback, useEffect, useRef, useState } from "react";
+import styles from "./index.module.scss";
+import { A1EditInfoType } from "@/pages/A1event/data";
+import { Button, Form, FormInstance, InputNumber } from "antd";
+import { A6_APIgetInfo, A6_APIsave } from "@/store/action/A6home";
+import { MessageFu } from "@/utils/message";
+import classNames from "classnames";
+import TextArea from "antd/es/input/TextArea";
+import ZupOne from "@/components/ZupOne";
+import MyPopconfirm from "@/components/MyPopconfirm";
+
+type Props = {
+  editInfo: A1EditInfoType;
+  closeFu: () => void;
+  upTableFu: () => void;
+};
+
+function A6add({ editInfo, closeFu, upTableFu }: Props) {
+  // 表单的ref
+  const FormBoxRef = useRef<FormInstance>(null);
+
+  // 封面图图的ref
+  const ZupPcRef = useRef<any>(null);
+  const ZupAppRef = useRef<any>(null);
+
+  // 编辑/查看 进入页面 获取信息
+  const getInfoFu = useCallback(async (id: number) => {
+    const res = await A6_APIgetInfo(id);
+    if (res.code === 0) {
+      const data = res.data;
+
+      FormBoxRef.current?.setFieldsValue(data);
+
+      // 设置封面图
+      ZupPcRef.current?.setFileComFileFu({
+        fileName: "",
+        filePath: data.thumbPc,
+      });
+
+      ZupAppRef.current?.setFileComFileFu({
+        fileName: "",
+        filePath: data.thumbApp,
+      });
+    }
+  }, []);
+
+  // 附件 是否 已经点击过确定
+  const [fileCheck, setFileCheck] = useState(false);
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {
+    setFileCheck(true);
+  }, []);
+
+  //  通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      setFileCheck(true);
+
+      const thumbPc = ZupPcRef.current?.fileComFileResFu();
+      // 没有传 封面图
+      if (!thumbPc.filePath) return MessageFu.warning("请上传PC端封面!");
+
+      const thumbApp = ZupAppRef.current?.fileComFileResFu();
+      // 没有传 封面图
+      if (!thumbApp.filePath) return MessageFu.warning("请上传移动端封面!");
+
+      const obj = {
+        ...values,
+        id: editInfo.id > 0 ? editInfo.id : null,
+        thumbPc: thumbPc.filePath,
+        thumbApp: thumbApp.filePath,
+      };
+
+      // if (obj) {
+      //   console.log(123, obj);
+      //   return;
+      // }
+
+      const res = await A6_APIsave(obj);
+
+      if (res.code === 0) {
+        MessageFu.success(`${editInfo.txt}成功!`);
+        upTableFu();
+        closeFu();
+      }
+    },
+    [closeFu, editInfo.id, editInfo.txt, upTableFu]
+  );
+
+  useEffect(() => {
+    if (editInfo.id > 0) {
+      getInfoFu(editInfo.id);
+    } else {
+      FormBoxRef.current?.setFieldsValue({
+        sort: 999,
+      });
+    }
+  }, [editInfo.id, getInfoFu]);
+
+  return (
+    <div className={styles.A6add}>
+      <div
+        className={classNames(
+          "A6eMain",
+          editInfo.txt === "查看" ? "A6eMainLook" : ""
+        )}
+      >
+        <Form
+          ref={FormBoxRef}
+          name="basic"
+          labelCol={{ span: 3 }}
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete="off"
+          scrollToFirstError
+        >
+          {/* 封面 */}
+          <div className="formRow">
+            <div className="formLeft">
+              <span>* </span>
+              PC端封面:
+            </div>
+            <div className="formRight">
+              <ZupOne
+                ref={ZupPcRef}
+                isLook={editInfo.txt === "查看"}
+                fileCheck={fileCheck}
+                size={5}
+                dirCode="indexThumbPc"
+                myUrl="cms/index/upload"
+                format={["image/jpeg", "image/png"]}
+                formatTxt="png、jpg和jpeg"
+                checkTxt="请上传PC端封面!"
+                upTxt="最多1张"
+                myType="thumb"
+              />
+            </div>
+          </div>
+
+          <div className="formRow">
+            <div className="formLeft">
+              <span>* </span>
+              移动端封面:
+            </div>
+            <div className="formRight">
+              <ZupOne
+                ref={ZupAppRef}
+                isLook={editInfo.txt === "查看"}
+                fileCheck={fileCheck}
+                size={5}
+                dirCode="indexThumbApp"
+                myUrl="cms/index/upload"
+                format={["image/jpeg", "image/png"]}
+                formatTxt="png、jpg和jpeg"
+                checkTxt="请上传移动端封面!"
+                upTxt="最多1张"
+                myType="thumb"
+              />
+            </div>
+          </div>
+
+          {editInfo.txt === "查看" ? <br /> : null}
+          <Form.Item
+            label="跳转链接"
+            name="link"
+            rules={[{ required: true, message: "请输入跳转链接!" }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <TextArea
+              readOnly={editInfo.txt === "查看"}
+              maxLength={200}
+              showCount
+              placeholder="请输入内容"
+            />
+          </Form.Item>
+
+          <div className="A6fromRow">
+            <Form.Item
+              label="排序值"
+              name="sort"
+              rules={[{ required: true, message: "请输入排序值!" }]}
+            >
+              <InputNumber
+                min={1}
+                max={999}
+                precision={0}
+                placeholder="请输入"
+              />
+            </Form.Item>
+            <div className="A6_6Frow" hidden={editInfo.txt === "查看"}>
+              请输入1~999的数字。数字越小,排序越靠前。数字相同时,更新发布的内容排在前面
+            </div>
+          </div>
+
+          {/* 确定和取消按钮 */}
+          <Form.Item className="A6Ebtn">
+            {editInfo.txt === "查看" ? (
+              <Button onClick={closeFu}>返回</Button>
+            ) : (
+              <>
+                <Button type="primary" htmlType="submit">
+                  提交
+                </Button>
+                <br />
+                <br />
+                <MyPopconfirm txtK="取消" onConfirm={closeFu} />
+              </>
+            )}
+          </Form.Item>
+        </Form>
+      </div>
+    </div>
+  );
+}
+
+const MemoA6add = React.memo(A6add);
+
+export default MemoA6add;

+ 21 - 3
src/pages/A6home/index.module.scss

@@ -1,5 +1,23 @@
-.A6home{
-  :global{
-    
+.A6home {
+  background-color: #fff;
+  border-radius: 10px;
+
+  :global {
+    .A6top {
+      padding: 15px 24px;
+      text-align: right;
+
+      &>div {
+        font-size: 18px;
+        font-weight: 700;
+        color: var(--themeColor);
+      }
+    }
+
+    .A6tableBox {
+      border-radius: 10px;
+      overflow: hidden;
+      height: calc(100% - 62px);
+    }
   }
 }

+ 101 - 5
src/pages/A6home/index.tsx

@@ -1,12 +1,108 @@
-import React from "react";
+import React, { useCallback, useEffect, useMemo, useState } from "react";
 import styles from "./index.module.scss";
- function A6home() {
-  
+import { useDispatch, useSelector } from "react-redux";
+import { A6_APIdel, A6_APIgetList } from "@/store/action/A6home";
+import { RootState } from "@/store";
+import { MessageFu } from "@/utils/message";
+import { A6tableType } from "@/types";
+import { Button } from "antd";
+import MyPopconfirm from "@/components/MyPopconfirm";
+import { A1EditInfoType } from "../A1event/data";
+import MyTable from "@/components/MyTable";
+import { A6tableC } from "@/utils/tableData";
+import A6add from "./A6add";
+function A6home() {
+  const dispatch = useDispatch();
+  const getListFu = useCallback(() => {
+    dispatch(A6_APIgetList());
+  }, [dispatch]);
+
+  useEffect(() => {
+    getListFu();
+  }, [getListFu]);
+
+  const tableList = useSelector((state: RootState) => state.A6home.list);
+
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await A6_APIdel(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功!");
+        getListFu();
+      }
+    },
+    [getListFu]
+  );
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: "操作",
+        render: (item: A6tableType) => (
+          <>
+            <Button
+              size="small"
+              type="text"
+              onClick={() => setEditInfo({ id: item.id, txt: "查看" })}
+            >
+              查看
+            </Button>
+            <Button
+              size="small"
+              type="text"
+              onClick={() => setEditInfo({ id: item.id, txt: "编辑" })}
+            >
+              编辑
+            </Button>
+            <MyPopconfirm txtK="删除" onConfirm={() => delTableFu(item.id)} />
+          </>
+        ),
+      },
+    ];
+  }, [delTableFu]);
+
+  //查看、新增、编辑
+  const [editInfo, setEditInfo] = useState<A1EditInfoType>({
+    id: 0,
+    txt: "",
+  });
+
   return (
     <div className={styles.A6home}>
-       <div className="pageTitle">首页管理</div>
+      <div className="pageTitle">
+        首页管理{editInfo.id ? ` - ${editInfo.txt}` : ""}
+      </div>
+
+      <div className="A6top">
+        <Button
+          type="primary"
+          onClick={() => {
+            if (tableList.length >= 20)
+              return MessageFu.warning("最多20条数据!");
+            setEditInfo({ txt: "新增", id: -1 });
+          }}
+        >
+          新增
+        </Button>
+      </div>
+      <div className="A6tableBox">
+        <MyTable
+          yHeight={690}
+          list={tableList}
+          columnsTemp={A6tableC}
+          lastBtn={tableLastBtn}
+          pagingInfo={false}
+        />
+      </div>
+      {/* 新增 编辑 查看 */}
+      {editInfo.id ? (
+        <A6add
+          editInfo={editInfo}
+          closeFu={() => setEditInfo({ id: 0, txt: "" })}
+          upTableFu={() => getListFu()}
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA6home = React.memo(A6home);

+ 52 - 3
src/pages/A7poster/index.module.scss

@@ -1,5 +1,54 @@
-.A7poster{
-  :global{
-    
+.A7poster {
+  background-color: #fff;
+  border-radius: 10px;
+
+  :global {
+
+
+    .A7tableBox {
+      border-radius: 10px;
+      overflow: hidden;
+      height: 100%;
+    }
+  }
+}
+
+.A7addMo {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 600px !important;
+    }
+
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+      padding-top: 15px !important;
+    }
+
+    .A7addRow {
+      display: flex;
+
+      .A7addRow1 {
+        width: 100px;
+        text-align: right;
+
+        &>span {
+          color: #ff4d4f;
+        }
+      }
+
+      .A7addRow2 {
+        width: calc(100% - 100px);
+      }
+    }
+
+    .A7addBtn {
+      margin-top: 40px;
+      text-align: center;
+    }
   }
 }

+ 171 - 5
src/pages/A7poster/index.tsx

@@ -1,12 +1,178 @@
-import React from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
- function A7poster() {
-  
+import { useDispatch, useSelector } from "react-redux";
+import { A7_APIgetList, A7_APIsave } from "@/store/action/A7poster";
+import { RootState } from "@/store";
+import { A7tableType } from "@/types";
+import { Button, Modal } from "antd";
+import MyTable from "@/components/MyTable";
+import { A7tableC } from "@/utils/tableData";
+import MyPopconfirm from "@/components/MyPopconfirm";
+import ZupOne from "@/components/ZupOne";
+import { MessageFu } from "@/utils/message";
+
+function A7poster() {
+  const dispatch = useDispatch();
+  const getListFu = useCallback(() => {
+    dispatch(A7_APIgetList());
+  }, [dispatch]);
+
+  useEffect(() => {
+    getListFu();
+  }, [getListFu]);
+
+  const tableList = useSelector((state: RootState) => state.A7poster.list);
+
+  const [editId, setEditId] = useState(0);
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: "操作",
+        render: (item: A7tableType) => (
+          <Button
+            size="small"
+            type="text"
+            onClick={() => {
+              setEditId(item.id);
+
+              setTimeout(() => {
+                // 设置海报图
+                ZupPcRef.current?.setFileComFileFu({
+                  fileName: "",
+                  filePath: item.thumbPc,
+                });
+
+                ZupAppRef.current?.setFileComFileFu({
+                  fileName: "",
+                  filePath: item.thumbApp,
+                });
+              }, 100);
+            }}
+          >
+            编辑
+          </Button>
+        ),
+      },
+    ];
+  }, []);
+
+  // 有关弹窗--------------
+
+  // 海报图的ref
+  const ZupPcRef = useRef<any>(null);
+  const ZupAppRef = useRef<any>(null);
+
+  //  是否 已经点击过确定
+  const [fileCheck, setFileCheck] = useState(false);
+
+  const btnXFu = useCallback(() => {
+    setEditId(0);
+    setFileCheck(false);
+  }, []);
+
+  const btnOkFu = useCallback(async () => {
+    setFileCheck(true);
+    const thumbPc = ZupPcRef.current?.fileComFileResFu();
+    // 没有传 海报图
+    if (!thumbPc.filePath) return MessageFu.warning("请上传PC端海报!");
+
+    const thumbApp = ZupAppRef.current?.fileComFileResFu();
+    // 没有传 海报图
+    if (!thumbApp.filePath) return MessageFu.warning("请上传移动端海报!");
+
+    const res = await A7_APIsave({
+      id: editId,
+      thumbPc: thumbPc.filePath,
+      thumbApp: thumbApp.filePath,
+    });
+
+    if (res.code === 0) {
+      MessageFu.success("编辑海报成功!");
+      getListFu();
+      btnXFu();
+    }
+  }, [btnXFu, editId, getListFu]);
+
   return (
     <div className={styles.A7poster}>
-       <div className="pageTitle">海报管理</div>
+      <div className="pageTitle">海报管理</div>
+      <div className="A7tableBox">
+        <MyTable
+          yHeight={755}
+          list={tableList}
+          columnsTemp={A7tableC}
+          lastBtn={tableLastBtn}
+          pagingInfo={false}
+        />
+      </div>
+
+      {editId ? (
+        <Modal
+          wrapClassName={styles.A7addMo}
+          open={true}
+          title={editId > 0 ? "编辑海报" : "新增海报"}
+          footer={
+            [] // 设置footer为空,去掉 取消 确定默认按钮
+          }
+        >
+          <div className="A7addRow">
+            <div className="A7addRow1">
+              <span>* </span>PC端海报:
+            </div>
+            <div className="A7addRow2">
+              <ZupOne
+                ref={ZupPcRef}
+                fileCheck={fileCheck}
+                size={5}
+                dirCode="indexThumbPc"
+                myUrl="cms/index/upload"
+                format={["image/jpeg", "image/png"]}
+                formatTxt="png、jpg和jpeg"
+                checkTxt="请上传PC端海报!"
+                upTxt="最多1张"
+                myType="thumb"
+              />
+            </div>
+          </div>
+
+          <div className="A7addRow">
+            <div className="A7addRow1">
+              <span>* </span>移动端海报:
+            </div>
+            <div className="A7addRow2">
+              <ZupOne
+                ref={ZupAppRef}
+                fileCheck={fileCheck}
+                size={5}
+                dirCode="indexThumbApp"
+                myUrl="cms/index/upload"
+                format={["image/jpeg", "image/png"]}
+                formatTxt="png、jpg和jpeg"
+                checkTxt="请上传移动端海报!"
+                upTxt="最多1张"
+                myType="thumb"
+              />
+            </div>
+          </div>
+
+          <div className="A7addBtn">
+            <Button type="primary" onClick={btnOkFu}>
+              提交
+            </Button>
+            &emsp;
+            <MyPopconfirm txtK="取消" onConfirm={btnXFu} />
+          </div>
+        </Modal>
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA7poster = React.memo(A7poster);

+ 2 - 2
src/pages/Z1user/index.tsx

@@ -175,8 +175,8 @@ function Z1user() {
             <Button
               type="primary"
               onClick={() => {
-                if (tableInfo.total >= 20)
-                  return MessageFu.warning("最多20个账号!");
+                if (tableInfo.total >= 30)
+                  return MessageFu.warning("最多30个账号!");
                 openEditPageFu(0);
               }}
             >

+ 39 - 0
src/store/action/A6home.ts

@@ -0,0 +1,39 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ *首页管理-列表
+ */
+
+export const A6_APIgetList = (): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.get("cms/index/getList");
+    if (res.code === 0) {
+      dispatch({
+        type: "A6/getList",
+        payload: res.data,
+      });
+    }
+  };
+};
+
+/**
+ * 首页管理-删除
+ */
+export const A6_APIdel = (id: number) => {
+  return http.get(`cms/index/removes/${id}`);
+};
+
+/**
+ * 首页管理-获取详情
+ */
+export const A6_APIgetInfo = (id: number) => {
+  return http.get(`cms/index/detail/${id}`);
+};
+
+/**
+ * 首页管理-新增、编辑
+ */
+export const A6_APIsave = (data: any) => {
+  return http.post("cms/index/save", data);
+};

+ 25 - 0
src/store/action/A7poster.ts

@@ -0,0 +1,25 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ *海报-列表
+ */
+
+export const A7_APIgetList = (): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.get("cms/poster/getList");
+    if (res.code === 0) {
+      dispatch({
+        type: "A7/getList",
+        payload: res.data,
+      });
+    }
+  };
+};
+
+/**
+ * 海报-新增、编辑
+ */
+export const A7_APIsave = (data: any) => {
+  return http.post("cms/poster/save", data);
+};

+ 25 - 0
src/store/reducer/A6home.ts

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

+ 25 - 0
src/store/reducer/A7poster.ts

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

+ 4 - 0
src/store/reducer/index.ts

@@ -8,6 +8,8 @@ import A2exhibition from "./A2exhibition";
 import A3holding from "./A3holding";
 import A4study from "./A4study";
 import A5publish from "./A5publish";
+import A6home from "./A6home";
+import A7poster from "./A7poster";
 import A8dict from "./A8dict";
 import Z1user from "./Z1user";
 import Z2log from "./Z2log";
@@ -20,6 +22,8 @@ const rootReducer = combineReducers({
   A3holding,
   A4study,
   A5publish,
+  A6home,
+  A7poster,
   A8dict,
   Z1user,
   Z2log,

+ 9 - 0
src/types/api/A6home.d.ts

@@ -0,0 +1,9 @@
+export type A6tableType = {
+  id: number;
+  thumbPc: string;
+  thumbApp: string;
+  link: string;
+  updateTime: string;
+  creatorName: string;
+  sort: number;
+};

+ 8 - 0
src/types/api/A7poster.ts

@@ -0,0 +1,8 @@
+export type A7tableType = {
+  id: number;
+  name:string
+  thumbPc: string;
+  thumbApp: string;
+  updateTime: string;
+  creatorName: string;
+};

+ 2 - 0
src/types/index.d.ts

@@ -4,6 +4,8 @@ export * from './api/A2exhibition'
 export * from './api/A3holding'
 export * from './api/A4study'
 export * from './api/A5publish'
+export * from './api/A6home'
+export * from './api/A7poster'
 export * from './api/A8dict'
 export * from './api/Z1user'
 export * from './api/Z2log'

+ 1 - 1
src/utils/http.ts

@@ -7,7 +7,7 @@ import { domShowFu } from "./domShow";
 
 const envFlag = process.env.NODE_ENV === "development";
 
-// const baseUrlTemp = "xxxxxxxxxxx"; // 测试环境
+// const baseUrlTemp = "https://sit-shoubov2.4dage.com"; // 测试环境
 const baseUrlTemp = "http://192.168.20.61:8070"; // 线下环境
 
 const baseFlag = baseUrlTemp.includes("https://");

+ 17 - 0
src/utils/tableData.ts

@@ -81,6 +81,23 @@ export const A5tableCFu = (val: A5topType) => {
   return arr;
 };
 
+export const A6tableC = [
+  ["img", "PC端封面", "thumbPc"],
+  ["img", "移动端封面", "thumbApp"],
+  ["text", "链接", "link", 50, "A"],
+  ["txt", "最近编辑日期", "updateTime"],
+  ["txt", "编辑人", "creatorName"],
+  ["txt", "排序值", "sort"],
+];
+
+export const A7tableC = [
+  ["txt", "板块", "name"],
+  ["img", "PC端封面", "thumbPc"],
+  ["img", "移动端封面", "thumbApp"],
+  ["txt", "最近编辑日期", "updateTime"],
+  ["txt", "编辑人", "creatorName"],
+];
+
 export const A8tableC = [
   ["txt", "字典值", "name"],
   ["txt", "最近编辑日期", "updateTime"],