diff --git a/src/components/CorrectionModal/CorrectionModal.tsx b/src/components/CorrectionModal/CorrectionModal.tsx index 09b4db5..a236528 100644 --- a/src/components/CorrectionModal/CorrectionModal.tsx +++ b/src/components/CorrectionModal/CorrectionModal.tsx @@ -1,11 +1,11 @@ // import React from 'react' import { useEffect, useState } from 'react' // import './RefunModal.css' -import { Form, Select, Button, Upload, message, Input, Modal, Table,Empty } from 'antd'; +import { Form, Select, Button, Upload, message, Input, Modal, Table, Empty } from 'antd'; import type { TableColumnsType } from 'antd'; const { Search } = Input; import { UploadOutlined } from '@ant-design/icons'; -import { DevUserId, get, post,uploadFileUrl} from "../../util/AjaxUtils.ts"; +import { DevUserId, get, post, uploadFileUrl } from "../../util/AjaxUtils.ts"; // import { getMenuActive } from '../../util/cache.ts' import { useDispatch } from 'react-redux' const { TextArea } = Input; @@ -100,7 +100,7 @@ export default function CorrectionModal(props: any) { // console.log(refunArray); - + // console.log(values); post({ messageApi, url: `/api/proj/correction/apply/save`, @@ -153,6 +153,8 @@ export default function CorrectionModal(props: any) { type: 'upCorrectionTotal', val: data.data.total }) + + } }) } @@ -188,11 +190,13 @@ export default function CorrectionModal(props: any) { }, }) } + useEffect(() => { getCorrectionData() }, [page, keywords]) + return (
{contextHolder} @@ -356,9 +360,9 @@ export default function CorrectionModal(props: any) { action={uploadFileUrl()} headers={{ 'X-USER-ID': DevUserId }} beforeUpload={(file) => { - const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'|| file.type === 'application/pdf'; + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'application/pdf'; // const isPdf = file.type === 'application/pdf'; - if (!isJpgOrPng ) { + if (!isJpgOrPng) { message.error('只能上传 JPG/PNG/PDF 格式文件!'); return Upload.LIST_IGNORE; // 不允许上传非 } @@ -394,7 +398,6 @@ export default function CorrectionModal(props: any) { open={projModal} onOk={ - () => { if (newprojId) { setProjName(newprojName) diff --git a/src/route/Correction/Correction.tsx b/src/route/Correction/Correction.tsx index 50cea79..6ef7e82 100644 --- a/src/route/Correction/Correction.tsx +++ b/src/route/Correction/Correction.tsx @@ -576,6 +576,7 @@ export default function Correction() { const redxuState: any = useSelector(state => state) const correctionArray = redxuState.correctionArray const total = redxuState.correctionTotal + const newCorrection = redxuState.newCorrection const [projCorrectionApplyId, setprojCorrectionApplyId] = useState('') //要撤销的id // const correctionType = state?state.correctionType:'' @@ -678,6 +679,19 @@ export default function Correction() { // console.log('嘻嘻',correctionArray); }, [keyWords, applyStatus, authorId, correctionNumType, correctionType]) + useEffect(() => { + // getData(1) + if (newCorrection) { + setPage(1) + getData(1) + dispath({ + type: 'newCorrection', + val: false + }) + } + + + }, [newCorrection]) return (
{contextHolder} diff --git a/src/route/Refun/Refun.tsx b/src/route/Refun/Refun.tsx index 32d7f30..1f2f647 100644 --- a/src/route/Refun/Refun.tsx +++ b/src/route/Refun/Refun.tsx @@ -404,7 +404,7 @@ export default function Refun() { const redxuState: any = useSelector(state => state) const refunArray = redxuState.refunArray const total = redxuState.refunTotal - + const newRefun = redxuState.newRefun const getData = (page: number) => { get({ messageApi, @@ -503,6 +503,20 @@ export default function Refun() { // console.log(authorId); }, [keyWords, applyStatus, authorId]) + useEffect(() => { + // getData(1) + if (newRefun) { + setPage(1) + getData(1) + dispath({ + type: 'newRefun', + val: false + }) + } + + + }, [newRefun]) + return (
diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index 041a395..a6f1306 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -1307,6 +1307,10 @@ export default function Index() {