上传文件添加pdf

This commit is contained in:
xixi 2024-09-11 16:45:19 +08:00
parent c345e7af5c
commit 19dcb55b2c
5 changed files with 58 additions and 10 deletions

View File

@ -100,7 +100,7 @@ export default function CorrectionModal(props: any) {
// console.log(refunArray);
// console.log(values);
post<any>({
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 (
<div className='refunModal'>
{contextHolder}
@ -394,7 +398,6 @@ export default function CorrectionModal(props: any) {
open={projModal}
onOk={
() => {
if (newprojId) {
setProjName(newprojName)

View File

@ -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 (
<div>
{contextHolder}

View File

@ -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 (
<div>

View File

@ -1307,6 +1307,10 @@ export default function Index() {
<Button type="primary" onClick={() => {
setRefunModal(true)
refunInit()
dispath({
type: 'newRefun',
val: true
})
}}
style={{ background: '#FF9F08' }}
>
@ -1370,6 +1374,10 @@ export default function Index() {
<Button type="primary" onClick={() => {
setCorrectionModal(true)
correctionInit()
dispath({
type: 'newCorrection',
val: true
})
}}
style={{ background: '#FF9F08' }}
>
@ -1609,7 +1617,8 @@ export default function Index() {
okButtonProps={{ style: { background: 'red', color: 'white' } }}
width={592}
>
<CorrectionModal closeModal={() => { setCorrectionModal(false) }}></CorrectionModal>
<CorrectionModal closeModal={() => { setCorrectionModal(false) }}
></CorrectionModal>
</Modal>
<Modal title="优惠券"
footer={null}

View File

@ -15,7 +15,9 @@ const baseState = {
correctionTotal:0,
couponModal:false,
projName:'',
projStatus:''
projStatus:'',
newRefun:false,
newCorrection:false
}
// 创建仓库
@ -54,6 +56,12 @@ const reducer = (state = baseState, action: any) => {
if (action.type == 'upProjStatus') {
nstate.projStatus = action.val
}
if (action.type == 'newRefun') {
nstate.newRefun = action.val
}
if (action.type == 'newCorrection') {
nstate.newCorrection = action.val
}
return nstate
}
const store = createStore(reducer)