forked from gzzfw/frontEnd/gzDyh

liyj
2024-09-05 6bbe73072fcb0ee0b7f190e0f3da286518c3d7a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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';
import EscalationModel from './EscalationModel';
import AssignedModel from './AssignedModel';
 
const TabPane = Tabs.TabPane;
 
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: '李晓明'
  },
];
 
export default function EventFlow(props) {
  const scrollRef = useRef(null)
  const [backVisible, setBackVisible] = useState(false)
  const [height, setHeight] = useState(500)
  const [escalationVisible, setEscalationVisible] = useState(false)
  const [assignedVisible, setAssignedVisible] = useState(false)
 
  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' >
        <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' }}>
          <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>
          <Button type='secondary' >返回上级页面</Button>
        </Space>
      </div>
      <Modal
        title='回退'
        visible={backVisible}
        onOk={() => setBackVisible(false)}
        onCancel={() => { setBackVisible(false) }}
        autoFocus={false}
        focusLock={true}
        footer={null}
        unmountOnExit={true}
        maskClosable={false}
      >
        <BackModel />
      </Modal>
      <Modal
        title='上报'
        visible={escalationVisible}
        onOk={() => setEscalationVisible(false)}
        onCancel={() => { setEscalationVisible(false) }}
        autoFocus={false}
        focusLock={true}
        footer={null}
        unmountOnExit={true}
        maskClosable={false}
      >
        <EscalationModel />
      </Modal>
      <Modal
        title='交办'
        visible={assignedVisible}
        onOk={() => setAssignedVisible(false)}
        onCancel={() => { setAssignedVisible(false) }}
        footer={null}
        unmountOnExit={true}
        maskClosable={false}
      >
        <AssignedModel />
      </Modal>
    </div>
  )
}