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 (