From 3a188607647cbf05c08e7675186ec48764cc657c Mon Sep 17 00:00:00 2001
From: zhangyongtian <1181606322@qq.com>
Date: Wed, 04 Sep 2024 14:55:27 +0800
Subject: [PATCH] feat: 滚动优化、查看当事人报错、事件流转静态

---
 gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx |   64 ++++++++++++++++++++++++++++---
 1 files changed, 57 insertions(+), 7 deletions(-)

diff --git a/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx b/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx
index d5f7c12..046bba9 100644
--- a/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx
+++ b/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx
@@ -1,8 +1,12 @@
-import React, { useState } from 'react';
-import { Button, Modal } from '@arco-design/web-react';
+import React, { useState, useRef, useEffect } from 'react';
+import { Button, Modal, Tabs, Badge } from '@arco-design/web-react';
 import { Space } from 'antd';
 import ProgressStep from '@/components/ProgressStep/VisitStep';
 import BackModel from "./BackModel";
+import { Scrollbars } from "react-custom-scrollbars";
+import { getOffset, getSize } from '@/utils/utility';
+
+const TabPane = Tabs.TabPane;
 
 const fakeData = [
   {
@@ -67,15 +71,61 @@
 ];
 
 export default function EventFlow(props) {
+  const scrollRef = useRef(null)
   const [backVisible, setBackVisible] = useState(false)
-  const tabs = [
-    { index: '1', label: '流转进度' },
-    { index: '2', label: '督办信息' },
-  ];
+  const [height, setHeight] = useState(500)
+
+  useEffect(() => {
+    onWindowResize()
+    window.addEventListener("resize", onWindowResize);
+  }, [])
+
+  const onWindowResize = () => {
+    let offsetLeft = 0;
+    let offsetTop = 0;
+    if (scrollRef.current.container) {
+      offsetLeft = getOffset(scrollRef.current.container).left;
+      offsetTop = getOffset(scrollRef.current.container).top;
+    }
+    setHeight(getSize().windowH - offsetTop - 65)
+  };
+
   return (
     <div className='dataSync'>
       <div className='dataSync-hasTabPage' >
-        <ProgressStep progressData={fakeData} />
+        <Tabs defaultActiveTab='1' >
+          <TabPane
+            key='1'
+            title={
+              <span style={{ fontSize: '15px' }}>
+                流转进度
+              </span>
+            }
+          >
+            <Scrollbars
+              style={{ height: height }}
+              ref={scrollRef}
+              autoHide
+            >
+              <ProgressStep progressData={fakeData} />
+            </Scrollbars>
+          </TabPane>
+          <TabPane
+            key='2'
+            title={
+              <span style={{ fontSize: '15px' }}>
+                督办信息
+                <Badge maxCount={99} count={1000} />
+              </span>
+            }
+          >
+            <Scrollbars
+              style={{ height: height }}
+              ref={scrollRef}
+            ></Scrollbars>
+          </TabPane>
+        </Tabs>
+
       </div>
       <div className="dataSync-excel">
         <Space size="large" style={{ margin: '4px 14px' }}>

--
Gitblit v1.8.0