!2382 看图王板件显示备注ui修改

pull/2373/MERGE
j787701730 1 year ago committed by ChenX
parent e5fb0e806d
commit 646ca54aed

@ -31,8 +31,10 @@ const BoardMessageWidget = (() =>
{ {
e.stopPropagation(); e.stopPropagation();
}} }}
style={{ pointerEvents: 'auto', cursor: 'default' }} style={{ pointerEvents: 'auto', cursor: 'default', display: 'flex', alignItems: 'center' }}
><BoardRemarksWidget >
<span></span>
<BoardRemarksWidget
name={shareViewStore.SelectedBoard.Name} name={shareViewStore.SelectedBoard.Name}
remarks={shareViewStore.SelectedBoard.BoardProcessOption.remarks} remarks={shareViewStore.SelectedBoard.BoardProcessOption.remarks}
isPhone isPhone

@ -12,45 +12,28 @@ 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 ? (
<span <span
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); setOpen(true);
e.stopPropagation(); 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>

@ -202,11 +202,11 @@ const MaterialBottomSheet: React.FC<IProps> = forwardRef((props, ref) =>
<tr> <tr>
<th style={{ width: 44 }}></th> <th style={{ width: 44 }}></th>
<th></th> <th></th>
<th className="st-td-number" style={{ width: isPhone ? 'auto' : 120 }}></th> <th className="st-td-number" ></th>
<th className="st-td-number" style={{ width: isPhone ? 'auto' : 120 }}></th> <th className="st-td-number" ></th>
<th style={{ width: 50 }} className="st-td-number"></th> <th style={{ width: 50 }} className="st-td-number"></th>
<th style={{ width: isPhone ? 'auto' : 120 }}></th> <th></th>
<th style={{ width: isPhone ? 44 : 'auto' }}></th> <th style={{ width: 44 }}></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -238,7 +238,7 @@ const MaterialBottomSheet: React.FC<IProps> = forwardRef((props, ref) =>
<td className="st-td-number">{size.width}</td> <td className="st-td-number">{size.width}</td>
<td className="st-td-number">{size.thickness}</td> <td className="st-td-number">{size.thickness}</td>
<td>{item.BoardProcessOption.color}</td> <td>{item.BoardProcessOption.color}</td>
<td style={{ textAlign: isPhone ? "center" : 'left' }}> <td style={{ textAlign: "center", padding: 0 }}>
<BoardRemarksWidget <BoardRemarksWidget
remarks={item.BoardProcessOption.remarks} remarks={item.BoardProcessOption.remarks}
name={item.Name} name={item.Name}

Loading…
Cancel
Save