From d2280c384e4b8f6acef1e01f400e3c61c97d82d9 Mon Sep 17 00:00:00 2001
From: dminyi <1301963064@qq.com>
Date: Sat, 07 Sep 2024 16:56:54 +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/EventFlow.jsx |  162 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 86 insertions(+), 76 deletions(-)

diff --git a/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx b/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx
index 318fd38..252ab71 100644
--- a/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx
+++ b/gz-customerSystem/src/views/register/eventFlow/component/EventFlow.jsx
@@ -9,82 +9,86 @@
 import AssignedModel from './AssignedModel';
 import MatterDetail from '../../matterDetail';
 import SupervisingView from "../../matterDetail/Supervising";
+import * as $$ from '@/utils/utility';
 
 const TabPane = Tabs.TabPane;
 const Step = Steps.Step;
 
-const fakeData = [
-  {
-    handlerUserName: '天河区棠下街综治中心',
-    finishTime: new Date().getTime() - 24 * 60 * 60 * 1000, // 一天前的时间
-    handleResult: '1',
-    status: '2',
-    taskNodeName: '来访登记',
-    mediResult: '22_00025-1',
-    handleContent: '调解成功,双方达成一致意见。',
-    operationName: '李晓明'
-  },
-  {
-    handlerUserName: '系统派单',
-    finishTime: new Date().getTime() - 12 * 60 * 60 * 1000, // 半天前的时间
-    handleResult: '1',
-    status: '2',
-    taskNodeName: '事件流转',
-    mediResult: '22_00025-1',
-    handleContent: '派单至:白云区新市街市场监管所',
-  },
-  {
-    handlerUserName: '白云区新市街市场监管所',
-    finishTime: new Date().getTime() - 11 * 60 * 60 * 1000, // 半天前的时间
-    handleResult: '1',
-    status: '2',
-    taskNodeName: '事件流转',
-    mediResult: '22_00025-1',
-    handleContent: '已签收',
-    operationName: '赵菲菲'
-  },
-  {
-    handlerUserName: '白云区新市街市场监管所',
-    finishTime: new Date().getTime() - 10 * 60 * 60 * 1000, // 半天前的时间
-    handleResult: '1',
-    status: '3',
-    taskNodeName: '事件回退',
-    mediResult: '22_00025-1',
-    // handleContent: '已签收',
-    operationName: '赵菲菲'
-  },
-  {
-    handlerUserName: '白云区新市街综治中心',
-    finishTime: new Date().getTime() - 9 * 60 * 60 * 1000, // 半天前的时间
-    handleResult: '1',
-    status: '2',
-    taskNodeName: '回退审核',
-    mediResult: '22_00025-1',
-    handleContent: '通过',
-    operationName: '赵菲菲'
-  },
-  {
-    handlerUserName: '天河区棠下街综治中心',
-    finishTime: new Date().getTime() - 6 * 60 * 60 * 1000, // 6小时前的时间
-    handleResult: '2',
-    status: '1',
-    taskNodeName: '事件流转',
-    mediResult: '22_00025-1',
-    handleContent: '案件已被签收,准备开始调解。',
-    operationName: '李晓明'
-  },
-];
+function getListCaseFlow(data) {
+	return $$.ax.request({ url: `caseTask/listCaseFlow`, type: 'get', service: 'mediate', data });
+}
 
 export default function EventFlow(props) {
+  const myButton = [
+    {
+      label: '受理',
+      type: 'primary',
+      click: () => { },
+      key: 'sl',
+    },
+    {
+      label: '提交',
+      type: 'primary',
+      click: () => { },
+      key: 'tj',
+    },
+    {
+      label: '自行受理',
+      type: 'primary',
+      click: () => { },
+      key: 'zxsl',
+    },
+    {
+      label: '回退',
+      type: 'outline',
+      click: () => setBackVisible(true),
+      key: 'ht',
+      status: 'danger'
+    },
+    {
+      label: '交办',
+      type: 'outline',
+      click: () => setAssignedVisible(true),
+      key: 'jb',
+    },
+    {
+      label: '上报',
+      type: 'outline',
+      click: () => setEscalationVisible(true),
+      key: 'sb',
+    },
+  ]
   const scrollRef = useRef(null)
   const [backVisible, setBackVisible] = useState(false)
   const [height, setHeight] = useState(500)
   const [escalationVisible, setEscalationVisible] = useState(false)
   const [assignedVisible, setAssignedVisible] = useState(false)
+  const [staticButtonList, setStaticButtonList] = useState([])
+  const [progressData, setProgressData] = useState({})
 
   useEffect(() => {
+    if (props.authorData) {
+      const { buttonList } = props.authorData;
+      setStaticButtonList(myButton.filter(item => {
+        const flag = buttonList.some(result => {
+          if (result.id === item.key) {
+            return true
+          }
+        })
+        return flag
+      }))
+    }
+  }, [props.authorData])
+
+  useEffect(() => {
+    getData()
     onWindowResize()
     window.addEventListener("resize", onWindowResize);
+    // 返回一个函数,该函数会在组件卸载前执行  
+    return () => {
+      // 组件销毁时执行  
+      window.removeEventListener("resize", onWindowResize);
+    };
   }, [])
 
   const onWindowResize = () => {
@@ -96,6 +100,16 @@
     }
     setHeight(getSize().windowH - offsetTop - 16)
   };
+
+  //获取流程信息
+  const getData = async () => {
+    const res = await getListCaseFlow({
+      caseId: props.caseId
+    })
+    if(res.type) {
+      setProgressData(res.data)
+    }
+  }
 
   return (
     <Fragment>
@@ -116,7 +130,7 @@
           ref={scrollRef}
           autoHide
         >
-          <MatterDetail />
+          <MatterDetail caseId={props.caseId}/>
           <div className='dataSync-hasTabPage' style={{ marginTop: '-8px' }}>
             <Tabs defaultActiveTab='1' >
               <TabPane
@@ -127,7 +141,7 @@
                   </span>
                 }
               >
-                <ProgressStep progressData={fakeData} />
+                <ProgressStep progressData={progressData} />
               </TabPane>
               <TabPane
                 key='2'
@@ -150,26 +164,22 @@
           visible={backVisible}
           onOk={() => setBackVisible(false)}
           onCancel={() => { setBackVisible(false) }}
-          autoFocus={false}
-          focusLock={true}
           footer={null}
           unmountOnExit={true}
           maskClosable={false}
         >
-          <BackModel />
+          <BackModel caseId={props.caseId} onCancel={() => { setBackVisible(false) }}/>
         </Modal>
         <Modal
           title='上报'
           visible={escalationVisible}
           onOk={() => setEscalationVisible(false)}
           onCancel={() => { setEscalationVisible(false) }}
-          autoFocus={false}
-          focusLock={true}
           footer={null}
           unmountOnExit={true}
           maskClosable={false}
         >
-          <EscalationModel />
+          <EscalationModel caseId={props.caseId} onCancel={() => { setEscalationVisible(false) }}/>
         </Modal>
         <Modal
           title='交办'
@@ -179,17 +189,17 @@
           footer={null}
           unmountOnExit={true}
           maskClosable={false}
+          autoFocus={false}
+          focusLock={false}
         >
-          <AssignedModel />
+          <AssignedModel caseId={props.caseId} onCancel={() => { setAssignedVisible(false) }}/>
         </Modal>
         <div className="dataSync-excel">
           <Space size="large" style={{ margin: '4px 14px' }}>
-            <Button type="primary"  >受理</Button>
-            <Button type="primary"  >提交</Button>
-            <Button type="primary"  >自行受理</Button>
-            <Button type='outline' status='danger' onClick={() => setBackVisible(true)}>回退</Button>
-            <Button type='outline' onClick={() => setAssignedVisible(true)}>交办</Button>
-            <Button type='outline' onClick={() => setEscalationVisible(true)}>上报</Button>
+            {staticButtonList?.map(item => {
+              const { label, key, click, ...rest } = item;
+              return <Button key={key} onClick={click} {...rest} >{label}</Button>
+            })}
             <Button type='secondary' >返回上级页面</Button>
           </Space>
         </div>

--
Gitblit v1.8.0