shaogen1995 2 anos atrás
pai
commit
648d5ed74d

+ 4 - 2
src/components/AsyncSpinLoding/index.module.scss

@@ -1,12 +1,14 @@
 .AsyncSpinLoding {
-  display: none;
+  opacity: 0;
+  pointer-events: none;
+  transition: all .5s;
   position: fixed;
   z-index: 9999;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
-  background-color: rgba(255, 255, 255, .4);
+  background-color: rgba(0, 0, 0, .6);
   :global{
     .ant-spin-spinning{
       position: absolute;

+ 63 - 81
src/components/LookObjTable/index.tsx

@@ -5,6 +5,7 @@ import "./index.css";
 import classNames from "classnames";
 import { useDispatch, useSelector } from "react-redux";
 import { RootState } from "@/store";
+import { getInfoInAPI } from "@/store/action/object1";
 
 type Props = {
   data: any;
@@ -15,9 +16,29 @@ function LookObjTable({ data, y }: Props) {
   const dispatch = useDispatch();
 
   // 点击表格里面的查看
-  const lookGoods = useCallback((id: number) => {
-    setShow(true);
-  }, []);
+  const lookGoods = useCallback(
+    async (id: number) => {
+      const res = await getInfoInAPI(id);
+      const info = res.data.entity;
+      const fileList = {
+        img: [],
+        video: [],
+        audio: [],
+        model: [],
+        doc: [],
+      } as any;
+      res.data.file.forEach((v: any) => {
+        fileList[v.type].push(v);
+      });
+
+      dispatch({
+        type: "object1/getOneGoodsInfo",
+        payload: { info, fileList },
+      });
+      setShow(true);
+    },
+    [dispatch]
+  );
 
   // 外层表格格式
   const columns = useMemo(() => {
@@ -25,32 +46,32 @@ function LookObjTable({ data, y }: Props) {
       {
         title: "缩略图",
         render: (item: any) => (
-          <ImageLazy width={120} height={70} src={item.img} />
+          <ImageLazy width={120} height={70} src={item.thumb} />
         ),
       },
       {
         title: "藏品编号名称",
-        dataIndex: "num",
+        dataIndex: "dictNum",
       },
       {
         title: "藏品编号",
-        dataIndex: "num",
+        render: (item: any) => (item.num ? item.num : "-"),
       },
       {
         title: "藏品名称",
-        dataIndex: "num",
+        dataIndex: "name",
       },
       {
         title: "类别",
-        dataIndex: "num",
+        dataIndex: "dictGoodType",
       },
       {
         title: "完残程度",
-        dataIndex: "num",
+        dataIndex: "complete",
       },
       {
         title: "年代",
-        dataIndex: "num",
+        dataIndex: "dictAge",
       },
       {
         title: "操作",
@@ -73,7 +94,9 @@ function LookObjTable({ data, y }: Props) {
   const [titSelect, setTitSelect] = useState("tit1");
 
   // 附件类型下拉框
-  const results = useSelector((state: RootState) => state.loginStore.fileData);
+  const { info, fileList } = useSelector(
+    (state: RootState) => state.objectStore.oneGoodsInfo
+  );
 
   const fileSelectList = useMemo(() => {
     return [
@@ -89,44 +112,6 @@ function LookObjTable({ data, y }: Props) {
     setFileSelect(value);
   };
 
-  // 里面的表格数据
-  useEffect(() => {
-    dispatch({
-      type: "login/setFileData",
-      payload: {
-        img: [
-          {
-            id: 1,
-            name: "图片1",
-            time: "2022-12-13",
-            img: "https://ts1.cn.mm.bing.net/th/id/R-C.6d2d3fecd79a96e43d1a410640d7199b?rik=B7RCgF82Vb7P0A&riu=http%3a%2f%2f5b0988e595225.cdn.sohucs.com%2fimages%2f20190831%2f3e03e9c2473c40b180aa99a37c0589fa.jpeg&ehk=JXdgMrjnolHlMkdX9N0K7%2fzBc9wi7FSFDjSGclreQbI%3d&risl=&pid=ImgRaw&r=0",
-          },
-          {
-            id: 2,
-            name: "图片2",
-            time: "2022-12-14",
-            img: "",
-          },
-          {
-            id: 3,
-            name: "图片3",
-            time: "2022-12-14",
-            img: "",
-          },
-        ],
-        video: [
-          {
-            id: 4,
-            name: "视频1",
-            time: "2022-12-14",
-            img: "",
-          },
-        ],
-        audio: [],
-      },
-    });
-  }, [dispatch]);
-
   // 里面表格格式
   const columns2 = useMemo(() => {
     const tempArr = [
@@ -136,14 +121,14 @@ function LookObjTable({ data, y }: Props) {
       },
       {
         title: "上传时间",
-        dataIndex: "time",
+        dataIndex: "createTime",
       },
     ] as any;
     if (fileSelect === "img") {
       tempArr.unshift({
         title: "缩略图",
         render: (item: any) => (
-          <ImageLazy width={120} height={70} src={item.img} />
+          <ImageLazy width={120} height={70} src={item.filePath} />
         ),
       });
     }
@@ -153,7 +138,7 @@ function LookObjTable({ data, y }: Props) {
   return (
     <div>
       <Table
-        size='small'
+        size="small"
         scroll={{ y }}
         dataSource={data}
         columns={columns}
@@ -195,118 +180,115 @@ function LookObjTable({ data, y }: Props) {
           <div className="row">
             <div>
               <span>藏品名称:</span>
-              <p>
-                阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松
-              </p>
+              <p>{info.formRow}</p>
             </div>
             <div>
               <span>原名:</span>
-              <p>666666666</p>
+              <p>{info.namePrimitive}</p>
             </div>
           </div>
           <div className="row">
             <div>
               <span>藏品编号名称:</span>
-              <p>666666666</p>
+              <p>{info.dictNum}</p>
             </div>
             <div>
               <span>藏品编号:</span>
-              <p>
-                阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松阿松大阿松
-              </p>
+              <p>{info.num?info.num:'-'}</p>
             </div>
           </div>
           <div className="row">
             <div>
               <span>年代:</span>
-              <p>666666666</p>
+              <p>{info.dictAge}</p>
             </div>
             <div>
               <span>文物质地:</span>
-              <p>666666666</p>
+              <p>{info.dictTexture}</p>
             </div>
           </div>
           <div className="row">
             <div>
               <span>具体年代:</span>
-              <p>666666666</p>
+              <p>{info.ageSpecific?info.ageSpecific:'-'}</p>
             </div>
             <div>
               <span>文物类别:</span>
-              <p>666666666</p>
+              <p>{info.dictGoodType}</p>
             </div>
           </div>
 
           <div className="row">
             <div>
               <span>实际数量:</span>
-              <p>666666666</p>
+              <p>{info.pcs}</p>
             </div>
             <div>
               <span>文物级别:</span>
-              <p>666666666</p>
+              <p>{info.dictLevel}</p>
             </div>
           </div>
           <div className="rowFull">
             <span>外形尺寸:</span>
-            <p>(通长)66666666&emsp;(通宽)66666666&emsp;(通高)66666666</p>
+            <p>{info.size}</p>
+            {/* <p>(通长)66666666&emsp;(通宽)66666666&emsp;(通高)66666666</p> */}
           </div>
           <div className="rowFull">
             <span>具体尺寸:</span>
-            <p>666666666</p>
+            <p>{info.sizeSpecific}</p>
           </div>
 
           <div className="row">
             <div>
               <span>质量范围:</span>
-              <p>666666666</p>
+              <p>{info.dictQualityScope}</p>
             </div>
             <div>
               <span>具体质量:</span>
-              <p>666666666</p>
+              <p>{info.quality?info.quality:'-'}</p>
             </div>
           </div>
 
           <div className="row">
             <div>
               <span>完残程度:</span>
-              <p>666666666</p>
+              <p>{info.complete}</p>
             </div>
             <div>
               <span>保存状态:</span>
-              <p>666666666</p>
+              <p>{info.repair?info.repair:'-'}</p>
             </div>
           </div>
 
           <div className="row">
             <div>
               <span>入藏时间范围:</span>
-              <p>666666666</p>
+              <p>{info.dictCheckInScope}</p>
             </div>
             <div>
               <span>入藏年度:</span>
-              <p>666666666</p>
+              <p>{info.checkInYear?info.checkInYear:'-'}</p>
             </div>
           </div>
 
           <div className="row">
             <div>
               <span>著者:</span>
-              <p>666666666</p>
+              <p>{info.author?info.author:'-'}</p>
             </div>
             <div>
               <span>版本:</span>
-              <p>666666666</p>
+              <p>{info.vision?info.vision:'-'}</p>
             </div>
           </div>
 
           <div className="rowFull">
             <span>存卷:</span>
-            <p>666666666</p>
+            <p>{info.onFile?info.onFile:'-'}</p>
           </div>
           <div className="rowFull">
             <span>来源说明:</span>
-            <p>454654654564654</p>
+            <p>{info.description?info.description:'-'}</p>
           </div>
         </div>
 
@@ -314,7 +296,7 @@ function LookObjTable({ data, y }: Props) {
           <div className="row">
             <div className="rowTit">藏品图片:</div>
             <div className="rowRr">
-              <ImageLazy width={120} height={120} src={""} />
+              <ImageLazy width={120} height={120} src={info.thumb} />
             </div>
           </div>
 
@@ -332,9 +314,9 @@ function LookObjTable({ data, y }: Props) {
 
           {/* 表格主体 */}
           <Table
-            size='small'
+            size="small"
             scroll={{ y: 300 }}
-            dataSource={results[fileSelect]}
+            dataSource={fileList[fileSelect]}
             columns={columns2}
             rowKey="id"
             pagination={false}

+ 102 - 28
src/components/ObjectAdd/index.tsx

@@ -12,14 +12,25 @@ import {
 } from "antd";
 import { PlusOutlined, CloseCircleOutlined } from "@ant-design/icons";
 import TextArea from "antd/es/input/TextArea";
-import React, { useCallback, useMemo, useRef, useState } from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
 import classNames from "classnames";
 import "./index.css";
 import { useDispatch, useSelector } from "react-redux";
 import { RootState } from "@/store";
 import ImageLazy from "../ImageLazy";
-import { goodsSonAddAPI, object1AddUpFileAPI } from "@/store/action/object1";
+import {
+  delInfileAPI,
+  getInfoInAPI,
+  goodsSonAddAPI,
+  object1AddUpFileAPI,
+} from "@/store/action/object1";
 const { Option } = Select;
 
 type Props = {
@@ -37,7 +48,8 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
     setTitSelect("tit1");
     return message.warning("有表单不符号规则!");
   };
-  // 通过校验之后发送请求
+
+  // --------通过校验之后发送请求----------点击确定
   const onFinish = async (values: any) => {
     const oldObj = {} as any;
     for (const k in values) {
@@ -47,8 +59,8 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
     // 外形尺寸 3个 字段 变成一个组数
     const size = [values.size1, values.size2, values.size3];
     // 具体质量 + 单位
-    let quality = "";
-    if (values.quality) quality = values.quality + danweiValue;
+    let quality = [] as any;
+    if (values.quality) quality = [values.quality, danweiValue];
     // 文件id
     const fileIds = [] as any;
     for (const k in results) {
@@ -63,8 +75,9 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
 
     const obj = {
       ...oldObj,
-      size,
-      quality,
+      id: id ? id : null,
+      size: size.join(","),
+      quality: quality.join(","),
       thumb: cover,
       dirCode: dirCode + "",
       fileIds: fileIds.join(","),
@@ -72,7 +85,12 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
       dictAge,
       dictTexture,
     };
-    await dispatch(goodsSonAddAPI(obj));
+    await dispatch(goodsSonAddAPI(obj, id));
+
+    // 真正的删除
+    if (delFileList.current.length) {
+      await delInfileAPI(delFileList.current.join(","));
+    }
     //  关闭弹窗
     colsePage();
 
@@ -118,26 +136,74 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
   const [danweiValue, setDanweiValue] = useState("kg");
 
   // 设置表单初始数据(区分编辑和新增)
+  const FormBoxRef = useRef<any>({});
+  const getInfoInAPIFu = useCallback(
+    async (id: number) => {
+      const res = await getInfoInAPI(id);
+      const data = res.data.entity;
+      const size = data.size.split(",");
+      const quality = data.quality.split(",");
+      const dictAge = data.dictAge.split(",");
+      const dictTexture = data.dictTexture.split(",");
+      FormBoxRef.current.setFieldsValue({
+        ...data,
+        size1: size[0],
+        size2: size[1],
+        size3: size[2],
+        quality: quality[0],
+        dictAge,
+        dictTexture,
+      });
+      // 具体质量的单位
+      setDanweiValue(quality[1]);
+      // 藏品图片
+      setCover(data.thumb);
+
+      const fileData = {
+        img: [],
+        video: [],
+        audio: [],
+        model: [],
+        doc: [],
+      } as any;
+      res.data.file.forEach((v: any) => {
+        fileData[v.type].push(v);
+      });
+      // 修改附件仓库信息
+      dispatch({ type: "login/setFileData", payload: fileData });
+    },
+    [dispatch]
+  );
 
-  const defaultData = useRef<any>(null);
-  if (id) {
-    defaultData.current = {
-      name: "编辑",
-      dictNum: "索书号",
-      dictAge: ["其他"],
-    };
-  } else {
-    defaultData.current = {
-      dictNum: options1[0].name ? options1[0].name : null,
-      dictAge: ["地质年代", "显生宙", "新生代", "第四纪"],
-      dictTexture: ["单一质地", "有机质", "竹"],
-      dictGoodType: options4[0].name ? options4[0].name : null,
-      dictLevel: options5[0].name ? options5[0].name : null,
-      dictQualityScope: options6[0].name ? options6[0].name : null,
-      complete: options7[0].name ? options7[0].name : null,
-      dictCheckInScope: options9[0].name ? options9[0].name : null,
-    };
-  }
+  // 进页面看看是编辑就 从仓库获取信息,新增就设置默认值
+  useEffect(() => {
+    if (id) {
+      getInfoInAPIFu(id);
+    } else {
+      FormBoxRef.current.setFieldsValue({
+        dictNum: options1[0].name ? options1[0].name : null,
+        dictAge: ["地质年代", "显生宙", "新生代", "第四纪"],
+        dictTexture: ["单一质地", "有机质", "竹"],
+        dictGoodType: options4[0].name ? options4[0].name : null,
+        dictLevel: options5[0].name ? options5[0].name : null,
+        dictQualityScope: options6[0].name ? options6[0].name : null,
+        complete: options7[0].name ? options7[0].name : null,
+        dictCheckInScope: options9[0].name ? options9[0].name : null,
+      });
+      // 清空附件仓库信息
+      dispatch({ type: "login/setFileData", payload: {} });
+    }
+  }, [
+    dispatch,
+    getInfoInAPIFu,
+    id,
+    options1,
+    options4,
+    options5,
+    options6,
+    options7,
+    options9,
+  ]);
 
   // -----------关于藏品附件的信息
   const [fileSelect, setFileSelect] = useState("img");
@@ -163,6 +229,9 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
         [fileSelect]: results[fileSelect].filter((v: any) => v.id !== id),
       };
       dispatch({ type: "login/setFileData", payload: data });
+
+      // 把删除的id存起来
+      delFileList.current.push(id);
     },
     [dispatch, fileSelect, results]
   );
@@ -263,6 +332,8 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
 
   const upFileFlagRef = useRef(false);
 
+  const delFileList = useRef<any>([]);
+
   const upFileFu = (flag?: any) => {
     upFileFlagRef.current = flag ? flag : 0;
     myInput2.current?.click();
@@ -298,6 +369,9 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
               }),
             };
             dispatch({ type: "login/setFileData", payload: data });
+
+            // 把删除的id存起来
+            delFileList.current.push(upFileFlagRef.current);
           } else {
             // 新上传
             const data = {
@@ -349,11 +423,11 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
         </div>
 
         <Form
+          ref={FormBoxRef}
           name="basic"
           onFinish={onFinish}
           onFinishFailed={onFinishFailed}
           autoComplete="off"
-          initialValues={defaultData.current}
         >
           {/* -----------------------表单信息 */}
           <div className="formBox" hidden={titSelect === "tit2"}>

+ 2 - 1
src/components/SpinLoding/index.module.scss

@@ -4,5 +4,6 @@
   display: flex;
   justify-content: center;
   align-items: center;
-  background-color: rgba(255, 255, 255, .4);
+  background-color: transparent;
+  // background-color: rgba(255, 255, 255, .4);
 }

+ 3 - 2
src/pages/ObjectSon/Object1/AddObject1/index.tsx

@@ -130,6 +130,7 @@ function AddObject1() {
           <ImageLazy width={120} height={70} src={item.thumb} />
         ),
       },
+
       {
         title: "藏品编号名称",
         dataIndex: "dictNum",
@@ -181,9 +182,9 @@ function AddObject1() {
   const cancelFu = useCallback(() => {
     history.push({
       pathname: `/object`,
-      state: { k: urlParam.k ? urlParam.k : "1" },
+      state: { k: urlParam.k ? urlParam.k : "1", d: urlParam.d },
     });
-  }, [urlParam.k]);
+  }, [urlParam.d, urlParam.k]);
 
   // 点击提交
   const submitFu = useCallback(

Diferenças do arquivo suprimidas por serem muito extensas
+ 50 - 29
src/pages/ObjectSon/Object1/AuditObject1/index.tsx


Diferenças do arquivo suprimidas por serem muito extensas
+ 49 - 35
src/pages/ObjectSon/Object1/LookObject1/index.tsx


+ 24 - 6
src/pages/ObjectSon/Object1/index.tsx

@@ -33,6 +33,9 @@ export default function Object1() {
     dispatch(getObject1ListNum());
   }, [dispatch]);
 
+  // 顶部的状态改变了,统一管理,传到二级页码
+  const statusRef = useRef<null | number>(null);
+
   const dataTit = useSelector((state: RootState) => state.objectStore.infoNum1);
 
   // 封装发送请求的函数
@@ -49,8 +52,12 @@ export default function Object1() {
   // 如果有参数 根据参数页码在次发送请求
   useEffect(() => {
     const urlParam = location.state || {};
-    if (urlParam.k && urlParam.k !== "1")
-      setTableSelect({ ...tableSelect, pageNum: Number(urlParam.k) });
+    setTableSelect({
+      ...tableSelect,
+      pageNum: Number(urlParam.k) ? Number(urlParam.k) : 1,
+      // eslint-disable-next-line eqeqeq
+      status: urlParam.d&&urlParam.d!='null'? Number(urlParam.d) : null,
+    });
     // eslint-disable-next-line react-hooks/exhaustive-deps
   }, [location]);
 
@@ -70,6 +77,11 @@ export default function Object1() {
     pageNumRef.current = tableSelect.pageNum;
   }, [tableSelect.pageNum]);
 
+  // 顶部状态统一
+  useEffect(() => {
+    statusRef.current = tableSelect.status;
+  }, [tableSelect.status]);
+
   // 防止返回的时候发送了2次请求来对应页码
 
   const getListRef = useRef(-1);
@@ -113,8 +125,14 @@ export default function Object1() {
     // 清空详情页面里面的附件表格信息
     dispatch({ type: "login/setGoodsSonList", payload: [] });
 
-    if (id) history.push(`/object/1/add?k=${pageNumRef.current}&id=${id}`);
-    else history.push(`/object/1/add?k=${pageNumRef.current}`);
+    if (id)
+      history.push(
+        `/object/1/add?k=${pageNumRef.current}&d=${statusRef.current}&id=${id}`
+      );
+    else
+      history.push(
+        `/object/1/add?k=${pageNumRef.current}&d=${statusRef.current}`
+      );
   };
 
   // 点击删除按钮
@@ -172,7 +190,7 @@ export default function Object1() {
               danger
               onClick={() =>
                 history.push(
-                  `/object/1/look?k=${pageNumRef.current}&id=${item.id}`
+                  `/object/1/look?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
                 )
               }
             >
@@ -189,7 +207,7 @@ export default function Object1() {
               <AuthButton
                 onClick={() =>
                   history.push(
-                    `/object/1/audit?k=${pageNumRef.current}&id=${item.id}`
+                    `/object/1/audit?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
                   )
                 }
                 type="text"

+ 38 - 5
src/store/action/object1.ts

@@ -19,20 +19,28 @@ export const object1AddUpFileAPI = (data: any) => {
 /**
  * 里面的一条藏品添加
  */
-export const goodsSonAddAPI = (data: any) => {
+export const goodsSonAddAPI = (data: any, id: any) => {
   return async (dispatch: AppDispatch) => {
     const res: any = await http.post("cms/register/goods/save", data);
 
     if (res.code === 0) {
-      const newData = [res.data, ...store.getState().loginStore.goodsTableList];
+      const oldData = store.getState().loginStore.goodsTableList;
       message.success("操作成功!");
+      let newData;
+      if (id) {
+        // 是编辑 覆盖之前的数据
+        newData = oldData.map((v: any) => {
+          if (v.id === id) return res.data;
+          else return v;
+        });
+      } else newData = [res.data, ...oldData]; // 是新增,在前面添加一条数据
       dispatch({ type: "login/setGoodsSonList", payload: newData });
     }
   };
 };
 
 // 状态的筛选
-const statusObj = {
+export const statusObj = {
   0: "待办理", //草稿中
   1: "待审核", //待审核
   2: "审核不通过", //审核不通过
@@ -90,7 +98,12 @@ export const object1DelAPI = (id: number) => {
 export const object1infoOutAPI = (id: number) => {
   return http.get(`cms/register/detail/${id}`);
 };
-
+/**
+ * 通过id获取表格信息
+ */
+export const getObj1InfoTableAPI2 = (id: number) => {
+  return http.get(`cms/register/goods/list/${id}`);
+};
 /**
  * 通过id获取表格信息
  */
@@ -102,10 +115,30 @@ export const getObj1InfoTableAPI = (id: number) => {
   };
 };
 
-
 /**
  * 删除里面的表格藏品 s
  */
 export const delInTablesAPI = (ids: string) => {
   return http.get(`cms/register/goods/removes/${ids}`);
+};
+
+/**
+ * 删除最里面的附件或者封面图 s
+ */
+export const delInfileAPI = (ids: string) => {
+  return http.get(`cms/register/goods/file/dels/${ids}`);
+};
+
+/**
+ * 通过id获取里面的藏品详情
+ */
+export const getInfoInAPI = (id: number) => {
+  return http.get(`cms/register/goods/detail/${id}`);
+};
+
+/**
+ * 审核藏品信息
+ */
+export const auditObject1API = (data:any) => {
+  return http.post('cms/register/audit',data);
 };

+ 3 - 2
src/store/reducer/login.ts

@@ -38,12 +38,13 @@ export default function loginReducer(
     // 所有的下拉列表数据
     case "login/getSelectAll":
       return { ...state, selectAll: action.payload };
-    // 新增编辑藏品的附件数据
+    // 新增编辑藏品的附件数据(弹窗里面的附件)
     case "login/setFileData":
       return { ...state, fileData: action.payload };
-    // 新增编辑藏品 的外层 表格信息
+    // 新增编辑藏品 的外层 表格信息(新增编辑页面下面的表格)
     case "login/setGoodsSonList":
       return { ...state, goodsTableList: action.payload };
+
     default:
       return state;
   }

+ 26 - 1
src/store/reducer/object.ts

@@ -7,11 +7,29 @@ const initState = {
   },
   // 表格顶部数字数据
   infoNum1: [],
+  // 查看和审核的表格信息
+  lookInfo: {
+    info: {} as any,
+    list: [] as any,
+  },
+  // 点击里面的表格的查看的单个藏品信息
+  oneGoodsInfo: {
+    info: {},
+    fileList: {
+      img: [],
+      video: [],
+      audio: [],
+      model: [],
+      doc: [],
+    },
+  } as any,
 };
 
 type LoginActionType =
   | { type: "object1/getList"; payload: any }
-  | { type: "object1/getListNum"; payload: any };
+  | { type: "object1/getListNum"; payload: any }
+  | { type: "object1/getLookInfo"; payload: any }
+  | { type: "object1/getOneGoodsInfo"; payload: any };
 // 频道 reducer
 export default function objectReducer(
   state = initState,
@@ -24,6 +42,13 @@ export default function objectReducer(
     // 表格顶部数字数据1
     case "object1/getListNum":
       return { ...state, infoNum1: action.payload };
+    // 查看和审核的表格数据
+    case "object1/getLookInfo":
+      return { ...state, lookInfo: action.payload };
+    // 点击里面的表格的查看的单个藏品信息
+    case "object1/getOneGoodsInfo":
+      return { ...state, oneGoodsInfo: action.payload };
+
     default:
       return state;
   }

+ 13 - 4
src/utils/http.ts

@@ -25,7 +25,8 @@ const lodingDom: any = document.querySelector("#AsyncSpinLoding");
 http.interceptors.request.use(
   function (config: any) {
     // 发请求前打开加载提示
-    lodingDom.style.display = "block";
+    lodingDom.style.opacity = 1;
+    lodingDom.style.pointerEvents = "auto";
     axajInd++;
 
     const { token } = getTokenInfo();
@@ -42,7 +43,12 @@ http.interceptors.response.use(
   function (response) {
     // 请求回来的关闭加载提示
     axajInd--;
-    if (axajInd === 0) lodingDom.style.display = "none";
+    if (axajInd === 0) {
+      setTimeout(() => {
+        lodingDom.style.opacity = 0;
+        lodingDom.style.pointerEvents = "none";
+      }, 200);
+    }
 
     if (response.data.code === 5001 || response.data.code === 5002) {
       removeTokenInfo();
@@ -54,10 +60,13 @@ http.interceptors.response.use(
     return response.data;
   },
   async function (err) {
-    lodingDom.style.display = "none";
+    setTimeout(() => {
+      lodingDom.style.opacity = 0;
+      lodingDom.style.pointerEvents = "none";
+    }, 100);
     // 如果因为网络原因,response没有,给提示消息
     if (!err.response) {
-      message.warning("网络繁忙,请稍后重试");
+      message.warning("网络繁忙,请稍后重试!");
     } else {
       message.warning("错误!");
     }