From b731548e050c727c4e05db660dfb64eabc94dbdd Mon Sep 17 00:00:00 2001
From: zhangyongtian <1181606322@qq.com>
Date: Fri, 13 Sep 2024 16:35:46 +0800
Subject: [PATCH] fix: bug修改

---
 gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx |   44 ++++++++++++++++++++++++++++----------------
 1 files changed, 28 insertions(+), 16 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..26f9a49 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')
     }
   }
 
@@ -125,12 +137,12 @@
                       {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