广州市综治平台前端
liuwh
6 days ago be89af3bf4d7e591ef085f55f1de7c28fcf5f6a8
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
import React, { useState } from 'react';
import { Form, Input, Radio, Button, Modal, Upload, Message } from '@arco-design/web-react';
import { Col, Space, Row, Empty, Image } from 'antd';
import * as $$ from '@/utils/utility';
import NameCard2 from '@/components/NameCard2';
import { link, timeLimit, empty } from '@/assets/images';
import PersonCard from './personCard';
 
const appUrl = $$.appUrl;
 
 
const ResponseDetail = ({ visible, handleOnCancel, data }) => {
  const [personView, setPersonView] = useState(false)
  const [personId, setPersonId] = useState('')
  const [imgVisible, setImgVisible] = useState({ visible: false, src: '' })
 
 
  const handlePersonDetail = (id) => {
    setPersonId(id)
    setPersonView(true)
  }
 
  function handleOpenFiles(record) {
    if (record.cat === '22_00017-3') {
      setImgVisible({ visible: true, src: `${appUrl.fileUrl}/${appUrl.sys}${record.showUrl}` });
    } else if (record.cat === '22_00017-6' || record.cat === '22_00017-1' || record.cat === '22_00017-2') {
      window.open(`${appUrl.fileUrl}${appUrl.fileShowUrl}${record.id}`);
    } else {
      $$.info({ type: 'warning', content: '抱歉,暂不支持在线查看,已下载请查看' });
      window.open(`${appUrl.fileUrl}${appUrl.fileDownUrl}${record.id}`);
    }
  }
 
 
  return (
    <Modal visible={visible} onCancel={handleOnCancel} title='督办回复详情' centered footer={null}>
      <Col span={24} style={{ marginBottom: '8px' }}>
        <Space size='small'>
          <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>督办意见</h5>
        </Space>
      </Col>
      <Row gutter={[16, 16]}>
        <Col span={24} >
          <div className="title-text">督办时间</div>
          <div>{data.supTime || '-'}</div>
        </Col>
        <Col span={24}>
          <div className="title-text">督办人</div>
          <div style={{ display: 'flex' }}>
            {data.supUnitName}&nbsp;<NameCard2 name={data.supUserName} userId={data.supUserId} />
          </div>
        </Col>
        <Col span={24}>
          <div className="title-text">督办内容</div>
          <div>{data.supContent || '-'}</div>
        </Col>
        <Col span={24}>
          <div>督办附件</div>
          <div style={{ display: 'flex' }}>
 
            {data.fileInfoList?.[0]?.fileList?.length > 0 ?
              <div style={{ display: 'flex', alignItems: 'center', gap: '4px', color: '#1A6FB8' }}>
                <img src={link} alt="" className="title-file" style={{ marginTop: '4px' }} />
                <div>
                  {data.fileInfoList?.[0]?.fileList?.map((item1, index1) =>
                    <div key={index1} onClick={() => handleOpenFiles(item1)} style={{ cursor: 'pointer' }}>{item1.name || '-'}{index1 === data.fileInfoList?.[0]?.fileList?.length - 1 ? '' : ','}</div>
                  )}
                </div>
              </div> : '-'
            }
          </div>
        </Col>
      </Row>
      <Col span={24} style={{ marginBottom: '8px', marginTop: '20px' }}>
        <Space size='small'>
          <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>督办回复</h5>
        </Space>
      </Col>
      {data.replyTime === null ?
        <div>
          <div style={{ backgroundColor: '#FFF7E8', padding: '5px 16px', display: 'flex' }}>
            <img src={timeLimit} alt='' style={{ width: '16px', height: '16px', marginRight: '8px', marginTop: '4px' }} />
            <div>回复时限剩{$$.getRemainingTime(data.supTime, data.replyTerm).hours}小时</div>
          </div>
          <Empty image={empty} description='督办部门未回复' style={{ color: '#86909C' }} />
        </div>
        :
        <Row gutter={[16, 16]}>
          <Col span={24} >
            <div className="title-text">回复时间</div>
            <div>{$$.minuteFormat(data.replyTime) || '-'}</div>
          </Col>
          <Col span={24}>
            <div className="title-text">回复人</div>
            <NameCard2 name={data.replyUserName} userId={data.replyUserId} />
          </Col>
          <Col span={24}>
            <div className="title-text">回复内容</div>
            <div>{data.replyContent || '-'}</div>
          </Col>
          <Col span={24}>
            <div className="title-text">附件材料</div>
            <div style={{ display: 'flex' }}>
 
              {data.fileInfoList?.[1]?.fileList?.length > 0 ?
                <div style={{ display: 'flex', alignItems: 'center', gap: '4px', color: '#1A6FB8' }}>
                  <img src={link} alt="" className="title-file" style={{ marginTop: '4px' }} />
                  <div>
                    {data.fileInfoList?.[1]?.fileList?.map((item1, index1) =>
                      <div key={index1} onClick={() => handleOpenFiles(item1)} style={{ cursor: 'pointer' }}>{item1.name || '-'}{index1 === data.fileInfoList?.[1]?.fileList?.length - 1 ? '' : ','}</div>
                    )}
                  </div>
                </div> : '-'
              }
            </div>
          </Col>
        </Row>
      }
      <PersonCard personView={personView} handleCancel={() => setPersonView(false)} personId={personId} />
      <Image
        // src={imgVisible?.src}
        preview={{
          visible: imgVisible?.visible,
          src: imgVisible?.src,
          onVisibleChange: (value) => setImgVisible({ visible: false }),
        }}
      />
    </Modal>
 
  )
}
 
export default ResponseDetail;