فهرست منبع

增加备注字段

shaogen1995 8 ماه پیش
والد
کامیت
6bbdd6ed52

BIN
src/assets/img/login/LOGO.png


+ 104 - 107
src/components/LookObjTable/LookModal.tsx

@@ -1,158 +1,151 @@
-import React, { useCallback, useEffect, useMemo, useState } from "react";
-import classNames from "classnames";
-import { Button, Modal, Select, Table } from "antd";
-import { useDispatch, useSelector } from "react-redux";
-import { RootState } from "@/store";
-import ImageLazy from "../ImageLazy";
-import { getInfoInAPI } from "@/store/action/object1";
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
+import classNames from 'classnames'
+import { Button, Modal, Select, Table } from 'antd'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import ImageLazy from '../ImageLazy'
+import { getInfoInAPI } from '@/store/action/object1'
 import './index.css'
 
 type Props = {
-  show: boolean;
-  closeShow: any;
-  id: number;
-};
+  show: boolean
+  closeShow: any
+  id: number
+}
 
 function LookModal({ show, closeShow, id }: Props) {
-  const dispatch = useDispatch();
+  const dispatch = useDispatch()
   // 根据id发送请求把数据存到仓库
 
   const getInfoInAPIFu = useCallback(async () => {
-    const res = await getInfoInAPI(id);
-    const info = res.data.entity;
+    const res = await getInfoInAPI(id)
+    const info = res.data.entity
     const fileList = {
       img: [],
       video: [],
       audio: [],
       model: [],
-      doc: [],
-    } as any;
+      doc: []
+    } as any
     res.data.file.forEach((v: any) => {
-      fileList[v.type].push(v);
-    });
+      fileList[v.type].push(v)
+    })
 
     dispatch({
-      type: "object1/getOneGoodsInfo",
-      payload: { info, fileList },
-    });
-  }, [dispatch, id]);
+      type: 'object1/getOneGoodsInfo',
+      payload: { info, fileList }
+    })
+  }, [dispatch, id])
 
   useEffect(() => {
-    getInfoInAPIFu();
-  }, [getInfoInAPIFu]);
+    getInfoInAPIFu()
+  }, [getInfoInAPIFu])
 
   // 选择商品信息还是附近(默认商品信息)
-  const [titSelect, setTitSelect] = useState("tit1");
+  const [titSelect, setTitSelect] = useState('tit1')
 
   // 附件类型下拉框
-  const { info, fileList } = useSelector(
-    (state: RootState) => state.object1Store.oneGoodsInfo
-  );
+  const { info, fileList } = useSelector((state: RootState) => state.object1Store.oneGoodsInfo)
 
   // 外形尺寸和具体质量
-  let sizeRes = "";
+  let sizeRes = ''
   if (info.size && info.size.length) {
-    const sizeArr = info.size.split(",");
-    sizeRes = `(通长)${sizeArr[0]}cm (通宽)${sizeArr[1]}cm (通高)${sizeArr[2]}cm`;
+    const sizeArr = info.size.split(',')
+    sizeRes = `(通长)${sizeArr[0]}cm (通宽)${sizeArr[1]}cm (通高)${sizeArr[2]}cm`
   }
 
-  let qualityRes = "-";
+  let qualityRes = '-'
   if (info.quality && info.quality.length) {
-    const qualityArr = info.quality.split(",");
-    qualityRes = qualityArr[0] + qualityArr[1];
+    const qualityArr = info.quality.split(',')
+    qualityRes = qualityArr[0] + qualityArr[1]
   }
 
   const fileSelectList = useMemo(() => {
     return [
-      { id: 1, value: "img", label: "高清图片" },
-      { id: 2, value: "video", label: "视频文件" },
-      { id: 3, value: "audio", label: "音频文件" },
-      { id: 4, value: "model", label: "三维模型" },
-      { id: 5, value: "doc", label: "文档资料" },
-    ];
-  }, []);
-  const [fileSelect, setFileSelect] = useState("img");
+      { id: 1, value: 'img', label: '高清图片' },
+      { id: 2, value: 'video', label: '视频文件' },
+      { id: 3, value: 'audio', label: '音频文件' },
+      { id: 4, value: 'model', label: '三维模型' },
+      { id: 5, value: 'doc', label: '文档资料' }
+    ]
+  }, [])
+  const [fileSelect, setFileSelect] = useState('img')
   const fileSelectChangeFu = (value: string) => {
-    setFileSelect(value);
-  };
+    setFileSelect(value)
+  }
 
   // 里面表格格式
   const columns2 = useMemo(() => {
     const tempArr = [
       {
-        title: "附件名称",
-        dataIndex: "name",
+        title: '附件名称',
+        dataIndex: 'name'
       },
       {
-        title: "上传时间",
-        dataIndex: "createTime",
-      },
-    ] as any;
-    if (fileSelect === "img") {
+        title: '上传时间',
+        dataIndex: 'createTime'
+      }
+    ] as any
+    if (fileSelect === 'img') {
       tempArr.unshift({
-        title: "缩略图",
-        render: (item: any) => (
-          <ImageLazy width={120} height={70} src={item.filePath} />
-        ),
-      });
+        title: '缩略图',
+        render: (item: any) => <ImageLazy width={120} height={70} src={item.filePath} />
+      })
     }
-    return tempArr;
-  }, [fileSelect]);
+    return tempArr
+  }, [fileSelect])
 
   return (
     <>
       <Modal
-        wrapClassName="lookObjTable"
+        wrapClassName='lookObjTable'
         destroyOnClose
         open={show}
-        title="查看藏品"
+        title='查看藏品'
         onCancel={closeShow}
         footer={
           [] // 设置footer为空,去掉 取消 确定默认按钮
         }
       >
         {/* 商品信息和附件切换 */}
-        <div className="ObjectAddTit">
+        <div className='ObjectAddTit'>
           <div
-            onClick={() => setTitSelect("tit1")}
-            className={classNames(titSelect === "tit1" ? "active" : "")}
+            onClick={() => setTitSelect('tit1')}
+            className={classNames(titSelect === 'tit1' ? 'active' : '')}
           >
             藏品信息
           </div>
           <div
-            onClick={() => setTitSelect("tit2")}
-            className={classNames(
-              "ObjectAddTitTow",
-              titSelect === "tit2" ? "active" : ""
-            )}
+            onClick={() => setTitSelect('tit2')}
+            className={classNames('ObjectAddTitTow', titSelect === 'tit2' ? 'active' : '')}
           >
             附件
           </div>
         </div>
 
         {/* 藏品信息 */}
-        <div className="goodsInfo" hidden={titSelect !== "tit1"}>
-          <div className="row">
+        <div className='goodsInfo' hidden={titSelect !== 'tit1'}>
+          <div className='row'>
             <div>
               <span>藏品名称:</span>
               <p>{info.name}</p>
             </div>
             <div>
               <span>原名:</span>
-              <p>{info.namePrimitive ? info.namePrimitive : "-"}</p>
+              <p>{info.namePrimitive ? info.namePrimitive : '-'}</p>
             </div>
           </div>
-          <div className="row">
+          <div className='row'>
             <div>
               <span>藏品编号名称:</span>
               <p>{info.dictNum}</p>
             </div>
             <div>
               <span>藏品编号:</span>
-              <p>{info.num ? info.num : "-"}</p>
+              <p>{info.num ? info.num : '-'}</p>
             </div>
           </div>
-          <div className="row">
+          <div className='row'>
             <div>
               <span>年代:</span>
               <p>{info.dictAge}</p>
@@ -162,10 +155,10 @@ function LookModal({ show, closeShow, id }: Props) {
               <p>{info.dictTexture}</p>
             </div>
           </div>
-          <div className="row">
+          <div className='row'>
             <div>
               <span>具体年代:</span>
-              <p>{info.ageSpecific ? info.ageSpecific : "-"}</p>
+              <p>{info.ageSpecific ? info.ageSpecific : '-'}</p>
             </div>
             <div>
               <span>文物类别:</span>
@@ -173,7 +166,7 @@ function LookModal({ show, closeShow, id }: Props) {
             </div>
           </div>
 
-          <div className="row">
+          <div className='row'>
             <div>
               <span>实际数量:</span>
               <p>{info.pcs}</p>
@@ -183,16 +176,16 @@ function LookModal({ show, closeShow, id }: Props) {
               <p>{info.dictLevel}</p>
             </div>
           </div>
-          <div className="rowFull">
+          <div className='rowFull'>
             <span>外形尺寸:</span>
             <p dangerouslySetInnerHTML={{ __html: sizeRes }}></p>
           </div>
-          <div className="rowFull">
+          <div className='rowFull'>
             <span>具体尺寸:</span>
             <p>{info.sizeSpecific}</p>
           </div>
 
-          <div className="row">
+          <div className='row'>
             <div>
               <span>质量范围:</span>
               <p>{info.dictQualityScope}</p>
@@ -203,64 +196,68 @@ function LookModal({ show, closeShow, id }: Props) {
             </div>
           </div>
 
-          <div className="row">
+          <div className='row'>
             <div>
               <span>完残程度:</span>
               <p>{info.complete}</p>
             </div>
             <div>
               <span>保存状态:</span>
-              <p>{info.repair ? info.repair : "-"}</p>
+              <p>{info.repair ? info.repair : '-'}</p>
             </div>
           </div>
 
-          <div className="row">
+          <div className='row'>
             <div>
               <span>入藏时间范围:</span>
               <p>{info.dictCheckInScope}</p>
             </div>
             <div>
               <span>入藏年度:</span>
-              <p>{info.checkInYear ? info.checkInYear : "-"}</p>
+              <p>{info.checkInYear ? info.checkInYear : '-'}</p>
             </div>
           </div>
 
-          <div className="row">
+          <div className='row'>
             <div>
               <span>著者:</span>
-              <p>{info.author ? info.author : "-"}</p>
+              <p>{info.author ? info.author : '-'}</p>
             </div>
             <div>
               <span>版本:</span>
-              <p>{info.vision ? info.vision : "-"}</p>
+              <p>{info.vision ? info.vision : '-'}</p>
             </div>
           </div>
 
-          <div className="rowFull">
+          <div className='rowFull'>
             <span>存卷:</span>
-            <p>{info.onFile ? info.onFile : "-"}</p>
+            <p>{info.onFile ? info.onFile : '-'}</p>
           </div>
-          <div className="rowFull">
+          <div className='rowFull'>
             <span>来源说明:</span>
-            <p>{info.description ? info.description : "-"}</p>
+            <p>{info.description ? info.description : '-'}</p>
+          </div>
+          <div className='rowFull'>
+            <span>备注:</span>
+            <p>{info.remark ? info.remark : '-'}</p>
           </div>
-          <div className="rowFull">
+          <div className='rowFull'>
             <span>展示状态:</span>
-            <p>{info.display ? '是' : "否"}</p>
+            <p>{info.display ? '是' : '否'}</p>
           </div>
         </div>
 
-        <div className="goodsFile" hidden={titSelect !== "tit2"}>
-          <div className="row">
-            <div className="rowTit">藏品图片:</div>
-            <div className="rowRr">
+        <div className='goodsFile' hidden={titSelect !== 'tit2'}>
+          <div className='row'>
+            <div className='rowTit'>藏品图片:</div>
+            <div className='rowRr'>
               <ImageLazy width={120} height={120} src={info.thumb} />
             </div>
           </div>
 
-          <div className="row">
-            <div className="rowTit">附件类型:</div>
-            <div className="rowRr">
+          <div className='row'>
+            <div className='rowTit'>附件类型:</div>
+            <div className='rowRr'>
               <Select
                 style={{ width: 150 }}
                 value={fileSelect}
@@ -272,26 +269,26 @@ function LookModal({ show, closeShow, id }: Props) {
 
           {/* 表格主体 */}
           <Table
-            size="small"
+            size='small'
             scroll={{ y: 300 }}
             dataSource={fileList[fileSelect]}
             columns={columns2}
-            rowKey="id"
+            rowKey='id'
             pagination={false}
           />
         </div>
 
         {/* 确定按钮 */}
-        <div className="goodsBtn">
-          <Button type="primary" onClick={closeShow}>
+        <div className='goodsBtn'>
+          <Button type='primary' onClick={closeShow}>
             确定
           </Button>
         </div>
       </Modal>
     </>
-  );
+  )
 }
 
-const MemoLookModal = React.memo(LookModal);
+const MemoLookModal = React.memo(LookModal)
 
-export default MemoLookModal;
+export default MemoLookModal

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 377 - 465
src/components/ObjectAdd/index.tsx


+ 4 - 1
src/pages/ObjectSon/Object2/index.tsx

@@ -210,6 +210,7 @@ export default function Object2() {
       v.vision = v.vision ? v.vision : '-'
       v.onFile = v.onFile ? v.onFile : '-'
       v.description = v.description ? v.description : '-'
+      v.remark = v.remark ? v.remark : '-'
       v.storageAncestorName = v.storageAncestor ? obj3InStorage(v.storageAncestor) : '-'
       v.outLocation = v.outLocation ? v.outLocation : '-'
       v.display = v.display ? '是' : '否'
@@ -243,6 +244,7 @@ export default function Object2() {
             'vision',
             'onFile',
             'description',
+            'remark',
             'storageAncestorName',
             'outLocation',
             'display'
@@ -270,13 +272,14 @@ export default function Object2() {
             '版本',
             '存卷',
             '来源说明',
+            '备注',
             '入库位置',
             '出库位置',
             '展示状态'
           ],
           columnWidths: [
             10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-            10, 10
+            10, 10, 10
           ]
         }
       ]

+ 146 - 180
src/pages/ObjectSon/Object4/AddObject4/index.tsx

@@ -1,317 +1,287 @@
-import BreadTit from "@/components/BreadTit";
-import { object4AddAPI, object4infoOutAPI } from "@/store/action/object4";
-import history, { urlParameter } from "@/utils/history";
-import { Button, Input, Popconfirm, Select, Table } from "antd";
-import TextArea from "antd/es/input/TextArea";
-import React, {
-  useCallback,
-  useEffect,
-  useMemo,
-  useRef,
-  useState,
-} from "react";
-import { useLocation } from "react-router-dom";
-import _ from "lodash";
-import styles from "./index.module.scss";
-import { useDispatch, useSelector } from "react-redux";
-import { RootState } from "@/store";
-import ImageLazy from "@/components/ImageLazy";
-import GoodsAll from "./GoodsAll";
-import LookModal from "@/components/LookObjTable/LookModal";
-import { MessageFu } from "@/utils/message";
+import BreadTit from '@/components/BreadTit'
+import { object4AddAPI, object4infoOutAPI } from '@/store/action/object4'
+import history, { urlParameter } from '@/utils/history'
+import { Button, Input, Popconfirm, Select, Table } from 'antd'
+import TextArea from 'antd/es/input/TextArea'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { useLocation } from 'react-router-dom'
+import _ from 'lodash'
+import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import ImageLazy from '@/components/ImageLazy'
+import GoodsAll from './GoodsAll'
+import LookModal from '@/components/LookObjTable/LookModal'
+import { MessageFu } from '@/utils/message'
 function AddObject4() {
-  const dispatch = useDispatch();
+  const dispatch = useDispatch()
 
   // 从仓库拿表格信息
-  const results = useSelector(
-    (state: RootState) => state.object4Store.goodsTableList
-  );
+  const results = useSelector((state: RootState) => state.object4Store.goodsTableList)
 
   // 表格里面的输入框信息
-  const inputRef = useRef(-1);
-  const inputInfoRef = useRef<any>({});
-  const inputChangeFu = useCallback(
-    (e: React.ChangeEvent<HTMLInputElement>, id: number) => {
-      clearTimeout(inputRef.current);
-      inputRef.current = window.setTimeout(() => {
-        if (e.target.value.trim() === "") return;
-        inputInfoRef.current[id] = {
-          names: e.target.value.trim(),
-        };
-        console.log(inputInfoRef.current);
-      }, 500);
-    },
-    []
-  );
+  const inputRef = useRef(-1)
+  const inputInfoRef = useRef<any>({})
+  const inputChangeFu = useCallback((e: React.ChangeEvent<HTMLInputElement>, id: number) => {
+    clearTimeout(inputRef.current)
+    inputRef.current = window.setTimeout(() => {
+      if (e.target.value.trim() === '') return
+      inputInfoRef.current[id] = {
+        names: e.target.value.trim()
+      }
+      console.log(inputInfoRef.current)
+    }, 500)
+  }, [])
 
   // 顶部数据
   const [addInfoTop, setAddInfoTop] = useState<any>({
-    outType: "展览",
-  });
+    outType: '展览'
+  })
 
   // 进入页面新增请求函数
   const object4AddAPIFu = useCallback(async () => {
-    const res = await object4AddAPI();
-    setAddInfoTop({ ...res.data, outType: "展览" });
+    const res = await object4AddAPI()
+    setAddInfoTop({ ...res.data, outType: '展览' })
     // 初始化表格数据
     dispatch({
-      type: "object4/getGoodsTableList",
-      payload: [],
-    });
-  }, [dispatch]);
+      type: 'object4/getGoodsTableList',
+      payload: []
+    })
+  }, [dispatch])
 
   // 通过id获取详情函数
   const object4infoOutAPIFu = useCallback(
     async (id: number) => {
-      const res = await object4infoOutAPI(id);
-      setAddInfoTop(res.data.entity);
+      const res = await object4infoOutAPI(id)
+      setAddInfoTop(res.data.entity)
       // 设置表格信息
       dispatch({
-        type: "object4/getGoodsTableList",
-        payload: res.data.child,
-      });
+        type: 'object4/getGoodsTableList',
+        payload: res.data.child
+      })
       // 设置出库位置ref
       if (res.data.child && res.data.child.length) {
         res.data.child.forEach((v: any) => {
           inputInfoRef.current[v.id] = {
-            names: v.outLocation,
-          };
-        });
+            names: v.outLocation
+          }
+        })
       }
     },
     [dispatch]
-  );
+  )
 
   // 获取地址栏参数
-  const location = useLocation();
-  const [urlParam, setUrlParam] = useState<any>({});
+  const location = useLocation()
+  const [urlParam, setUrlParam] = useState<any>({})
   useEffect(() => {
-    const obj = urlParameter(location.search);
-    setUrlParam(obj);
+    const obj = urlParameter(location.search)
+    setUrlParam(obj)
 
     if (obj.id) {
       // 如果是编辑
-      object4infoOutAPIFu(obj.id);
-    } else object4AddAPIFu();
-  }, [location, object4AddAPIFu, object4infoOutAPIFu]);
+      object4infoOutAPIFu(obj.id)
+    } else object4AddAPIFu()
+  }, [location, object4AddAPIFu, object4infoOutAPIFu])
   // 点击返回
   const cancelFu = useCallback(() => {
     history.push({
       pathname: `/object/4`,
-      state: { k: urlParam.k ? urlParam.k : "1", d: urlParam.d },
-    });
-  }, [urlParam.d, urlParam.k]);
+      state: { k: urlParam.k ? urlParam.k : '1', d: urlParam.d }
+    })
+  }, [urlParam.d, urlParam.k])
 
   // 点击提交
   const submitFu = useCallback(async () => {
-    if (results.length === 0)
-      return MessageFu.warning("至少需要添加一条藏品信息!");
+    if (results.length === 0) return MessageFu.warning('至少需要添加一条藏品信息!')
 
-    const objLength = Object.keys(inputInfoRef.current).length;
-    if (objLength < results.length) return MessageFu.warning("请输入出库位置!");
+    const objLength = Object.keys(inputInfoRef.current).length
+    if (objLength < results.length) return MessageFu.warning('请输入出库位置!')
 
     const obj = {
       description: addInfoTop.description,
       id: addInfoTop.id,
       outType: addInfoTop.outType,
-      goodsIds: results.map((v: any) => v.id).join(","),
-      location: inputInfoRef.current,
-    };
+      goodsIds: results.map((v: any) => v.id).join(','),
+      location: inputInfoRef.current
+    }
 
-    const res: any = await object4AddAPI(obj);
+    const res: any = await object4AddAPI(obj)
     if (res.code === 0) {
-      MessageFu.success("操作成功!");
-      cancelFu();
+      MessageFu.success('操作成功!')
+      cancelFu()
     }
-  }, [
-    addInfoTop.description,
-    addInfoTop.id,
-    addInfoTop.outType,
-    cancelFu,
-    results,
-  ]);
+  }, [addInfoTop.description, addInfoTop.id, addInfoTop.outType, cancelFu, results])
 
   // 点击添加或者编辑出来页面
-  const [addPage, setAddPage] = useState(false);
+  const [addPage, setAddPage] = useState(false)
 
   // 选中的表格数据
-  const [tableSelectList, setTableSelectList] = useState([]);
+  const [tableSelectList, setTableSelectList] = useState([])
 
   // 表格的勾选状态
-  const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
+  const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([])
 
   // 表格的多选
   const rowSelection = {
     selectedRowKeys,
     onChange: (selectedRowKeys: any, selectedRows: any) => {
-      setTableSelectList(selectedRows);
-      setSelectedRowKeys(selectedRowKeys);
-    },
-  };
+      setTableSelectList(selectedRows)
+      setSelectedRowKeys(selectedRowKeys)
+    }
+  }
 
   // 点击添加
   const addPageFu = useCallback((id?: any) => {
-    setAddPage(true);
-  }, []);
+    setAddPage(true)
+  }, [])
 
   // 点击删除
   const delTableListFu = useCallback(() => {
-    console.log("多个删除", tableSelectList);
-    const data = _.differenceBy(results, tableSelectList, "id");
-    dispatch({ type: "object4/getGoodsTableList", payload: data });
-    setTableSelectList(data);
+    console.log('多个删除', tableSelectList)
+    const data = _.differenceBy(results, tableSelectList, 'id')
+    dispatch({ type: 'object4/getGoodsTableList', payload: data })
+    setTableSelectList(data)
 
     // 清除表格的勾选状态
-    setSelectedRowKeys([]);
+    setSelectedRowKeys([])
 
     // 同时删除出库位置信息
     tableSelectList.forEach((v: any) => {
-      delete inputInfoRef.current[v.id];
-    });
-  }, [dispatch, results, tableSelectList]);
+      delete inputInfoRef.current[v.id]
+    })
+  }, [dispatch, results, tableSelectList])
 
   // 控制弹窗的显示隐藏
-  const [show, setShow] = useState(false);
+  const [show, setShow] = useState(false)
   // 点击表格里面的查看
-  const lookIdRef = useRef(-1);
+  const lookIdRef = useRef(-1)
   const lookGoods = useCallback((id: number) => {
-    lookIdRef.current = id;
-    setShow(true);
-  }, []);
+    lookIdRef.current = id
+    setShow(true)
+  }, [])
 
   // 表格数据
   const columns = useMemo(() => {
     return [
       {
-        title: "缩略图",
-        render: (item: any) => (
-          <ImageLazy width={120} height={70} src={item.thumb} />
-        ),
+        title: '缩略图',
+        render: (item: any) => <ImageLazy width={120} height={70} src={item.thumb} />
       },
 
       {
-        title: "藏品编号名称",
-        dataIndex: "dictNum",
+        title: '藏品编号名称',
+        dataIndex: 'dictNum'
       },
       {
-        title: "藏品编号",
-        render: (item: any) => (item.num ? item.num : "-"),
+        title: '藏品编号',
+        render: (item: any) => (item.num ? item.num : '-')
       },
       {
-        title: "藏品名称",
-        dataIndex: "name",
+        title: '藏品名称',
+        dataIndex: 'name'
       },
       {
-        title: "类别",
-        dataIndex: "dictGoodType",
+        title: '类别',
+        dataIndex: 'dictGoodType'
       },
       {
-        title: "完残程度",
-        dataIndex: "complete",
+        title: '完残程度',
+        dataIndex: 'complete'
       },
       {
-        title: "出库位置",
+        title: '出库位置',
         width: 200,
         render: (item: any) => (
           <Input
             defaultValue={item.outLocation}
-            onChange={(e) => inputChangeFu(e, item.id)}
+            onChange={e => inputChangeFu(e, item.id)}
             maxLength={15}
             showCount
-            placeholder="请输入"
+            placeholder='请输入'
           />
-        ),
+        )
       },
       {
-        title: "操作",
+        title: '操作',
         render: (item: any) => (
           <>
-            <Button type="text" danger onClick={() => lookGoods(item.id)}>
+            <Button type='text' danger onClick={() => lookGoods(item.id)}>
               查看
             </Button>
           </>
-        ),
-      },
-    ];
-  }, [inputChangeFu, lookGoods]);
+        )
+      }
+    ]
+  }, [inputChangeFu, lookGoods])
 
   // 出库类型下拉框变化
 
-  const options = useSelector(
-    (state: RootState) => state.object4Store.typeSelectList
-  );
+  const options = useSelector((state: RootState) => state.object4Store.typeSelectList)
 
   const typeChangeFu = useCallback(
     (value: string) => {
-      setAddInfoTop({ ...addInfoTop, outType: value });
+      setAddInfoTop({ ...addInfoTop, outType: value })
     },
     [addInfoTop]
-  );
+  )
 
   return (
     <div className={styles.AddObject4}>
-      <div className="breadTit">
+      <div className='breadTit'>
         <BreadTit>
-          <div className="breadTitRow">出库管理</div>
-          <div className="splitStr">/</div>
-          <div className="breadTitRow active">
-            {urlParam.id ? "编辑" : "新增"}
-          </div>
+          <div className='breadTitRow'>出库管理</div>
+          <div className='splitStr'>/</div>
+          <div className='breadTitRow active'>{urlParam.id ? '编辑' : '新增'}</div>
         </BreadTit>
       </div>
-      <div className="objectSonMain">
+      <div className='objectSonMain'>
         {/* 上面的信息展示 */}
-        <div className="addInfoTop">
-          <div className="row">
+        <div className='addInfoTop'>
+          <div className='row'>
             <div>
-              <span className="bs">出库编号:</span>
+              <span className='bs'>出库编号:</span>
               <Input style={{ width: 300 }} value={addInfoTop.num} disabled />
             </div>
             <div>
-              <span className="bs">登记人员:</span>
-              <Input
-                style={{ width: 300 }}
-                value={addInfoTop.creatorName}
-                disabled
-              />
+              <span className='bs'>登记人员:</span>
+              <Input style={{ width: 300 }} value={addInfoTop.creatorName} disabled />
             </div>
             <div>
-              <span className="bs">出库类型:</span>
+              <span className='bs'>出库类型:</span>
               <Select
                 style={{ width: 300 }}
-                placeholder="请选择"
+                placeholder='请选择'
                 value={addInfoTop.outType}
                 onChange={typeChangeFu}
                 options={options}
               />
             </div>
           </div>
-          <div className="rowAll">
+          <div className='rowAll'>
             <span>出库说明:</span>
             <TextArea
               value={addInfoTop.description}
-              onChange={(e) =>
-                setAddInfoTop({ ...addInfoTop, description: e.target.value })
-              }
+              onChange={e => setAddInfoTop({ ...addInfoTop, description: e.target.value })}
               rows={3}
-              placeholder="请输入"
+              placeholder='请输入'
               showCount
               maxLength={255}
             />
           </div>
         </div>
         {/* 下面的表格 */}
-        <div className="addTableBox">
-          <div className="addTableBox_Tit">
-            <div className="addTableBox_TitL">藏品信息</div>
-            <div className="addTableBox_TitR">
+        <div className='addTableBox'>
+          <div className='addTableBox_Tit'>
+            <div className='addTableBox_TitL'>藏品信息</div>
+            <div className='addTableBox_TitR'>
               <Button onClick={() => addPageFu(null)}>添加</Button>
               &emsp;
               <Popconfirm
                 disabled={tableSelectList.length === 0}
-                title="确定删除吗?"
-                okText="确定"
-                cancelText="取消"
+                title='确定删除吗?'
+                okText='确定'
+                cancelText='取消'
                 onConfirm={delTableListFu}
               >
                 <Button disabled={tableSelectList.length === 0}>删除</Button>
@@ -320,24 +290,24 @@ function AddObject4() {
           </div>
 
           {/* 表格主体 */}
-          <div className="addTableBox_table">
+          <div className='addTableBox_table'>
             <Table
-              size="small"
+              size='small'
               scroll={{ y: 355 }}
               rowSelection={{
-                type: "checkbox",
-                ...rowSelection,
+                type: 'checkbox',
+                ...rowSelection
               }}
               dataSource={results}
               columns={columns}
-              rowKey="id"
+              rowKey='id'
               pagination={false}
             />
           </div>
 
           {/* 返回按钮 */}
-          <div className="addTableBox_btn">
-            <Button type="primary" onClick={submitFu}>
+          <div className='addTableBox_btn'>
+            <Button type='primary' onClick={submitFu}>
               提交
             </Button>
             &emsp;
@@ -350,16 +320,12 @@ function AddObject4() {
 
       {/* 点击查看出来的对话框 */}
       {show ? (
-        <LookModal
-          id={lookIdRef.current}
-          show={show}
-          closeShow={() => setShow(false)}
-        />
+        <LookModal id={lookIdRef.current} show={show} closeShow={() => setShow(false)} />
       ) : null}
     </div>
-  );
+  )
 }
 
-const MemoAddObject4 = React.memo(AddObject4);
+const MemoAddObject4 = React.memo(AddObject4)
 
-export default MemoAddObject4;
+export default MemoAddObject4

+ 71 - 70
src/utils/dataChange.ts

@@ -1,107 +1,108 @@
-import store from "@/store";
+import store from '@/store'
 
 // 藏品信息键值对的映射
 export const goodsChangeObj = {
-  name: "藏品名称",
-  namePrimitive: "原名",
-  dictNum: "藏品编号名称",
-  num: "藏品编号",
-  dictAge: "年代",
-  dictTexture: "文物质地",
-  ageSpecific: "具体年代",
-  dictGoodType: "文物类别",
-  pcs: "实际数量",
-  dictLevel: "文物级别",
-  size: "外形尺寸",
-  sizeSpecific: "具体尺寸",
-  dictQualityScope: "质量范围",
-  quality: "具体质量",
-  complete: "完残程度",
-  repair: "保存状态",
-  dictCheckInScope: "入藏时间范围",
-  checkInYear: "入藏年度",
-  author: "著者",
-  vision: "版本",
-  onFile: "存卷",
-  description: "来源说明",
-  display: "展示状态",
-  thumb: "藏品图片",
-  fileIds: "附件信息",
-} as any;
+  name: '藏品名称',
+  namePrimitive: '原名',
+  dictNum: '藏品编号名称',
+  num: '藏品编号',
+  dictAge: '年代',
+  dictTexture: '文物质地',
+  ageSpecific: '具体年代',
+  dictGoodType: '文物类别',
+  pcs: '实际数量',
+  dictLevel: '文物级别',
+  size: '外形尺寸',
+  sizeSpecific: '具体尺寸',
+  dictQualityScope: '质量范围',
+  quality: '具体质量',
+  complete: '完残程度',
+  repair: '保存状态',
+  dictCheckInScope: '入藏时间范围',
+  checkInYear: '入藏年度',
+  author: '著者',
+  vision: '版本',
+  onFile: '存卷',
+  description: '来源说明',
+  remark: '备注',
+  display: '展示状态',
+  thumb: '藏品图片',
+  fileIds: '附件信息'
+} as any
 // 状态的筛选
 export const statusObj = {
-  0: "待办理", //草稿中
-  1: "待审核", //待审核
-  2: "审核不通过", //审核不通过
-  3: "已完成", //审核通过
-} as any;
+  0: '待办理', //草稿中
+  1: '待审核', //待审核
+  2: '审核不通过', //审核不通过
+  3: '已完成' //审核通过
+} as any
 
 // 入库出库的状态筛选
 export const storageStatusObj = {
-  "0": "未入库",
-  temp: "待审核通过",
-  in: "已入库 ",
-  out: "已出库",
-} as any;
+  '0': '未入库',
+  temp: '待审核通过',
+  in: '已入库 ',
+  out: '已出库'
+} as any
 
 // 藏品总账,操作记录
 export const logTypeObj = {
-  in: "入库管理",
-  out: "出库管理",
-  move: "藏品移库",
-  edit: "藏品修改",
-} as any;
+  in: '入库管理',
+  out: '出库管理',
+  move: '藏品移库',
+  edit: '藏品修改'
+} as any
 // 藏品总账,操作记录跳转
 export const logTypeOpenObj = {
-  in: "#/object/3/look?k=1&d=null&id=", //入库管理的查看
-  out: "#/object/4/look?k=1&d=null&id=", //出库管理的查看
-  move: "#/stores/3/look?k=1&d=null&id=", //藏品移库的查看
-  edit: "#/object/5/look?k=1&d=null&id=", //藏品修改的查看
-} as any;
+  in: '#/object/3/look?k=1&d=null&id=', //入库管理的查看
+  out: '#/object/4/look?k=1&d=null&id=', //出库管理的查看
+  move: '#/stores/3/look?k=1&d=null&id=', //藏品移库的查看
+  edit: '#/object/5/look?k=1&d=null&id=' //藏品修改的查看
+} as any
 
 // 出库管理状态的筛选
 export const statusObjCK = {
-  0: "待办理", //草稿中
-  1: "待审核", //待审核
-  2: "审核不通过", //审核不通过
-  3: "待归还", //审核通过
-  4: "已归还", //审核通过
-} as any;
+  0: '待办理', //草稿中
+  1: '待审核', //待审核
+  2: '审核不通过', //审核不通过
+  3: '待归还', //审核通过
+  4: '已归还' //审核通过
+} as any
 
 export const statusObjCK2 = {
-  0: "待办理", //草稿中
-  1: "待审核", //待审核
-  2: "审核不通过", //审核不通过
-  3: "已完成(待归还)", //审核通过
-  4: "已完成(已归还)", //审核通过
-} as any;
+  0: '待办理', //草稿中
+  1: '待审核', //待审核
+  2: '审核不通过', //审核不通过
+  3: '已完成(待归还)', //审核通过
+  4: '已完成(已归还)' //审核通过
+} as any
 
 // 根据入库管理的选中id来改变字段
 export const obj3InStorage = (data: string) => {
-  let txt = "";
+  let txt = ''
   if (data) {
-    const arr = store.getState().stores1Store.infoList;
-    const ids = data.split(",");
+    const arr = store.getState().stores1Store.infoList
+    const ids = data.split(',')
 
     if (ids[0]) {
       arr.forEach((v1: any) => {
         if (v1.id === Number(ids[0])) {
-          txt += v1.name;
+          txt += v1.name
           if (ids[1]) {
             v1.children.forEach((v2: any) => {
               if (v2.id === Number(ids[1])) {
-                txt += "/" + v2.name;
+                txt += '/' + v2.name
                 if (ids[2]) {
                   v2.children.forEach((v3: any) => {
-                    if (v3.id === Number(ids[2])) txt += "/" + v3.name;
-                  });
+                    if (v3.id === Number(ids[2])) txt += '/' + v3.name
+                  })
                 }
               }
-            });
+            })
           }
         }
-      });
+      })
     }
   }
-  return txt;
-};
+  return txt
+}