forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-08-31 c41e9c7bd6fedf4e480d4737f94d13a2b9ddf5eb
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
/*
 * @Company: hugeInfo
 * @Author: ldh
 * @Date: 2022-07-22 15:05:34
 * @LastEditTime: 2023-05-08 16:16:22
 * @LastEditors: lwh
 * @Version: 1.0.0
 * @Description: 调解档案
 */
import React, { useState, useEffect } from 'react';
import { Col, Row, Space, Image } from 'antd';
import { appUrl, ax, MyEmpty, dateFormat } from '../../../utils/utility';
import { archives } from '../../../assets/images/icon';
 
// 获取档案信息
function getDataApi(caseId) {
  return ax.request({ url: 'caseInfo/getCaseFilesInfo?caseId=' + caseId, type: 'get', service: 'mediate' });
}
 
const Archives = ({ caseId }) => {
  const [data, setData] = useState({});
 
  useEffect(() => {
    async function getData() {
      global.setSpinning(true);
      const res = await getDataApi(caseId);
      global.setSpinning(false);
      if (res.type) {
        setData(res.data || {});
      }
    }
    getData();
  }, [caseId]);
 
  return !data.fileTime ? (
    <div></div>
  ) : (
    <div className="mediationPower" style={{ position: 'relative' }}>
      <Row gutter={[16, 12]}>
        <Col span={24}>
          <Space size='small'>
            <div className='MediationInfo-subTitle'></div><h5> 档案信息</h5>
          </Space>
        </Col>
        {[
          { key: 'fileNo', label: '档案编号' },
          { key: 'fileYear', label: '年度' },
          { key: 'fileBookNo', label: '卷号' },
          { key: 'fileBookName', label: '卷名' },
          { key: 'fileUserName', label: '归档人' },
          { key: 'fileAddr', label: '档案存档位置' },
          { key: 'fileLimitYear', label: '保管年限' },
          { value: dateFormat(data.fileTime), label: '归档时间' },
          { key: 'fileContent', label: '卷宗情况说明' },
          {
            value: <Image width={100} src={appUrl.fileUrl + appUrl.fileShowUrl + (data.fileInfoList || [])[0]?.id} alt="" />,
            label: '归档封面',
          },
        ].map((x, t) => (
          <Col span={t === 0 ? 24 : 8} key={t}>
            <Space>
              <h5>{x.label}:</h5>
              <div>{x.value || data[x.key] || '-'}</div>
            </Space>
          </Col>
        ))}
      </Row>
      {/* <div style={{ position: 'absolute', right: 16, bottom: 16 }}>
        <img src={archives} alt="" />
      </div> */}
    </div>
  );
};
 
export default Archives;