From f4f1f52e57846b6b488f801d7d2774cdad205d0d Mon Sep 17 00:00:00 2001 From: xixi <123@qq.com> Date: Fri, 23 Aug 2024 12:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/route/Refun/Refun.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/route/Refun/Refun.tsx b/src/route/Refun/Refun.tsx index 5e301d5..12fbe1a 100644 --- a/src/route/Refun/Refun.tsx +++ b/src/route/Refun/Refun.tsx @@ -1,5 +1,5 @@ import './refun.css'; -import { useState, useEffect } from 'react'; +import { useState, useEffect, } from 'react'; import { Table, // Pagination, @@ -8,6 +8,7 @@ import { import { useSelector, useDispatch } from 'react-redux' import { get, put, downloadUrl } from '../../util/AjaxUtils' import type { TableProps } from 'antd'; +import {getMenuActive} from '../../util/cache' interface DataType { projName: string; projPayment: string; @@ -32,10 +33,12 @@ export default function Refun() { const [revokeModal, setRevokeModal] = useState(false) //撤销弹窗 const [projRefundApplyId, setprojRefundApplyId] = useState('') //要撤销的id const { state } = useLocation() + const type = state? state.type:getMenuActive() + // setMenuActive(type) // {state.type} const columns: TableProps['columns'] = // 撤销状态 - state.type == 'CANCELED' ? [ + type == 'CANCELED' ? [ { title: '序号', dataIndex: 'index', @@ -121,7 +124,7 @@ export default function Refun() { }, ] - : state.type == 'PENDING' ? + : type == 'PENDING' ? // PENDING待审核状态 [ { @@ -335,7 +338,7 @@ export default function Refun() { params: { page: page, rows: 10, - applyStatus: state.type + applyStatus: type } }, onBefore() { @@ -379,7 +382,7 @@ export default function Refun() { params: { page: page, rows: 10, - applyStatus: state.type + applyStatus: type } }, onSuccess(data: any) { @@ -415,7 +418,9 @@ export default function Refun() { // getData(1) setPage(1) getData(1) - }, [state.type]) + console.log(type); + + }, [type]) return (