|
|
@ -12,21 +12,6 @@ const BoardRemarksWidget: FC<IProps> = (props) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
function remarksToString(): string
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let str = '{';
|
|
|
|
|
|
|
|
props.remarks.forEach((item, i) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
str += `"${item[0]}": "${item[1]}"`;
|
|
|
|
|
|
|
|
if (i != props.remarks.length - 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
str += ', ';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
str += '}';
|
|
|
|
|
|
|
|
return str;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
{Array.isArray(props.remarks) && props.remarks.length ? (
|
|
|
|
{Array.isArray(props.remarks) && props.remarks.length ? (
|
|
|
@ -34,23 +19,21 @@ const BoardRemarksWidget: FC<IProps> = (props) =>
|
|
|
|
style={{ cursor: 'pointer' }}
|
|
|
|
style={{ cursor: 'pointer' }}
|
|
|
|
onClick={(e) =>
|
|
|
|
onClick={(e) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (props.isPhone)
|
|
|
|
e.stopPropagation();
|
|
|
|
{
|
|
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span style={{ wordBreak: "break-all" }}
|
|
|
|
<span style={{
|
|
|
|
|
|
|
|
wordBreak: "break-all", display: 'inline-flex', width: 24, height: 24,
|
|
|
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
|
|
|
alignItems: 'center'
|
|
|
|
|
|
|
|
}}
|
|
|
|
onClick={(e) =>
|
|
|
|
onClick={(e) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (props.isPhone && props.remarks.length)
|
|
|
|
setOpen(true);
|
|
|
|
{
|
|
|
|
e.stopPropagation();
|
|
|
|
setOpen(true);
|
|
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{props.isPhone ? <Icon icon='comment' color='#1890ff' /> : remarksToString()}
|
|
|
|
<Icon icon='comment' color='#1890ff' />
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<Dialog
|
|
|
|
<Dialog
|
|
|
|
isOpen={open} onClose={() =>
|
|
|
|
isOpen={open} onClose={() =>
|
|
|
@ -58,10 +41,28 @@ const BoardRemarksWidget: FC<IProps> = (props) =>
|
|
|
|
setOpen(false);
|
|
|
|
setOpen(false);
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
title={`${props.name || "板件"} 备注`}
|
|
|
|
title={`${props.name || "板件"} 备注`}
|
|
|
|
style={{ width: window.innerWidth <= 768 ? '80vw' : '600px', background: '#fff', paddingBottom: 16 }}
|
|
|
|
style={{ width: window.innerWidth <= 768 ? '90vw' : '600px', background: '#fff', paddingBottom: 16 }}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div style={{ padding: 16, paddingBottom: 0, background: '#fff', wordBreak: 'break-all', fontSize: 14 }}>
|
|
|
|
<div style={{
|
|
|
|
{remarksToString()}
|
|
|
|
padding: 16, paddingBottom: 2, background: '#fff', fontSize: 14,
|
|
|
|
|
|
|
|
maxHeight: '80vh', overflow: 'auto'
|
|
|
|
|
|
|
|
}}>
|
|
|
|
|
|
|
|
<table className='sp-table'>
|
|
|
|
|
|
|
|
<thead>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<th style={{ width: '30%' }}>备注名</th>
|
|
|
|
|
|
|
|
<th>备注信息</th>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
{props.remarks.map((remark) => (
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<td>{remark[0]}</td>
|
|
|
|
|
|
|
|
<td>{remark[1]}</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Dialog>
|
|
|
|
</Dialog>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|