import BreadTit from "@/components/BreadTit"; import LookObjTable from "@/components/LookObjTable"; import { RootState } from "@/store"; import { auditObject1API, getObj1InfoTableAPI2, object1infoOutAPI, } from "@/store/action/object1"; import { statusObj } from "@/utils/dataChange"; import history, { urlParameter } from "@/utils/history"; import { Button, message, Select } from "antd"; import TextArea from "antd/es/input/TextArea"; import React, { useCallback, useEffect, useRef, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { useLocation } from "react-router-dom"; import styles from "./index.module.scss"; const { Option } = Select; function AuditObject1() { const dispatch = useDispatch(); // 获取地址栏参数 const location = useLocation(); const urlParamRef = useRef({}); useEffect(() => { urlParamRef.current = urlParameter(location.search); // console.log("地址栏参数", urlParamRef.current); }, [location]); // 点击返回 const cancelFu = () => { history.push({ pathname: `/object`, state: { k: urlParamRef.current.k ? urlParamRef.current.k : "1", d: urlParamRef.current.d, }, }); }; const getInfo = useCallback(async () => { const id = urlParamRef.current.id; const res1 = await object1infoOutAPI(id); const res2 = await getObj1InfoTableAPI2(id); const info = res1.data; info.statusTxt = statusObj[info.status]; const list = res2.data; dispatch({ type: "object1/getLookInfo", payload: { info, list } }); }, [dispatch]); useEffect(() => { getInfo(); }, [getInfo]); const { info, list: tableList } = useSelector( (state: RootState) => state.object1Store.lookInfo ); // 审核结果筛选 const [value, setValue] = useState(3); const valueChangeFu = (val: number) => { setValue(val); }; // 审核说明 const [value2, setValue2] = useState(""); // 点击确定 const btnOkFu = async () => { const txt = value2.replaceAll(" ", "").replaceAll("\n", ""); if (txt === "") return message.warning("审核说明不能为空!"); const res: any = await auditObject1API({ id: Number(urlParamRef.current.id), reason: value2, status: value, }); if (res.code === 0) { message.success("操作成功!"); cancelFu(); } }; return (
藏品登记
/
审核
登记信息
登记编号:
{info.num}
登记人员:
{info.creatorName}
藏品来源:
{info.sourceName}
登记说明: {info.description ? info.description : "-"}

藏品信息
{/* 封装的表格信息 */}
* 审核结果:
* 审核说明: