From 9f705a54328c4b59ad9566c521bc6e0e7577acb3 Mon Sep 17 00:00:00 2001 From: liuwh <964324856@qq.com> Date: Fri, 13 Sep 2024 19:10:30 +0800 Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master --- gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx | 46 +++++++++++++++++++++++++++++----------------- 1 files changed, 29 insertions(+), 17 deletions(-) diff --git a/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx b/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx index 4a2727f..72bbed3 100644 --- a/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx +++ b/gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx @@ -5,6 +5,8 @@ import ArcoUpload from '@/components/ArcoUpload'; import { Scrollbars } from "react-custom-scrollbars"; import * as $$ from '@/utils/utility'; +import { getOffset, getSize } from '@/utils/utility'; +import { useNavigate } from 'react-router-dom'; const RadioGroup = Radio.Group; const FormItem = Form.Item; @@ -21,18 +23,17 @@ return $$.ax.request({ url: url, type: 'post', service: 'mediate', data }); } -function getId() { - return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' }); -} - function delFile(id) { return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } }); } export default function Examine(props) { + const navigate = useNavigate(); const formRef = useRef(); + const scrollRef = useRef(null); const [infoData, setInfoData] = useState({}); const [id, setId] = useState(); + const [height, setHeight] = useState(500); const mainFlag = props.type == 'htsh' ? 'return' : 'appear' const options = [ { @@ -51,16 +52,25 @@ useEffect(() => { getInfoData() - getAppId() }, [props.type]) - //获取id - const getAppId = async () => { - const res = await getId() - if (res.type) { - setId(res.data) + useEffect(() => { + onWindowResize() + window.addEventListener("resize", onWindowResize); + // 返回一个函数,该函数会在组件卸载前执行 + return () => { + // 组件销毁时执行 + window.removeEventListener("resize", onWindowResize); + }; + }, []) + + const onWindowResize = () => { + let offsetTop = 0; + if (scrollRef.current.container) { + offsetTop = getOffset(scrollRef.current.container).top; } - } + setHeight(getSize().windowH - offsetTop - 74) + }; //回显数据 const getInfoData = async () => { @@ -69,6 +79,7 @@ }) if (res.type) { setInfoData(res.data || {}) + setId(res.data.id) } } @@ -92,6 +103,7 @@ const res = await submit(props.type, data) if (res.type) { $$.infoSuccess({ content: '提交成功!' }); + navigate('/mediate/visit/visitWorkBench') } } @@ -121,16 +133,16 @@ {infoData?.fileInfoList?.map(res => { return res.fileList.map((result, resIndex) => { return <a href="your-link-here.html" target="_blank"> - <img src={link} alt="" className="title-file" />{result.trueName} + <img src={link} alt="" className="title-file" />{result.name} {resIndex !== res.fileList.length - 1 && <>,</>} </a> }) - })} + }) || '-'} </div> </Col> <Col span={24}> <div><div className="title-text">申请时间</div></div> - <div>{infoData[mainFlag + 'Time'] || '-'}</div> + <div>{$$.myTimeFormat(infoData[mainFlag + 'Time'], 'YYYY-MM-DD HH:mm') || '-'}</div> </Col> <Col span={24}> <div><div className="title-text">申请人</div></div> @@ -143,7 +155,7 @@ </Row> </div> <div className='whiteBox' style={{ marginTop: '8px' }}> - <Scrollbars style={{ height: 'calc(100vh - 577px)' }} autoHide> + <Scrollbars style={{ height: height + 'px' }} autoHide ref={scrollRef}> <Space size='small'> <div className='MediationInfo-subTitle' style={{ marginTop: '-8px' }}></div><h5>审核</h5> </Space> @@ -186,7 +198,7 @@ options={options} onChange={(value) => { const obj = options.find(item => item.value === value) - formRef.current.setFieldValue('audit_content', obj.label) + formRef.current.setFieldValue('auditContent', obj.label) }} > </RadioGroup> @@ -195,7 +207,7 @@ <Col span={24}> <FormItem label=' ' - field='audit_content' + field='auditContent' rules={[{ required: true, message: '理由不能为空' }]} > <TextArea -- Gitblit v1.8.0