import React, { useState, useRef, useEffect } from 'react';
|
import * as $$ from '@/utils/utility';
|
import { Form, Input, Tabs, Typography, Empty, Radio, Button, Modal } from '@arco-design/web-react';
|
import { register, fold, down, empty, link, edit } from '@/assets/images';
|
|
export default function HandleRecord(props) {
|
const [formView, setFormView] = useState(false);
|
const [list, setList] = useState([]);
|
|
useEffect(() => {
|
setList(props.data)
|
}, [props.data])
|
|
const toggleView = (id) => {
|
setList(list.map(record => {
|
if (record.id === id) {
|
return {
|
...record,
|
showView: !record.showView,
|
};
|
}
|
return record;
|
}));
|
};
|
|
const handleEdit = (id) => {
|
props.handleEdit(id)
|
}
|
|
return (
|
<div>
|
{list?.length > 0 ?
|
<div>
|
{list?.map(record => (
|
<div key={record.id} className='container-bottom-left-record'>
|
<div className='container-bottom-left-record-top'>
|
{
|
record.showView ? (
|
<img src={down} alt='' style={{ width: '18px', marginRight: '6px' }} onClick={() => toggleView(record.id)} />
|
) : (
|
<img src={fold} alt='' className='container-bottom-left-record-top-icon' onClick={() => toggleView(record.id)} />
|
)
|
}
|
<div>{`${record.createTime} ${record.handleUnitName}`}</div>
|
<div className={`container-bottom-left-record-top-${record.handleType === '2' ? 'remark' : 'hostOrg'}`}>{record.handleType === '2' ? '配合部门' : '承办部门'}</div>
|
<div><img src={edit} alt='' className='container-bottom-left-record-top-edit' onClick={() => handleEdit(record)} /></div>
|
</div>
|
<div className='container-bottom-left-record-bottom' style={{ display: record.showView ? 'block' : 'none' }}>
|
<table border="1" cellpadding="8" className='container-bottom-left-record-bottom-table'>
|
<tr>
|
<th bgcolor="#F7F8FA" className="table-title" width="120">操作人</th>
|
<td>{record.handleUnitName}</td>
|
</tr>
|
<tr>
|
<th bgcolor="#F7F8FA" className="table-title" width="120">办理意见</th>
|
<td>{record.handleContent}</td>
|
</tr>
|
<tr>
|
<th bgcolor="#F7F8FA" className="table-title" width="120">办理附件</th>
|
<td>{record.handleUnitName}</td>
|
</tr>
|
</table>
|
</div>
|
</div>
|
))}
|
</div>
|
:
|
<Empty
|
icon={
|
<div
|
style={{
|
display: 'flex',
|
justifyContent: 'center',
|
marginBottom: '100px'
|
}}
|
>
|
<img src={empty} alt='' style={{ width: '160px', height: '160px' }} />
|
</div>
|
}
|
description='暂无数据'
|
/>
|
}
|
</div>
|
)
|
}
|