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

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

@@ -94,7 +94,7 @@ function Z_upFileOtherList(
 
   // 给父组件返回 fileIds
   const fileIdsRefFu = useCallback(() => {
-    return fileList.map((v) => v.id).join(",");
+    return fileList;
   }, [fileList]);
 
   // 可以让父组件调用子组件的方法

+ 98 - 0
src/pages/A2Goods/A2Register/A2AddModal/index.module.scss

@@ -0,0 +1,98 @@
+// 新增和编辑弹窗的样式
+.A2AddModal {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 1200px !important;
+      max-width: 1200px !important;
+      top: 50px;
+
+      .A2RAmain {
+        display: flex;
+        position: relative;
+        padding-bottom: 50px;
+        border-top: 1px solid #ccc;
+        padding-top: 15px;
+
+
+        .ant-form {
+          width: 700px;
+
+          .ant-form-item-label{
+            width: 52px;
+          }
+
+          .A2RArow {
+            display: flex;
+            justify-content: space-between;
+
+            .ant-form-item {
+              width: 50%;
+
+    
+            }
+            .A2RArowLabel{
+              .ant-form-item-label {
+                width: 80px;
+              }
+            }
+
+          }
+          .A2RArow2{
+            .ant-form-item{
+              width: 33.33%;
+            }
+          }
+
+          .A2RAbtn {
+            position: absolute;
+            bottom: 0px;
+            left: 50%;
+            transform: translateX(-50%);
+            margin-bottom: 0;
+          }
+        }
+
+        .A2RAmainRight {
+          width: 480px;
+          margin-left: 20px;
+          .A2RAFormRow{
+            margin-bottom: 24px;
+            display: flex;
+            .A2RAFormRowll{
+              width: 85px;
+              text-align: right;
+              &>span{
+                color: #ff4d4f;
+              }
+            }
+            .A2RAFormRowrr{
+              width: calc(100% - 85px);
+            }
+          }
+        }
+      }
+
+      .A2RAmainOldToNew{
+        padding-bottom: 60px;
+        min-height: 668px;
+        textarea{
+          min-height: 80px !important;
+        }
+        .A2RAoldToNewTxt{
+          padding-top: 10px;
+          margin-top: -24px;
+          display: flex;
+          &>div{
+            width: 80px;
+          }
+        }
+      }
+
+
+    }
+  }
+}

+ 147 - 15
src/pages/A2Goods/A2Register/A2AddModal.tsx

@@ -10,20 +10,36 @@ import {
   Popconfirm,
   Select,
 } from "antd";
-import { A2addInfoType, A2inTableType, options1 } from "../data";
+import { A2addInfoType, A2inTableType, options1 } from "../../data";
 import TextArea from "antd/es/input/TextArea";
 import ZupFileOne from "@/components/Z_upFileOne";
 import ZupFileOtherList, { FileListType } from "@/components/Z_upFileOtherList";
-import { A2_APIaddSon, A2_APIgetInfoSon } from "@/store/action/A2Goods";
+import {
+  A2_APIaddSon,
+  A2_APIgetInfoSon,
+  A2_APIoldToNew,
+} from "@/store/action/A2Goods";
 import { MessageFu } from "@/utils/message";
+import classNmaes from "classnames";
+import history from "@/utils/history";
 
 type Props = {
   addInfo: A2addInfoType;
   upTableFu: (item: A2inTableType, flag: "新增" | "编辑") => void;
   closeFu: () => void;
+  idOldToNew?: boolean; //藏品修改,新旧记录
 };
 
-function A2AddModal({ addInfo, upTableFu, closeFu }: Props) {
+function A2AddModal({ addInfo, upTableFu, closeFu, idOldToNew }: Props) {
+  // 把旧的 对象信息 和旧的 附件信息
+  const oldInfo = useRef({
+    obj: {} as A2inTableType,
+    file: [] as FileListType[],
+  });
+
+  // 新旧对比的 申请说明
+  const [description, setDescription] = useState("");
+
   // 获取详情的方法
   const getInfoFu = useCallback(async (id: number) => {
     const res = await A2_APIgetInfoSon(id);
@@ -31,7 +47,14 @@ function A2AddModal({ addInfo, upTableFu, closeFu }: Props) {
     const file = res.data.file as FileListType[];
 
     // size 参数
-    const sizeArr = info.size.split(",");
+    let sizeArr = info.size.split(",");
+
+    if (sizeArr && sizeArr.length) {
+      sizeArr = sizeArr.map((v) => v.replace(" ", ""));
+    }
+
+    // 把旧的 对象信息 和旧的 附件信息存起来
+    oldInfo.current = { obj: res.data.entity, file: res.data.file };
 
     FormBoxRef.current?.setFieldsValue({
       ...info,
@@ -79,7 +102,7 @@ function A2AddModal({ addInfo, upTableFu, closeFu }: Props) {
     async (value: any) => {
       setIsOk(true);
 
-      const fileIds = fileRef.current.fileIdsRefFu();
+      const nweFileIdArr: FileListType[] = fileRef.current.fileIdsRefFu();
 
       if (!thumb) return;
 
@@ -89,34 +112,129 @@ function A2AddModal({ addInfo, upTableFu, closeFu }: Props) {
         value.sizeGao || " ",
       ];
 
-      const obj = {
+      const newObj = {
         ...value,
         id: addInfo.txt === "新增" ? null : addInfo.id,
         size: size.join(","),
         thumb,
-        fileIds,
+        fileIds: nweFileIdArr.map((v) => v.id).join(","),
+        dirCode,
       };
 
-      const res = await A2_APIaddSon(obj);
-      if (res.code === 0) {
-        MessageFu.success(`${addInfo.txt}成功!`);
-        upTableFu(res.data, addInfo.txt === "新增" ? "新增" : "编辑");
-        closeFu();
+      // -----------------藏品修改  新旧对比
+      if (idOldToNew) {
+        // 之前的 对象 信息
+        // console.log(oldInfo.current);
+        const tempApp = [
+          "name",
+          "num",
+          "dictAge",
+          "dictTexture",
+          "size",
+          "quality",
+          "pcs",
+          "source",
+          "complete",
+          "dictLevel",
+          "levelTime",
+          "description",
+          "thumb",
+          // "id",
+        ];
+
+        // 有变化的数据---更新前
+        const before = { id: addInfo.id } as A2inTableType;
+        // 有变化的数据---更新后
+        const after = { id: addInfo.id } as A2inTableType;
+
+        for (const k in oldInfo.current.obj) {
+          if (tempApp.includes(k)) {
+            const oldVal = Reflect.get(oldInfo.current.obj, k);
+            const newVal = Reflect.get(newObj, k);
+
+            if (oldVal !== newVal) {
+              Reflect.set(before, k, oldVal);
+              Reflect.set(after, k, newVal);
+            }
+          }
+        }
+
+        // 修改前的的附件名字集合
+        const oldFileNames = oldInfo.current.file.map((v) => v.name).join(",");
+        // 修改后的附件名字集合
+        const newFileNames = nweFileIdArr.map((v) => v.name).join(",");
+
+        // 如果附件的名字集合(,)不相同了
+        if (oldFileNames !== newFileNames) {
+          Reflect.set(before, "fileNames", oldFileNames);
+          Reflect.set(after, "fileNames", newFileNames);
+          Reflect.set(
+            before,
+            "fileIds",
+            oldInfo.current.file.map((v) => v.id).join(",")
+          );
+          Reflect.set(
+            after,
+            "fileIds",
+            nweFileIdArr.map((v) => v.id).join(",")
+          );
+        }
+
+        console.log("修改前", before);
+        console.log("修改后", after);
+
+        if (Object.keys(after).length <= 1)
+          return MessageFu.warning("藏品信息和之前相同!");
+
+        const res = await A2_APIoldToNew({
+          beforeGoods: before,
+          afterGoods: after,
+          description,
+        });
+
+        if (res.code === 0) {
+          MessageFu.success("修改藏品成功!");
+          if (window.location.hash.includes("/submit")) {
+            history.replace("/404");
+            window.setTimeout(() => {
+              history.push("/submit");
+            }, 200);
+          } else history.push("/submit");
+        }
+      } else {
+        // 正常的新增和编辑
+        const res = await A2_APIaddSon(newObj);
+        if (res.code === 0) {
+          MessageFu.success(`${addInfo.txt}成功!`);
+          upTableFu(res.data, addInfo.txt === "新增" ? "新增" : "编辑");
+          closeFu();
+        }
       }
     },
-    [addInfo.id, addInfo.txt, closeFu, thumb, upTableFu]
+    [
+      addInfo.id,
+      addInfo.txt,
+      closeFu,
+      description,
+      dirCode,
+      idOldToNew,
+      thumb,
+      upTableFu,
+    ]
   );
 
   return (
     <Modal
       wrapClassName={styles.A2AddModal}
       open={true}
-      title={addInfo.txt}
+      title={idOldToNew ? "藏品修改" : addInfo.txt + "藏品"}
       footer={
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
     >
-      <div className="A2RAmain">
+      <div
+        className={classNmaes("A2RAmain", idOldToNew ? "A2RAmainOldToNew" : "")}
+      >
         <Form
           scrollToFirstError={true}
           ref={FormBoxRef}
@@ -262,6 +380,20 @@ function A2AddModal({ addInfo, upTableFu, closeFu }: Props) {
               <Button>取消</Button>
             </Popconfirm>
           </Form.Item>
+
+          {/* 新旧对比的说明 */}
+          {idOldToNew ? (
+            <div className="A2RAoldToNewTxt">
+              <div>申请说明:</div>
+              <TextArea
+                value={description}
+                onChange={(e) => setDescription(e.target.value)}
+                placeholder="请输入内容"
+                showCount
+                maxLength={200}
+              />
+            </div>
+          ) : null}
         </Form>
         <div className="A2RAmainRight">
           {/* 封面图和附件 */}

+ 0 - 82
src/pages/A2Goods/A2Register/index.module.scss

@@ -68,85 +68,3 @@
   }
 }
 
-// 新增和编辑弹窗的样式
-.A2AddModal {
-  :global {
-    .ant-modal-close {
-      display: none;
-    }
-
-    .ant-modal {
-      width: 1200px !important;
-      max-width: 1200px !important;
-      top: 50px;
-
-      .A2RAmain {
-        display: flex;
-        position: relative;
-        padding-bottom: 50px;
-        border-top: 1px solid #ccc;
-        padding-top: 15px;
-
-
-        .ant-form {
-          width: 700px;
-
-          .ant-form-item-label{
-            width: 52px;
-          }
-
-          .A2RArow {
-            display: flex;
-            justify-content: space-between;
-
-            .ant-form-item {
-              width: 50%;
-
-    
-            }
-            .A2RArowLabel{
-              .ant-form-item-label {
-                width: 80px;
-              }
-            }
-
-          }
-          .A2RArow2{
-            .ant-form-item{
-              width: 33.33%;
-            }
-          }
-
-          .A2RAbtn {
-            position: absolute;
-            bottom: 0px;
-            left: 50%;
-            transform: translateX(-50%);
-            margin-bottom: 0;
-          }
-        }
-
-        .A2RAmainRight {
-          width: 480px;
-          margin-left: 20px;
-          .A2RAFormRow{
-            margin-bottom: 24px;
-            display: flex;
-            .A2RAFormRowll{
-              width: 85px;
-              text-align: right;
-              &>span{
-                color: #ff4d4f;
-              }
-            }
-            .A2RAFormRowrr{
-              width: calc(100% - 85px);
-            }
-          }
-        }
-      }
-
-
-    }
-  }
-}

+ 1 - 1
src/pages/A2Goods/A2Register/index.tsx

@@ -120,7 +120,7 @@ function A2Register({ closeFu, outInfo, upInfoFu }: Props) {
           Reflect.get(storageStatusTxtObj, item.storageStatus) || "-",
       },
       {
-        title: "备注",
+        title: "操作",
         render: (item: A2inTableType) => (
           <>
             <Button

+ 2 - 2
src/pages/A2Goods/data.ts

@@ -125,9 +125,9 @@ export type A2inTableType ={
 	quality: string;
 	size: string;
 	source: string;
-	status: string;
+	status: number;
 	storageIds: string;
-	storageStatus: string;
+	storageStatus: number;
 	thumb: string;
 	updateTime: string;
 }

+ 3 - 1
src/pages/A2Goods/index.module.scss

@@ -27,7 +27,9 @@
         height: 625px;
         overflow-y: auto !important;
         overflow-y: overlay !important;
-
+        .ant-table-cell{
+          padding: 8px;
+        }
       }
     }
   }

+ 91 - 5
src/pages/A2Goods/index.tsx

@@ -1,16 +1,28 @@
-import React, { useCallback, useEffect, useRef, useState } from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
-import { useDispatch } from "react-redux";
+import { useDispatch, useSelector } from "react-redux";
 import {
   A2addInfoType,
   A2selectType,
   options1,
   options2,
   options3,
+  statusTxtObj,
+  storageStatusTxtObj,
 } from "./data";
-import { Button, Input, Select } from "antd";
+import { Button, Input, Select, Table } from "antd";
 import { A2_APIgetList } from "@/store/action/A2Goods";
 import A2Register from "./A2Register";
+import { RootState } from "@/store";
+import { A2tableType } from "@/types";
+import ImageLazy from "@/components/ImageLazy";
+import B1Look from "../B1Submit/B1Look";
 function A2Goods() {
   const dispatch = useDispatch();
 
@@ -63,6 +75,77 @@ function A2Goods() {
   // 点击 申请登记
   const [outInfo, setOutInfo] = useState<A2addInfoType>({ id: 0, txt: "" });
 
+  // 从仓库获取藏品清单 表格列表
+  const A2TableList = useSelector(
+    (state: RootState) => state.A2Goods.tableInfo
+  );
+
+  // 页码变化
+  const paginationChange = useCallback(
+    () => (pageNum: number, pageSize: number) => {
+      setTableSelect({ ...tableSelect, pageNum, pageSize });
+    },
+    [tableSelect]
+  );
+
+  const columns = useMemo(() => {
+    return [
+      {
+        title: "缩略图",
+        render: (item: A2tableType) => (
+          <div className="tableImgAuto">
+            <ImageLazy width={60} height={60} src={item.thumb} />
+          </div>
+        ),
+      },
+      {
+        title: "编号",
+        dataIndex: "num",
+      },
+      {
+        title: "名称",
+        dataIndex: "name",
+      },
+      {
+        title: "时代",
+        render: (item: A2tableType) => item.dictAge || "(空)",
+      },
+      {
+        title: "质地",
+        render: (item: A2tableType) => item.dictTexture || "(空)",
+      },
+      {
+        title: "级别",
+        render: (item: A2tableType) => item.dictLevel || "(空)",
+      },
+      {
+        title: "藏品状态",
+        render: (item: A2tableType) =>
+          Reflect.get(statusTxtObj, item.status) || "(空)",
+      },
+      {
+        title: "库存状态",
+        render: (item: A2tableType) =>
+          Reflect.get(storageStatusTxtObj, item.storageStatus) || "(空)",
+      },
+      {
+        title: "登记时间",
+        dataIndex: "createTime",
+      },
+      {
+        title: "操作",
+        render: (item: A2tableType) => (
+          <Button size="small" type="text" onClick={() => setLookId(item.id)}>
+            查看
+          </Button>
+        ),
+      },
+    ];
+  }, []);
+
+  // 点击表格的查看
+  const [lookId, setLookId] = useState(0);
+
   return (
     <div className={styles.A2Goods}>
       <div className="pageTitle">藏品清单</div>
@@ -133,7 +216,7 @@ function A2Goods() {
       </div>
       {/* 表格主体 */}
       <div className="tableMain">
-        {/* <Table
+        <Table
           scroll={{ y: 625 }}
           dataSource={A2TableList.list}
           columns={columns}
@@ -147,7 +230,7 @@ function A2Goods() {
             total: A2TableList.total,
             onChange: paginationChange(),
           }}
-        /> */}
+        />
       </div>
 
       {/* 申请登记出来的页面 */}
@@ -158,6 +241,9 @@ function A2Goods() {
           upInfoFu={() => {}}
         />
       ) : null}
+
+      {/* 点击表格的查看 */}
+      {lookId ? <B1Look goodsId={lookId} closeFu={() => setLookId(0)} /> : null}
     </div>
   );
 }

+ 24 - 0
src/pages/B1Submit/B1Info/data.ts

@@ -0,0 +1,24 @@
+export const B1EditKeyObj = {
+  name: "名称",
+  num: "编号",
+  dictAge: "时代",
+  dictTexture: "质地",
+  size: "尺寸",
+  quality: "重量",
+  pcs: "实际数量",
+  source: "来源",
+  complete: "完残程度",
+  dictLevel: "级别",
+  A2RArowLabel: "定级时间",
+  description: "简介",
+  thumb: "封面图",
+  fileNames: "附件信息",
+};
+
+export type B1EditTable={
+  id:string
+  txt:string,
+  oldValue:string
+  newValue:string
+  type:'img'|''
+}

+ 39 - 6
src/pages/B1Submit/B1Info/index.module.scss

@@ -22,7 +22,7 @@
       border-radius: 10px;
       position: relative;
 
-      .B1Ititle{
+      .B1Ititle {
         position: absolute;
         top: 20px;
         left: 20px;
@@ -44,7 +44,8 @@
             &:nth-of-type(1) {
               font-weight: 700;
             }
-            .ant-tag{
+
+            .ant-tag {
               position: relative;
               top: -2px;
             }
@@ -76,24 +77,56 @@
         }
       }
 
+      // 审批按钮
+      .B1IbtnArr {
+        .B1IbtnArrAudit {
+          display: flex;
+
+          &>div {
+            &:nth-of-type(2) {
+              width: calc(100% - 400px);
+
+              textarea {
+                min-height: 60px !important;
+              }
+            }
+          }
+        }
+      }
+
     }
 
     // 表格
 
     .B1Itable {
       margin-top: 15px;
-      height: calc(100% - 273px);
+      height: calc(100% - 277px);
       background-color: #fff;
       border-radius: 10px;
+      display: flex;
+
+      // .B1ItableLeft {
+      //   width: 90px;
+      //   text-align: center;
+      //   height: 32px;
+      //   line-height: 32px;
+      //   font-weight: 700;
+      // }
+
+      // .ant-table-wrapper {
+      //   width: calc(100% - 90px);
+      // }
 
       .ant-table-body {
         height: 438px;
         overflow-y: auto !important;
         overflow-y: overlay !important;
+      }
+    }
 
-        .ant-table-cell {
-          padding: 4px 6px !important;
-        }
+    .B1ItableNoEdit {
+      .ant-table-cell {
+        padding: 4px 6px !important;
       }
     }
 

+ 300 - 101
src/pages/B1Submit/B1Info/index.tsx

@@ -1,8 +1,14 @@
-import React, { useCallback, useEffect, useMemo, useState } from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
 import { B1tableType } from "@/types";
 import { B1StatusObj, B1TieleObj, antdTagColorFObj } from "../data";
-import { Button, Popconfirm, Table, Tag } from "antd";
+import { Button, Popconfirm, Radio, Table, Tag } from "antd";
 import {
   A2addInfoType,
   A2inTableType,
@@ -10,11 +16,15 @@ import {
   storageStatusTxtObj,
 } from "@/pages/A2Goods/data";
 import ImageLazy from "@/components/ImageLazy";
-import { A2_APIgetInfo } from "@/store/action/B1Submit";
+import { A2_APIdelOrder, A2_APIgetInfo } from "@/store/action/B1Submit";
 import B1Look from "../B1Look";
 import A2Register from "@/pages/A2Goods/A2Register";
 import { A2_APIaudit } from "@/store/action/A2Goods";
 import { MessageFu } from "@/utils/message";
+import TextArea from "antd/es/input/TextArea";
+import { B1EditKeyObj, B1EditTable } from "./data";
+import classNames from "classnames";
+import A2AddModal from "@/pages/A2Goods/A2Register/A2AddModal";
 
 type Props = {
   closeFu: () => void;
@@ -26,11 +36,66 @@ type Props = {
 function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
   const [info, setInfo] = useState({} as B1tableType);
 
+  // 藏品编辑的id存储
+  const oldToNewId = useRef(0);
+
   const getInfoFu = useCallback(
     async (id: number, flag?: boolean) => {
       const res = await A2_APIgetInfo(id);
       if (res.code === 0) {
-        setTableList(res.data.child);
+        if (res.data.entity.type === "BJ") {
+          // 藏品编辑的信息,特殊处理
+          let oldTxt = "{}";
+          let newTxt = "{}";
+          if (res.data.edit) {
+            if (res.data.edit.beforeGoods) oldTxt = res.data.edit.beforeGoods;
+            if (res.data.edit.afterGoods) newTxt = res.data.edit.afterGoods;
+          }
+
+          const oldObj = JSON.parse(oldTxt);
+          const newObj = JSON.parse(newTxt);
+
+          // 把 这个 单个藏品的id 存起来 用于 审批失败的 编辑按钮
+          oldToNewId.current = oldObj.id;
+
+          const tempArr = [] as B1EditTable[];
+
+          for (const k in newObj) {
+            if (k !== "id") {
+              const txt = Reflect.get(B1EditKeyObj, k);
+              let oldValue = Reflect.get(oldObj, k);
+              let newValue = Reflect.get(newObj, k);
+
+              if (k === "size") {
+                // 尺寸信息的处理
+                const arr1 = oldValue
+                  .split(",")
+                  .map((v: string) => v.replace(" ", ""));
+                oldValue = `长:${arr1[0] || "-"} 宽:${arr1[1] || "-"} 高:${
+                  arr1[2] || "-"
+                } `;
+                const arr2 = newValue
+                  .split(",")
+                  .map((v: string) => v.replace(" ", ""));
+                newValue = `长:${arr2[0] || "-"} 宽:${arr2[1] || "-"} 高:${
+                  arr2[2] || "-"
+                } `;
+              }
+
+              tempArr.push({
+                id: newObj.id + txt,
+                txt,
+                oldValue: oldValue || "(空)",
+                newValue: newValue || "(空)",
+                type: txt === "封面图" ? "img" : "",
+              } as B1EditTable);
+            }
+          }
+          setTableListByEdit(tempArr);
+        } else {
+          // 除了藏品编辑之外的表格数据
+          setTableList(res.data.child);
+        }
         setInfo(res.data.entity);
         // 通知 列表 页面 更新
         if (flag) upTableFu();
@@ -46,31 +111,44 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
   // 点击编辑
   const [outInfo, setOutInfo] = useState<A2addInfoType>({ id: 0, txt: "" });
   const editFu = useCallback(() => {
-    setOutInfo({ id: info.id, txt: "编辑" });
-  }, [info.id]);
-
-  // 点击删除
-  const delFu = useCallback(() => {}, []);
-
-  // 点击撤回
-  const annulFu = useCallback(async () => {
-    const res = await A2_APIaudit({
-      auditDesc: info.auditDesc,
-      id: info.id,
-      status: 0,
+    setOutInfo({
+      id: info.type === "BJ" ? oldToNewId.current : info.id,
+      txt: "编辑",
     });
+  }, [info.id, info.type]);
 
+  // 点击删除
+  const delFu = useCallback(async () => {
+    const res = await A2_APIdelOrder(lookId);
     if (res.code === 0) {
-      MessageFu.success("操作成功!");
+      MessageFu.success("删除成功!");
       upTableFu();
       closeFu();
     }
-  }, [closeFu, info.auditDesc, info.id, upTableFu]);
+  }, [closeFu, lookId, upTableFu]);
+
+  // 点击撤回(我审核的:审批)
+  const annulFu = useCallback(
+    async (status: number, auditDesc: string) => {
+      const res = await A2_APIaudit({
+        auditDesc,
+        id: info.id,
+        status,
+      });
+
+      if (res.code === 0) {
+        MessageFu.success("操作成功!");
+        upTableFu();
+        closeFu();
+      }
+    },
+    [closeFu, info.id, upTableFu]
+  );
 
   // 表格里面的查看信息
   const [goodsId, setGoodsId] = useState(0);
 
-  // 能够出现的 按钮
+  // 能够出现的 按钮(我提交的)
   const btnArr = useMemo(() => {
     const btn1 = (
       <Button type="primary" onClick={editFu}>
@@ -87,7 +165,9 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
         <Button danger>删除</Button>
       </Popconfirm>
     );
-    const btn3 = <Button onClick={annulFu}>撤回</Button>;
+    const btn3 = (
+      <Button onClick={() => annulFu(0, info.auditDesc)}>撤回</Button>
+    );
 
     let res: React.ReactNode = "";
 
@@ -98,7 +178,7 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
           {btn2}
         </>
       ))
-    ) : info.status === 1 ? (
+    ) : info.status === 1 && info.type !== "BJ" ? (
       (res = btn3)
     ) : info.status === 2 ? (
       (res = btn1)
@@ -106,59 +186,97 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
       <></>
     );
     return res;
-  }, [annulFu, delFu, editFu, info.status]);
+  }, [annulFu, delFu, editFu, info.auditDesc, info.status, info.type]);
+
+  // 表格信息(藏品编辑)
+  const [tableListByEdit, setTableListByEdit] = useState<B1EditTable[]>([]);
 
-  //  表格信息
+  //  表格信息(除了藏品编辑之外)
   const [tableList, setTableList] = useState<A2inTableType[]>([]);
 
   const columns = useMemo(() => {
-    return [
-      {
-        title: "缩略图",
-        render: (item: A2inTableType) => (
-          <div className="tableImgAuto">
-            <ImageLazy width={60} height={60} src={item.thumb} />
-          </div>
-        ),
-      },
-      {
-        title: "编号",
-        dataIndex: "num",
-      },
-      {
-        title: "名称",
-        dataIndex: "name",
-      },
-      {
-        title: "级别",
-        dataIndex: "dictLevel",
-      },
-      {
-        title: "藏品状态",
-        render: (item: A2inTableType) =>
-          Reflect.get(statusTxtObj, item.status) || "-",
-      },
-      {
-        title: "库存状态",
-        render: (item: A2inTableType) =>
-          Reflect.get(storageStatusTxtObj, item.storageStatus) || "-",
-      },
-      {
-        title: "备注",
-        render: (item: A2inTableType) => (
-          <>
-            <Button
-              size="small"
-              type="text"
-              onClick={() => setGoodsId(item.id)}
-            >
-              查看
-            </Button>
-          </>
-        ),
-      },
-    ];
-  }, []);
+    if (info.type === "BJ")
+      return [
+        {
+          title: "编辑内容",
+          dataIndex: "txt",
+        },
+        {
+          title: "编辑前",
+          render: (item: B1EditTable) =>
+            item.type === "img" ? (
+              <div className="tableImgAuto">
+                <ImageLazy width={60} height={60} src={item.oldValue} />
+              </div>
+            ) : (
+              item.oldValue
+            ),
+        },
+        {
+          title: "编辑后",
+          render: (item: B1EditTable) =>
+            item.type === "img" ? (
+              <div className="tableImgAuto">
+                <ImageLazy width={60} height={60} src={item.newValue} />
+              </div>
+            ) : (
+              item.newValue
+            ),
+        },
+      ];
+    else {
+      return [
+        {
+          title: "缩略图",
+          render: (item: A2inTableType) => (
+            <div className="tableImgAuto">
+              <ImageLazy width={60} height={60} src={item.thumb} />
+            </div>
+          ),
+        },
+        {
+          title: "编号",
+          dataIndex: "num",
+        },
+        {
+          title: "名称",
+          dataIndex: "name",
+        },
+        {
+          title: "级别",
+          dataIndex: "dictLevel",
+        },
+        {
+          title: "藏品状态",
+          render: (item: A2inTableType) =>
+            Reflect.get(statusTxtObj, item.status) || "-",
+        },
+        {
+          title: "库存状态",
+          render: (item: A2inTableType) =>
+            Reflect.get(storageStatusTxtObj, item.storageStatus) || "-",
+        },
+        {
+          title: "操作",
+          render: (item: A2inTableType) => (
+            <>
+              <Button
+                size="small"
+                type="text"
+                onClick={() => setGoodsId(item.id)}
+              >
+                查看
+              </Button>
+            </>
+          ),
+        },
+      ];
+    }
+  }, [info.type]);
+
+  // 我审核的 待审核的 输入框
+  const [auditDesc, setAuditDesc] = useState("");
+  const [auditStatus, setAuditStatus] = useState(0);
 
   return (
     <div className={styles.B1Info}>
@@ -199,51 +317,132 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
             <div className="mySorrl">{info.description || "(空)"}</div>
           </div>
         </div>
-        <div className="B1IBox">
-          <div className="B1IRow">
-            <div>审批人:</div>
-            <div>{info.auditUser || "(空)"}</div>
-          </div>
-          <div className="B1IRow">
-            <div>审批时间:</div>
-            <div>{info.auditTime || "(空)"}</div>
+
+        {!info.auditUser && !info.auditTime ? null : (
+          <div className="B1IBox">
+            <div className="B1IRow">
+              <div>审批人:</div>
+              <div>{info.auditUser || "(空)"}</div>
+            </div>
+            <div className="B1IRow">
+              <div>审批时间:</div>
+              <div>{info.auditTime || "(空)"}</div>
+            </div>
           </div>
-        </div>
+        )}
 
-        <div className="B1IBox B1IBox2">
-          <div className="B1IRow">
-            <div>审批备注:</div>
-            <div className="mySorrl">{info.auditDesc || "(空)"}</div>
+        {!info.auditUser && !info.auditTime && !info.auditDesc ? null : (
+          <div className="B1IBox B1IBox2">
+            <div className="B1IRow">
+              <div>审批备注:</div>
+              <div className="mySorrl">{info.auditDesc || "(空)"}</div>
+            </div>
           </div>
-        </div>
+        )}
 
-        {/* 操作按钮 */}
-        <div className="B1IbtnArr">{btnArr}</div>
+        {/* 操作按钮*/}
+        <div className="B1IbtnArr">
+          {pageKey === "我提交的" ? (
+            btnArr
+          ) : info.status === 1 ? (
+            // 我审核的 (待审核的操作)
+            <div className="B1IbtnArrAudit">
+              <div>
+                <Button
+                  disabled={!auditStatus}
+                  type="primary"
+                  onClick={() => annulFu(auditStatus, auditDesc)}
+                >
+                  完成审批
+                </Button>
+                &emsp;
+                <Radio
+                  onChange={(e) => setAuditStatus(e.target.value)}
+                  value={3}
+                  checked={auditStatus === 3}
+                >
+                  审批通过
+                </Radio>
+                &emsp;
+                <Radio
+                  onChange={(e) => setAuditStatus(e.target.value)}
+                  value={2}
+                  checked={auditStatus === 2}
+                >
+                  审批驳回
+                </Radio>
+              </div>
+              <div>
+                <TextArea
+                  value={auditDesc}
+                  onChange={(e) => setAuditDesc(e.target.value)}
+                  maxLength={100}
+                  showCount
+                  placeholder="请输入备注"
+                />
+              </div>
+            </div>
+          ) : null}
+        </div>
       </div>
 
       {/* 下面的表格 */}
-      <div className="B1Itable">
-        <Table
-          size="small"
-          scroll={{ y: 438 }}
-          dataSource={tableList}
-          columns={columns}
-          rowKey="id"
-          pagination={false}
-        />
+      <div
+        className={classNames(
+          "B1Itable",
+          info.type !== "BJ" ? "B1ItableNoEdit" : ""
+        )}
+      >
+        {/* <div className="B1ItableLeft">
+          {info.type === "BJ" ? "编辑信息" : "藏品清单"}:
+        </div> */}
+
+        {/* 藏品编辑表格 */}
+        {info.type === "BJ" ? (
+          <Table
+            size="small"
+            scroll={{ y: 438 }}
+            dataSource={tableListByEdit}
+            columns={columns}
+            rowKey="id"
+            pagination={false}
+          />
+        ) : (
+          // 其他表格
+          <Table
+            size="small"
+            scroll={{ y: 438 }}
+            dataSource={tableList}
+            columns={columns}
+            rowKey="id"
+            pagination={false}
+          />
+        )}
       </div>
       {/* 点击表格里面的查看出来的页面 */}
       {goodsId ? (
-        <B1Look goodsId={goodsId} closeFu={() => setGoodsId(0)} />
+        <B1Look
+          goodsId={goodsId}
+          closeFu={() => setGoodsId(0)}
+        />
       ) : null}
 
       {/* 点击编辑按钮出来的页面 */}
       {outInfo.id ? (
-        <A2Register
-          closeFu={() => setOutInfo({ id: 0, txt: "" })}
-          outInfo={outInfo}
-          upInfoFu={() => getInfoFu(info.id, true)}
-        />
+        info.type === "BJ" ? (
+          <A2AddModal
+            addInfo={{ id: outInfo.id, txt: "编辑" }}
+            upTableFu={() => {}}
+            closeFu={() => setOutInfo({ id: 0, txt: "" })}
+            idOldToNew={true}
+          />
+        ) : (
+          <A2Register
+            closeFu={() => setOutInfo({ id: 0, txt: "" })}
+            outInfo={outInfo}
+            upInfoFu={() => getInfoFu(info.id, true)}
+          />
+        )
       ) : null}
     </div>
   );

+ 90 - 7
src/pages/B1Submit/B1Look/index.tsx

@@ -15,6 +15,8 @@ import { useSelector } from "react-redux";
 import { RootState } from "@/store";
 import filesLookFu from "@/utils/filesLook";
 import { baseURL } from "@/utils/http";
+import { B1LbtnKey } from "../data";
+import A2AddModal from "@/pages/A2Goods/A2Register/A2AddModal";
 
 type Props = {
   goodsId: number;
@@ -95,6 +97,72 @@ function B1Look({ closeFu, goodsId }: Props) {
     ];
   }, [isFileDonw]);
 
+  // 操作的按钮
+  const [btnKey, setBtnKey] = useState<B1LbtnKey>({ id: 0, txt: "" });
+  const btnClickFu = useCallback(
+    (key: "编辑" | "入库" | "移库" | "出库" | "注销") => {
+      setBtnKey({ id: goodsId, txt: key });
+    },
+    [goodsId]
+  );
+
+  // 操作按钮出现的逻辑
+  const btnArr = useMemo(() => {
+    const btn1 = (
+      <div>
+        <Button onClick={() => btnClickFu("编辑")}>编辑</Button>
+      </div>
+    );
+    const btn2 = (
+      <div>
+        <Button onClick={() => btnClickFu("入库")}>入库</Button>
+      </div>
+    );
+    const btn3 = (
+      <div>
+        <Button onClick={() => btnClickFu("移库")}>移库</Button>
+      </div>
+    );
+    const btn4 = (
+      <div>
+        <Button onClick={() => btnClickFu("出库")}>出库</Button>
+      </div>
+    );
+    const btn5 = (
+      <div>
+        <Button onClick={() => btnClickFu("注销")}>注销</Button>
+      </div>
+    );
+    let res: React.ReactNode = "";
+
+    // 编辑按钮 出现的逻辑
+    const flag1 = !info.storageStatus || info.storageStatus === 2;
+
+    // 入库按钮
+    const flag2 = !info.storageStatus;
+
+    // 移库
+    const flag3 = info.storageStatus === 2;
+
+    // 出库
+    const flag4 = info.storageStatus === 2;
+
+    // 注销按钮 出现的逻辑
+    const flag5 = !info.storageStatus;
+
+    res = (
+      <>
+        {flag1 ? btn1 : null}
+        {flag2 ? btn2 : null}
+        {flag3 ? btn3 : null}
+        {flag4 ? btn4 : null}
+        {flag5 ? btn5 : null}
+      </>
+    );
+
+    return <div className="B1LbtnArr">{res}</div>;
+  }, [btnClickFu, info.storageStatus]);
+
   return (
     <div className={styles.B1Look}>
       <div className="B1Ltop">
@@ -117,13 +185,18 @@ function B1Look({ closeFu, goodsId }: Props) {
             <div>
               {/* 待完善 */}
               <Button type="primary">藏品日志</Button>&emsp;
-              <Popover placement="bottom" content={"666"}>
-                <Button type="primary">
-                  操作
-                  <CaretDownOutlined rev={undefined} />
-                </Button>
-              </Popover>
-              &emsp;
+              {/* 只有已登记的时候才有操作按钮 */}
+              {info.status === 2 ? (
+                <>
+                  <Popover placement="bottom" content={btnArr}>
+                    <Button type="primary">
+                      操作
+                      <CaretDownOutlined rev={undefined} />
+                    </Button>
+                  </Popover>
+                  &emsp;
+                </>
+              ) : null}
               <Button onClick={closeFu}>返回</Button>
             </div>
           </div>
@@ -203,6 +276,16 @@ function B1Look({ closeFu, goodsId }: Props) {
           />
         </div>
       </div>
+
+      {/* 点击编辑出现的弹窗 */}
+      {btnKey.txt === "编辑" ? (
+        <A2AddModal
+          addInfo={{ id: btnKey.id, txt: "编辑" }}
+          upTableFu={() => {}}
+          closeFu={() => setBtnKey({ id: 0, txt: "" })}
+          idOldToNew={true}
+        />
+      ) : null}
     </div>
   );
 }

+ 8 - 1
src/pages/B1Submit/data.ts

@@ -91,4 +91,11 @@ export const antdTagColorFObj={
   2:'magenta',
   1:'',
   0:''
-}
+}
+
+
+export type B1LbtnKey={
+  id:number
+  txt:'编辑'|'入库'|'移库'|'出库'|'注销'|''
+}
+

+ 28 - 1
src/pages/B2Audit/index.module.scss

@@ -1,5 +1,32 @@
 .B2Audit{
   :global{
-    
+    .B2top {
+      display: flex;
+      justify-content: space-between;
+      border-radius: 10px;
+      background-color: #fff;
+      padding: 15px 24px;
+
+      &>div {
+        display: flex;
+
+        .B2topRow {
+          margin-right: 20px;
+        }
+      }
+    }
+    .tableMain {
+      border-radius: 10px;
+      margin-top: 15px;
+      height: calc(100% - 75px);
+      background-color: #fff;
+
+      .ant-table-body {
+        height: 625px;
+        overflow-y: auto !important;
+        overflow-y: overlay !important;
+
+      }
+    }
   }
 }

+ 211 - 5
src/pages/B2Audit/index.tsx

@@ -1,12 +1,218 @@
-import React from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
- function B2Audit() {
-  
+import { Button, Input, Select, Table, Tooltip } from "antd";
+import { useDispatch, useSelector } from "react-redux";
+import {
+  B1StatusObj,
+  B1TypeObj,
+  B1options1,
+  B1options2,
+  B1selectType,
+} from "../B1Submit/data";
+import { B2_APIgetList } from "@/store/action/B2Audit";
+import { RootState } from "@/store";
+import { B1tableType } from "@/types";
+import { QuestionCircleOutlined } from "@ant-design/icons";
+import B1Info from "../B1Submit/B1Info";
+
+function B2Audit() {
+  const dispatch = useDispatch();
+
+  // 筛选和分页
+  const [tableSelect, setTableSelect] = useState<B1selectType>({
+    searchKey: "",
+    status: "",
+    type: "",
+    pageSize: 10,
+    pageNum: 1,
+  });
+
+  // 发送接口的函数
+  const getListFu = useCallback(() => {
+    dispatch(B2_APIgetList(tableSelect));
+  }, [dispatch, tableSelect]);
+
+  useEffect(() => {
+    getListFu();
+  }, [getListFu]);
+
+  // 输入框的改变
+  const txtTimeRef = useRef(-1);
+  const txtChangeFu = useCallback(
+    (txt: string, key: "searchKey") => {
+      clearTimeout(txtTimeRef.current);
+      txtTimeRef.current = window.setTimeout(() => {
+        setTableSelect({ ...tableSelect, [key]: txt, pageNum: 1 });
+      }, 500);
+    },
+    [tableSelect]
+  );
+
+  // 点击重置
+  const [inputKey, setInputKey] = useState(1);
+  const resetSelectFu = useCallback(() => {
+    // 把2个输入框和时间选择器清空
+    setInputKey(Date.now());
+    setTableSelect({
+      searchKey: "",
+      status: "",
+      type: "",
+      pageSize: 10,
+      pageNum: 1,
+    });
+  }, []);
+
+  // 仓库表格数据
+  const B2TableList = useSelector(
+    (state: RootState) => state.B2Audit.tableInfo
+  );
+
+  // 页码变化
+  const paginationChange = useCallback(
+    () => (pageNum: number, pageSize: number) => {
+      setTableSelect({ ...tableSelect, pageNum, pageSize });
+    },
+    [tableSelect]
+  );
+
+  const columns = useMemo(() => {
+    return [
+      {
+        title: "申请类型",
+        render: (item: B1tableType) => Reflect.get(B1TypeObj, item.type),
+      },
+      {
+        title: "申请编号",
+        dataIndex: "num",
+      },
+      {
+        title: "发起时间",
+        dataIndex: "createTime",
+      },
+      {
+        title: "发起人员",
+        dataIndex: "creatorName",
+      },
+      {
+        title: "审批状态",
+        render: (item: B1tableType) => (
+          <>
+            {Reflect.get(B1StatusObj, item.status)}
+            <span className="globalTit" hidden={!item.auditDesc}>
+              <Tooltip title={item.auditDesc}>
+                &nbsp;
+                <QuestionCircleOutlined rev={undefined} />
+              </Tooltip>
+            </span>
+          </>
+        ),
+      },
+      {
+        title: "审批时间",
+        render: (item: B1tableType) => item.auditTime || "(空)",
+      },
+      {
+        title: "审批人员",
+        render: (item: B1tableType) => item.auditUser || "(空)",
+      },
+      {
+        title: "操作",
+        render: (item: B1tableType) => (
+          <Button size="small" type="text" onClick={() => setLookId(item.id)}>
+            查看
+          </Button>
+        ),
+      },
+    ];
+  }, []);
+
+  // 点击查看打开的页面
+  const [lookId, setLookId] = useState(0);
+
   return (
     <div className={styles.B2Audit}>
-     <div className="pageTitle">我审核的</div>
+      <div className="pageTitle">我审核的</div>
+      {/* 顶部筛选 */}
+      <div className="B2top">
+        {/* 左侧输入框 */}
+        <div className="B2top1">
+          <div className="B2topRow">
+            <span>搜索项:</span>
+            <Input
+              key={inputKey}
+              maxLength={10}
+              style={{ width: 248 }}
+              placeholder="请输入申请编号,最多10字"
+              allowClear
+              onChange={(e) => txtChangeFu(e.target.value, "searchKey")}
+            />
+          </div>
+
+          <div className="B2topRow">
+            <span>申请类型:</span>
+            <Select
+              style={{ width: 150 }}
+              value={tableSelect.type}
+              onChange={(e) =>
+                setTableSelect({ ...tableSelect, type: e, pageNum: 1 })
+              }
+              options={B1options2}
+            />
+          </div>
+
+          <div className="B2topRow">
+            <span>审批状态:</span>
+            <Select
+              style={{ width: 150 }}
+              value={tableSelect.status}
+              onChange={(e) =>
+                setTableSelect({ ...tableSelect, status: e, pageNum: 1 })
+              }
+              options={B1options1.filter((v) => v.label !== "待提交")}
+            />
+          </div>
+        </div>
+        {/* 右侧按钮 */}
+        <div className="B2top2">
+          <Button onClick={resetSelectFu}>重置</Button>
+        </div>
+      </div>
+
+      {/* 表格主体 */}
+      <div className="tableMain">
+        <Table
+          scroll={{ y: 625 }}
+          dataSource={B2TableList.list}
+          columns={columns}
+          rowKey="id"
+          pagination={{
+            showQuickJumper: true,
+            position: ["bottomCenter"],
+            showSizeChanger: true,
+            current: tableSelect.pageNum,
+            pageSize: tableSelect.pageSize,
+            total: B2TableList.total,
+            onChange: paginationChange(),
+          }}
+        />
+      </div>
+
+      {lookId ? (
+        <B1Info
+          pageKey="我审核的"
+          closeFu={() => setLookId(0)}
+          lookId={lookId}
+          upTableFu={getListFu}
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoB2Audit = React.memo(B2Audit);

+ 15 - 13
src/pages/C1User/C1Power.tsx

@@ -9,10 +9,10 @@ import { MessageFu } from "@/utils/message";
 type Props = {
   closeFu: () => void;
   userId: number;
-  upTableFu:()=>void
+  upTableFu: () => void;
 };
 
-function C1Power({ closeFu, userId,upTableFu }: Props) {
+function C1Power({ closeFu, userId, upTableFu }: Props) {
   const getInfoFu = useCallback(async (id: number) => {
     const res = await C1_APIgetUserProwerById(id);
     if (res.code === 0) {
@@ -62,7 +62,10 @@ function C1Power({ closeFu, userId,upTableFu }: Props) {
 
   // 判断是否 选中了 一个功能权限
   const chenckOne1 = useMemo(() => {
-    const tempArr = [101, 102, 201, 202, 203, 204];
+    // const tempArr = [101, 102, 201, 202, 203, 204];
+    // 我审核的 102 这个项目暂时去掉
+    const tempArr = [101, 201, 202, 203, 204];
+
     return !resList.some((v) => tempArr.includes(v));
   }, [resList]);
 
@@ -76,17 +79,16 @@ function C1Power({ closeFu, userId,upTableFu }: Props) {
   const btnOkFu = useCallback(async () => {
     setIsOk(true);
     if (chenckOne1 || chenckOne2) return;
-    const res =await C1_APIuserAuth({
-      resources:resList,
-      userId
-    })
-
-    if(res.code===0){
-      MessageFu.success('授权成功!')
-      upTableFu()
-      closeFu()
-    }
+    const res = await C1_APIuserAuth({
+      resources: resList,
+      userId,
+    });
 
+    if (res.code === 0) {
+      MessageFu.success("授权成功!");
+      upTableFu();
+      closeFu();
+    }
   }, [chenckOne1, chenckOne2, closeFu, resList, upTableFu, userId]);
 
   return (

+ 2 - 0
src/pages/Layout/index.tsx

@@ -43,6 +43,8 @@ function Layout() {
             if (getTokenInfo().user && getTokenInfo().user.isAdmin === 1) {
               tempArr.push(3.1);
               tempArr.push(3.2);
+              // 这个项目 管理员 手动添加 我审核的
+              tempArr.push(102)
             }
 
             // 附件是否允许下载

+ 10 - 2
src/store/action/A2Goods.ts

@@ -2,7 +2,7 @@ import http from "@/utils/http";
 import { AppDispatch } from "..";
 
 /**
- * 获取日志表格列表
+ * 获取藏品清单列表
  */
 export const A2_APIgetList = (data: any) => {
   return async (dispatch: AppDispatch) => {
@@ -57,4 +57,12 @@ export const A2_APIgetInfoWai = (orderId:number) => {
  */
 export const A2_APIaudit = (data:any) => {
   return http.post('cms/order/audit',data);
-};
+};
+
+/**
+ * 待审核  撤回 =》待提交 (审核 撤回)
+ */
+export const A2_APIoldToNew = (data:any) => {
+  return http.post('cms/order/save/edit',data);
+};
+

+ 7 - 2
src/store/action/B1Submit.ts

@@ -6,7 +6,7 @@ import { AppDispatch } from "..";
  */
 export const B1_APIgetList = (data: any) => {
   return async (dispatch: AppDispatch) => {
-    const res = await http.post("cms/my/audit/pageList", data);
+    const res = await http.post("cms/my/submit/pageList", data);
     if (res.code === 0) {
       const obj = {
         list: res.data.records,
@@ -17,7 +17,6 @@ export const B1_APIgetList = (data: any) => {
   };
 };
 
-
 /**
  * 获取详情
  */
@@ -25,3 +24,9 @@ export const A2_APIgetInfo = (id: number) => {
   return http.get(`cms/my/order/detail/${id}`);
 };
 
+/**
+ * 删除订单
+ */
+export const A2_APIdelOrder = (id: number) => {
+  return http.get(`cms/order/removes/${id}`);
+};

+ 32 - 0
src/store/action/B2Audit.ts

@@ -0,0 +1,32 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ * 获取 我审核的 列表
+ */
+export const B2_APIgetList = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/my/audit/pageList", data);
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total,
+      };
+      dispatch({ type: "B2/getList", payload: obj });
+    }
+  };
+};
+
+// /**
+//  * 获取详情
+//  */
+// export const A2_APIgetInfo = (id: number) => {
+//   return http.get(`cms/my/order/detail/${id}`);
+// };
+
+// /**
+//  * 删除订单
+//  */
+// export const A2_APIdelOrder = (id: number) => {
+//   return http.get(`cms/order/removes/${id}`);
+// };

+ 26 - 0
src/store/reducer/B2Audit.ts

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

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

@@ -5,6 +5,7 @@ import { combineReducers } from "redux";
 import A0Layout from "./layout";
 import A2Goods from "./A2Goods";
 import B1Submit from "./B1Submit";
+import B2Audit from "./B2Audit";
 import C1User from "./C1User";
 import C2Log from "./C2Log";
 
@@ -13,6 +14,7 @@ const rootReducer = combineReducers({
   A0Layout,
   A2Goods,
   B1Submit,
+  B2Audit,
   C1User,
   C2Log,
 });

+ 25 - 1
src/types/api/A2Goods.d.ts

@@ -1 +1,25 @@
-export type A2tableType =any
+export type A2tableType ={
+	complete: string;
+	createTime: string;
+	creatorId: number;
+	creatorName: string;
+	description: string;
+	dictAge: string;
+	dictLevel: string;
+	dictTexture: string;
+	dirCode: string;
+	fileIds: string;
+	id: number;
+	levelTime: string;
+	name: string;
+	num: string;
+	pcs: number;
+	quality: string;
+	size: string;
+	source: string;
+	status: number;
+	storageIds: string;
+	storageStatus: number;
+	thumb: string;
+	updateTime: string;
+}

+ 2 - 2
src/utils/http.ts

@@ -8,7 +8,7 @@ import { domShowFu } from "./domShow";
 export const baseURL =
   // 线下的图片地址需要加上/api/
   process.env.NODE_ENV === "development"
-    ? "http://192.168.20.61:8061/api/"
+    ? "http://192.168.20.61:8061/api"
     : "";
   // process.env.NODE_ENV === "development" ? "https://tower3d.4dkankan.com" : "";
 
@@ -23,7 +23,7 @@ declare module "axios" {
 // 创建 axios 实例
 const http = axios.create({
   // --------线下的地址不用加/api/
-  baseURL: baseURL,
+  baseURL: baseURL+'/',
 
   // --------打包或线上环境接口需要加上api/
   // baseURL: baseURL + "/api/",