shaogen1995 il y a 1 an
Parent
commit
8c791a2333

+ 2 - 0
src/components/ZupOne/index.tsx

@@ -64,6 +64,8 @@ function ZupOne(
       if (e.target.files) {
         // 拿到files信息
         const filesInfo = e.target.files[0];
+        // console.log('-----',filesInfo.type);
+        
         // 校验格式
         const type = format;
         if (!type.includes(filesInfo.type)) {

+ 0 - 2
src/pages/A1wxuser/A1add/A1aEdit.tsx

@@ -31,8 +31,6 @@ function A1aEdit({ editInfo, closeFu, upTableFu }: Props) {
 
   // 点击确定
   const btnOkFu = useCallback(async () => {
-    // console.log({ inputNum, text });
-
     const obj = {
       description: text,
       score: inputNum,

+ 12 - 2
src/pages/A4store/index.tsx

@@ -1,7 +1,7 @@
 import React, { useCallback, useEffect, useMemo, useState } from "react";
 import styles from "./index.module.scss";
 import { useDispatch, useSelector } from "react-redux";
-import { A4_APIgetList } from "@/store/action/A4store";
+import { A4_APIdel, A4_APIgetList } from "@/store/action/A4store";
 import { RootState } from "@/store";
 import { A4tableType } from "@/types";
 import { Button } from "antd";
@@ -10,6 +10,7 @@ import MyTable from "@/components/MyTable";
 import { A4tableC } from "@/utils/tableData";
 import A3set from "./A3set";
 import A3Edit from "./A3Edit";
+import { MessageFu } from "@/utils/message";
 function A4store() {
   const dispatch = useDispatch();
 
@@ -37,7 +38,16 @@ function A4store() {
   const tableInfo = useSelector((state: RootState) => state.A4store.tableInfo);
 
   // 点击删除
-  const delTableFu = useCallback(async (id: number) => {}, []);
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await A4_APIdel(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功!");
+        getListFu();
+      }
+    },
+    [getListFu]
+  );
 
   const tableLastBtn = useMemo(() => {
     return [

+ 198 - 0
src/pages/A7school/A7tab1M.tsx

@@ -0,0 +1,198 @@
+import React, { useCallback, useEffect, useRef, useState } from "react";
+import styles from "./index.module.scss";
+import {
+  Button,
+  Form,
+  FormInstance,
+  Input,
+  InputNumber,
+  Modal,
+  Select,
+} from "antd";
+import { A7_APIgetInfo, A7_APIgetListByTheme } from "@/store/action/A7school";
+import { ListType } from "./A7theme";
+import MyPopconfirm from "@/components/MyPopconfirm";
+import TextArea from "antd/es/input/TextArea";
+import ZupOne from "@/components/ZupOne";
+
+type Props = {
+  fId: number;
+  closeFu: () => void;
+  addTableFu: () => void;
+  upTableFu: () => void;
+};
+
+function A7tab1M({ fId, closeFu, addTableFu, upTableFu }: Props) {
+  // 设置表单初始数据(区分编辑和新增)
+  const FormBoxRef = useRef<FormInstance>(null);
+
+  const getInfoFu = useCallback(async (id: number) => {
+    const res = await A7_APIgetInfo(id);
+    if (res.code === 0) {
+      console.log(123, res);
+      // setDirCode()
+    }
+  }, []);
+
+  const [selList, setSelList] = useState<ListType[]>([]);
+
+  const getSelList = useCallback(async () => {
+    const res = await A7_APIgetListByTheme();
+    if (res.code === 0) setSelList(res.data);
+  }, []);
+
+  useEffect(() => {
+    getSelList();
+    if (fId > 0) getInfoFu(fId);
+    else {
+      // FormBoxRef.current?.setFieldsValue({});
+    }
+  }, [fId, getInfoFu, getSelList]);
+
+  // 附件的ref
+  const ZupOneRef1 = useRef<any>(null);
+  const ZupOneRef2 = useRef<any>(null);
+
+  // 附件 是否 已经点击过确定
+  const [fileCheck, setFileCheck] = useState(false);
+
+  // 文件的code码
+  const [dirCode, setDirCode] = useState("");
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {
+    setFileCheck(true);
+  }, []);
+  // 通过校验点击确定
+  const onFinish = useCallback(async (values: any) => {
+    setFileCheck(true);
+  }, []);
+
+  return (
+    <Modal
+      wrapClassName={styles.A7tab1M}
+      open={true}
+      title={`${fId > 0 ? "编辑" : "新增"}口述史`}
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className="A7mMaiin">
+        <Form
+          scrollToFirstError={true}
+          ref={FormBoxRef}
+          name="basic"
+          labelCol={{ span: 3 }}
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete="off"
+        >
+          <Form.Item
+            label="人物姓名"
+            name="name"
+            rules={[{ required: true, message: "请输入人物姓名!" }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <Input maxLength={10} showCount placeholder="请输入内容" />
+          </Form.Item>
+
+          <Form.Item
+            label="人物简介"
+            name="description"
+            rules={[{ required: true, message: "请输入人物简介!" }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <TextArea maxLength={200} showCount placeholder="请输入内容" />
+          </Form.Item>
+
+          <Form.Item
+            label="排序值"
+            name="sort"
+            rules={[{ required: true, message: "请输入排序值!" }]}
+          >
+            <InputNumber
+              min={1}
+              max={999}
+              precision={0}
+              placeholder="请输入1~999,数字越小,排序越前"
+            />
+          </Form.Item>
+
+          <Form.Item
+            label="采访主题"
+            name="dictId"
+            rules={[{ required: true, message: "请选择采访主题!" }]}
+          >
+            <Select
+              placeholder="请选择"
+              style={{ width: 200 }}
+              options={selList.map((v) => ({
+                value: v.id,
+                label: v.name,
+              }))}
+            />
+          </Form.Item>
+          {/* 封面 */}
+          <div className="formRow">
+            <div className="formLeft">
+              <span>* </span>
+              人物肖像:
+            </div>
+            <div className="formRight">
+              <ZupOne
+                ref={ZupOneRef1}
+                isLook={false}
+                fileCheck={fileCheck}
+                size={2}
+                dirCode={dirCode}
+                myUrl="cms/person/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={ZupOneRef2}
+                isLook={false}
+                fileCheck={fileCheck}
+                size={500}
+                dirCode={dirCode}
+                myUrl="cms/person/upload"
+                format={["video/mp4"]}
+                formatTxt="mp4"
+                checkTxt="请上传采访视频"
+                upTxt=""
+                myType="video"
+              />
+            </div>
+          </div>
+
+          {/* 确定和取消按钮 */}
+          <Form.Item className="A7mbtn">
+            <Button type="primary" htmlType="submit">
+              提交
+            </Button>
+            <br />
+            <br />
+            <MyPopconfirm txtK="取消" onConfirm={closeFu} />
+          </Form.Item>
+        </Form>
+      </div>
+    </Modal>
+  );
+}
+
+const MemoA7tab1M = React.memo(A7tab1M);
+
+export default MemoA7tab1M;

+ 93 - 0
src/pages/A7school/A7table.tsx

@@ -0,0 +1,93 @@
+import MyPopconfirm from "@/components/MyPopconfirm";
+import MyTable from "@/components/MyTable";
+import { RootState } from "@/store";
+import { A7_APIgetList } from "@/store/action/A7school";
+import { A7tableType } from "@/types";
+import { A7tableC1, A7tableC2 } from "@/utils/tableData";
+import { Button } from "antd";
+import React, { useCallback, useEffect, useMemo, useState } from "react";
+import { useDispatch, useSelector } from "react-redux";
+import { forwardRef, useImperativeHandle } from "react";
+
+type Props = {
+  type: "口述史" | "刊物";
+  editTableFu: (id: number) => void;
+  ref: any;
+};
+
+function A7tab1({ type, editTableFu }: Props, ref: any) {
+  const dispatch = useDispatch();
+
+  const [fromData, setFromData] = useState({
+    pageNum: 1,
+    pageSize: 10,
+  });
+
+  const getListFu = useCallback(() => {
+    dispatch(A7_APIgetList(fromData, type));
+  }, [dispatch, fromData, type]);
+
+  useEffect(() => {
+    getListFu();
+  }, [getListFu]);
+
+  const tableInfo = useSelector((state: RootState) =>
+    type === "口述史" ? state.A7school.tableInfo1 : state.A7school.tableInfo2
+  );
+
+  // 点击删除
+  const delTableFu = useCallback(async (id: number) => {}, []);
+
+  // 新增完成之后 重新获取数据
+  const resetSelectFu = useCallback(() => {
+    setFromData({
+      pageNum: 1,
+      pageSize: 10,
+    });
+  }, []);
+
+  // 可以让父组件调用子组件的方法
+  useImperativeHandle(ref, () => ({
+    resetSelectFu,
+    getListFu,
+  }));
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: "操作",
+        render: (item: A7tableType) => (
+          <>
+            <Button
+              size="small"
+              type="text"
+              onClick={() => editTableFu(item.id)}
+            >
+              编辑
+            </Button>
+            <MyPopconfirm txtK="删除" onConfirm={() => delTableFu(item.id)} />
+          </>
+        ),
+      },
+    ];
+  }, [delTableFu, editTableFu]);
+
+  return (
+    <MyTable
+      yHeight={640}
+      list={tableInfo.list}
+      columnsTemp={type === "口述史" ? A7tableC1 : A7tableC2}
+      lastBtn={tableLastBtn}
+      pageNum={fromData.pageNum}
+      pageSize={fromData.pageSize}
+      total={tableInfo.total}
+      onChange={(pageNum, pageSize) =>
+        setFromData({ ...fromData, pageNum, pageSize })
+      }
+    />
+  );
+}
+
+// const MemoA7tab1 = React.memo(A7tab1);
+
+export default forwardRef(A7tab1);

+ 74 - 0
src/pages/A7school/A7theme/A7tEdit.tsx

@@ -0,0 +1,74 @@
+import React, { useCallback, useEffect, useState } from "react";
+import styles from "./index.module.scss";
+import { Button, Input, Modal } from "antd";
+import MyPopconfirm from "@/components/MyPopconfirm";
+import { A7_APIthemeSave } from "@/store/action/A7school";
+import { MessageFu } from "@/utils/message";
+
+type Props = {
+  editInfo: { id: number; name: string };
+  upTableFu: () => void;
+  closeFu: () => void;
+};
+
+function A7tEdit({ editInfo, upTableFu, closeFu }: Props) {
+  const [text, setText] = useState("");
+
+  useEffect(() => {
+    if (editInfo.name) setText(editInfo.name);
+  }, [editInfo.name]);
+
+  const btnOkFu = useCallback(async () => {
+    const res = await A7_APIthemeSave({
+      id: editInfo.id > 0 ? editInfo.id : null,
+      name: text,
+      display:1,
+      type: "dict-person",
+    });
+    if (res.code === 0) {
+      MessageFu.success(editInfo.id > 0 ? "编辑成功!" : "新增成功!");
+      upTableFu();
+      closeFu();
+    }
+  }, [closeFu, editInfo.id, text, upTableFu]);
+
+  return (
+    <Modal
+      wrapClassName={styles.A7tEdit}
+      open={true}
+      title={(editInfo.id > 0 ? "编辑" : "新增") + "采访主题"}
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className="A7tMain">
+        <div className="A7tErow">
+          <div className="A7tErow1">
+            <span>* </span>采访主题:
+          </div>
+          <div className="A7tErow2">
+            <Input
+              value={text}
+              onChange={(e) => setText(e.target.value.replace(/\s+/g, ""))}
+              placeholder="请输入文字"
+              showCount
+              maxLength={20}
+            />
+          </div>
+        </div>
+
+        <div className="A7tEbtn">
+          <Button type="primary" onClick={btnOkFu} disabled={text.length <= 0}>
+            提交
+          </Button>
+          &emsp;
+          <MyPopconfirm txtK="取消" onConfirm={closeFu} />
+        </div>
+      </div>
+    </Modal>
+  );
+}
+
+const MemoA7tEdit = React.memo(A7tEdit);
+
+export default MemoA7tEdit;

+ 67 - 0
src/pages/A7school/A7theme/index.module.scss

@@ -0,0 +1,67 @@
+.A7theme {
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 12;
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 24px;
+
+  :global {
+    .A7tBack {
+      text-align: right;
+      margin-bottom: 15px;
+    }
+  }
+}
+
+// 新增和编辑的弹窗
+.A7tEdit {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 800px !important;
+    }
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+    }
+
+    .A7tMain {
+      padding-top: 15px;
+
+      .A7tErow {
+        display: flex;
+        margin-bottom: 24px;
+
+        .A7tErow1 {
+          position: relative;
+          top: 3px;
+          width: 90px;
+          text-align: right;
+
+          &>span {
+            color: #ff4d4f;
+          }
+        }
+
+        .A7tErow2 {
+          width: calc(100% - 90px);
+
+          .ant-input-number {
+            width: 100%;
+          }
+        }
+      }
+
+      .A7tEbtn {
+        text-align: center;
+      }
+    }
+  }
+}

+ 136 - 0
src/pages/A7school/A7theme/index.tsx

@@ -0,0 +1,136 @@
+import React, { useCallback, useEffect, useMemo, useState } from "react";
+import styles from "./index.module.scss";
+import { Button } from "antd";
+import MyTable from "@/components/MyTable";
+import {
+  A7_APIgetListByTheme,
+  A7_APIthemeDel,
+  A7_APIthemeSort,
+} from "@/store/action/A7school";
+import { A7tableCtheme } from "@/utils/tableData";
+import MyPopconfirm from "@/components/MyPopconfirm";
+import { MessageFu } from "@/utils/message";
+import A7tEdit from "./A7tEdit";
+
+export type ListType = {
+  id: number;
+  name: string;
+};
+
+type Props = {
+  closeFu: () => void;
+};
+
+function A7theme({ closeFu }: Props) {
+  const getListFu = useCallback(async () => {
+    const res = await A7_APIgetListByTheme();
+    if (res.code === 0) {
+      setList(res.data);
+    }
+  }, []);
+
+  useEffect(() => {
+    getListFu();
+  }, [getListFu]);
+
+  const [list, setList] = useState<ListType[]>([]);
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await A7_APIthemeDel(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功!");
+        getListFu();
+      }
+    },
+    [getListFu]
+  );
+
+  // 点击上移和下移动
+  const moveTableFu = useCallback(
+    async (id1: number, id2: number) => {
+      const res = await A7_APIthemeSort(id1, id2);
+      if (res.code === 0) getListFu();
+    },
+    [getListFu]
+  );
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: "操作",
+        render: (item: ListType, _: any, index: number) => (
+          <>
+            <Button
+              size="small"
+              type="text"
+              onClick={() => moveTableFu(item.id, list[index - 1].id)}
+              disabled={index === 0}
+            >
+              上移
+            </Button>
+            <Button
+              size="small"
+              type="text"
+              onClick={() => moveTableFu(item.id, list[index + 1].id)}
+              disabled={index === list.length - 1}
+            >
+              下移
+            </Button>
+            <Button
+              size="small"
+              type="text"
+              onClick={() => setEditInfo({ id: item.id, name: item.name })}
+            >
+              编辑
+            </Button>
+            <MyPopconfirm txtK="删除" onConfirm={() => delTableFu(item.id)} />
+          </>
+        ),
+      },
+    ];
+  }, [delTableFu, list, moveTableFu]);
+
+  // 点击新增
+  const [editInfo, setEditInfo] = useState({ id: 0, name: "" });
+
+  return (
+    <div className={styles.A7theme}>
+      <div className="A7tBack">
+        <Button
+          type="primary"
+          onClick={() => {
+            if (list.length >= 20) {
+              return MessageFu.warning("最多20个主题!");
+            }
+            setEditInfo({ id: -1, name: "" });
+          }}
+        >
+          新增
+        </Button>
+        &emsp;
+        <Button onClick={closeFu}>返回</Button>
+      </div>
+      <MyTable
+        yHeight={680}
+        list={list}
+        lastBtn={tableLastBtn}
+        columnsTemp={A7tableCtheme}
+        pagingInfo={false}
+      />
+
+      {editInfo.id ? (
+        <A7tEdit
+          editInfo={editInfo}
+          upTableFu={() => getListFu()}
+          closeFu={() => setEditInfo({ id: 0, name: "" })}
+        />
+      ) : null}
+    </div>
+  );
+}
+
+const MemoA7theme = React.memo(A7theme);
+
+export default MemoA7theme;

+ 81 - 0
src/pages/A7school/index.module.scss

@@ -0,0 +1,81 @@
+.A7school {
+  border-radius: 10px;
+  background-color: #fff;
+  padding: 15px 0;
+  position: relative;
+
+  :global {
+    .A7top {
+      padding: 0 24px;
+      display: flex;
+      justify-content: space-between;
+    }
+
+    .A7main {
+      border-radius: 10px;
+      overflow: hidden;
+      margin-top: 15px;
+      height: calc(100% - 32px);
+    }
+  }
+}
+
+
+.A7tab1M {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 1000px !important;
+    }
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+    }
+
+    .A7mMaiin {
+      margin-top: 15px;
+      width: 100%;
+      height: 100%;
+      overflow-y: auto;
+
+      .ant-form {
+        width: 800px;
+
+        .ant-input-number {
+          width: 260px;
+        }
+
+
+        .formRow {
+          display: flex;
+
+          .formLeft {
+            position: relative;
+            top: 3px;
+            width: 103px;
+            text-align: right;
+
+            &>span {
+              color: #ff4d4f;
+            }
+          }
+
+          .formRight {
+            width: calc(100% - 103px);
+          }
+        }
+
+        .A7mbtn {
+          position: absolute;
+          z-index: 10;
+          right: 60px;
+          top: 50%;
+          transform: translateY(-50%);
+        }
+      }
+    }
+  }
+}

+ 102 - 0
src/pages/A7school/index.tsx

@@ -0,0 +1,102 @@
+import React, { useRef, useState } from "react";
+import styles from "./index.module.scss";
+import { Button } from "antd";
+import A7tab1 from "./A7table";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+import { MessageFu } from "@/utils/message";
+import A7theme from "./A7theme";
+import A7tab1M from "./A7tab1M";
+
+const topArr: ("口述史" | "刊物")[] = ["口述史", "刊物"];
+
+function A7school() {
+  const [pageAc, setPageAc] = useState<"口述史" | "刊物">("口述史");
+
+  const [openSon, setOpenSon] = useState(0);
+
+  const { tableInfo1 } = useSelector((state: RootState) => state.A7school);
+
+  // 采访主题
+  const [theme, setTheme] = useState(false);
+
+  // 2个表格的ref
+  const tableRef1 = useRef<any>(null);
+  const tableRef2 = useRef<any>(null);
+
+  return (
+    <div className={styles.A7school}>
+      <div className="pageTitle">
+        云学习管理 {theme ? " - 采访主题设置" : ""}
+      </div>
+      {/* 顶部筛选 */}
+      <div className="A7top">
+        <div>
+          {topArr.map((v) => (
+            <Button
+              key={v}
+              type={v === pageAc ? "primary" : "default"}
+              onClick={() => setPageAc(v)}
+            >
+              {v}
+            </Button>
+          ))}
+        </div>
+        <div>
+          <Button
+            type="primary"
+            hidden={pageAc !== "口述史"}
+            onClick={() => setTheme(true)}
+          >
+            采访主题设置
+          </Button>
+          &emsp;
+          <Button
+            type="primary"
+            onClick={() => {
+              if (pageAc === "口述史" && tableInfo1.list.length >= 100) {
+                return MessageFu.warning("最多100条数据!");
+              }
+              setOpenSon(-1);
+            }}
+          >
+            新增
+          </Button>
+        </div>
+      </div>
+      <div className="A7main">
+        <div hidden={pageAc !== "口述史"}>
+          <A7tab1
+            type={"口述史"}
+            editTableFu={(id) => setOpenSon(id)}
+            ref={tableRef1}
+          />
+        </div>
+        <div hidden={pageAc !== "刊物"}>
+          <A7tab1
+            type={"刊物"}
+            editTableFu={(id) => setOpenSon(id)}
+            ref={tableRef2}
+          />
+        </div>
+      </div>
+
+      {/* 采访主题 */}
+      {theme ? <A7theme closeFu={() => setTheme(false)} /> : null}
+
+      {/* 口述史 新增 编辑 */}
+      {openSon && pageAc === "口述史" ? (
+        <A7tab1M
+          fId={openSon}
+          closeFu={() => setOpenSon(0)}
+          addTableFu={() => tableRef2.current.resetSelectFu()}
+          upTableFu={() => tableRef2.current.getListFu()}
+        />
+      ) : null}
+    </div>
+  );
+}
+
+const MemoA7school = React.memo(A7school);
+
+export default MemoA7school;

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

@@ -42,13 +42,13 @@ const tabLeftArr: RouterType = [
         path: "/message",
         Com: React.lazy(() => import("../A6message")),
       },
-      // {
-      //   id: 700,
-      //   name: "学习资料",
-      //   path: "/store",
-      //   Com: React.lazy(() => import("../A4store")),
-      //
-      // },
+      {
+        id: 700,
+        name: "云学习管理",
+        path: "/school",
+        Com: React.lazy(() => import("../A7school")),
+      
+      },
       // {
       //   id: 800,
       //   name: "云城介绍",

+ 7 - 0
src/store/action/A4store.ts

@@ -43,3 +43,10 @@ export const A4_APIgetInfo = (id: number) => {
 export const A4_APIsave = (data: any) => {
   return http.post("cms/prize/save", data);
 };
+
+/**
+ * 删除
+ */
+export const A4_APIdel = (id: number) => {
+  return http.get(`cms/prize/removes/${id}`);
+};

+ 60 - 0
src/store/action/A7school.ts

@@ -0,0 +1,60 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+/**
+ * 获取 云学校 列表
+ */
+export const A7_APIgetList = (data: any, type: "口述史" | "刊物") => {
+  return async (dispatch: AppDispatch) => {
+    const flag = type === "口述史";
+    const res = await http.post(
+      `cms/${flag ? "person" : "periodical"}/pageList`,
+      data
+    );
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total,
+      };
+
+      dispatch({
+        type: flag ? "A7/getList1" : "A7/getList2",
+        payload: obj,
+      });
+    }
+  };
+};
+
+/**
+ * 获取采访主题列表
+ */
+export const A7_APIgetListByTheme = () => {
+  return http.get("cms/person/getDict");
+};
+
+/**
+ * 采访主题 - 删除
+ */
+export const A7_APIthemeDel = (id: number) => {
+  return http.get(`cms/dict/remove/${id}`);
+};
+
+/**
+ * 采访主题 - 排序
+ */
+export const A7_APIthemeSort = (id1: number, id2: number) => {
+  return http.get(`cms/dict/sort/${id1}/${id2}`);
+};
+
+/**
+ * 采访主题 - 新增、编辑
+ */
+export const A7_APIthemeSave = (data: any) => {
+  return http.post("cms/dict/save", data);
+};
+
+/**
+ * 口述史 - 详情
+ */
+export const A7_APIgetInfo = (id: number) => {
+  return http.get(`cms/person/detail/${id}`);
+};

+ 39 - 0
src/store/reducer/A7school.ts

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

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

@@ -9,6 +9,7 @@ import A3record from "./A3record";
 import A4store from "./A4store";
 import A5cash from "./A5cash";
 import A6message from "./A6message";
+import A7school from "./A7school";
 import Z1user from "./Z1user";
 import Z2log from "./Z2log";
 
@@ -21,6 +22,7 @@ const rootReducer = combineReducers({
   A4store,
   A5cash,
   A6message,
+  A7school,
   Z1user,
   Z2log,
 });

+ 1 - 0
src/types/api/A7school.d.ts

@@ -0,0 +1 @@
+export type A7tableType =any

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

@@ -5,5 +5,6 @@ export * from './api/A3record'
 export * from './api/A4store'
 export * from './api/A5cash'
 export * from './api/A6message'
+export * from './api/A7school'
 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 = "https://sit-chaozhoubwg.4dage.com"; // 测试环境
+// const baseUrlTemp = "https://sit-wuxicishan.4dage.com"; // 测试环境
 const baseUrlTemp = "http://192.168.20.61:8066"; // 线下环境
 
 const baseFlag = baseUrlTemp.includes("https://");

+ 14 - 0
src/utils/tableData.ts

@@ -76,6 +76,20 @@ export const A6tableC = [
   ["text", "反馈内容", "content", 50],
 ];
 
+export const A7tableC1 = [
+  ["txt", "时间", "createTime"],
+  ["txt", "称呼", "name"],
+  ["txt", "联系方式", "phone"],
+  ["text", "反馈内容", "content", 50],
+];
+export const A7tableC2 = [
+  ["txt", "时间2", "createTime"],
+  ["txt", "称呼", "name"],
+  ["txt", "联系方式", "phone"],
+  ["text", "反馈内容", "content", 50],
+];
+export const A7tableCtheme = [["txt", "采访主题", "name"]];
+
 export const Z1tableC = [
   ["txt", "用户名", "userName"],
   ["txtChange", "角色", "isAdmin", { 1: "管理员", 0: "普通成员" }],