Commit 4925ac78 by zhaochengxiang

标记

parent 2e7a2c4d
...@@ -597,6 +597,7 @@ const ModelTable = (props) => { ...@@ -597,6 +597,7 @@ const ModelTable = (props) => {
rowExpandable={(row) => { rowExpandable={(row) => {
return row?.alreadyCheckedOut; return row?.alreadyCheckedOut;
}} }}
anchorId={anchorId}
contextMenu={{ contextMenu={{
menu: onMenuRender menu: onMenuRender
}} }}
......
...@@ -114,6 +114,10 @@ ...@@ -114,6 +114,10 @@
} }
.anchor {
background-color: #e7f7ff;
}
.loadMoreRowsClassname { .loadMoreRowsClassname {
inline-size: 180px; inline-size: 180px;
padding-block: 8px; padding-block: 8px;
......
...@@ -48,6 +48,7 @@ interface Props<Row> { ...@@ -48,6 +48,7 @@ interface Props<Row> {
onSelectedRowsChange?: (selectedRows: Array<any>) => void onSelectedRowsChange?: (selectedRows: Array<any>) => void
rowHeight?: number rowHeight?: number
expandedRowHeight?: number expandedRowHeight?: number
anchorId?: string
} }
const CheckboxFormatter = forwardRef<HTMLInputElement, CheckboxFormatterProps>( const CheckboxFormatter = forwardRef<HTMLInputElement, CheckboxFormatterProps>(
...@@ -116,7 +117,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat ...@@ -116,7 +117,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
getComparator, getComparator,
loadMoreRows, loadMoreRows,
onSelectedRowsChange, onSelectedRowsChange,
contextMenu, columns, rows, checkable, selectedRows, rowHeight = 45, expandedRowHeight = 1000, ...rest } = props contextMenu, columns, rows, checkable, selectedRows, rowHeight = 45, expandedRowHeight = 1000, anchorId, ...rest } = props
const rowKeyGetter = (row: Row): K => { const rowKeyGetter = (row: Row): K => {
return row.id as K; return row.id as K;
...@@ -166,6 +167,8 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat ...@@ -166,6 +167,8 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
setCheckAll(false) setCheckAll(false)
} }
console.log('new rows', newRows);
(newRows||[]).forEach((item, index) => { (newRows||[]).forEach((item, index) => {
item.index = `${index+1}`; item.index = `${index+1}`;
}) })
...@@ -234,15 +237,16 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat ...@@ -234,15 +237,16 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
rowRenderer: (props) => { rowRenderer: (props) => {
return ( return (
contextMenu ? <ContextMenuTrigger contextMenu ? <ContextMenuTrigger
id={contextMenuId} id={contextMenuId}
collect={() => ({ rowIdx: props?.rowIdx })} collect={() => ({ rowIdx: props?.rowIdx })}
disable={props.row.__type__===RowType.Detail} disable={props.row.__type__===RowType.Detail}
> >
<GridRow <GridRow
className={(props.row.id===anchorId)?'anchor': ''}
id={`row-${props.row.id}`} id={`row-${props.row.id}`}
onContextMenu={(e: React.MouseEvent) => { onContextMenu={(e: React.MouseEvent) => {
setContextItem(props.row); setContextItem(props.row);
}} }}
{...props} {...props}
/> />
</ContextMenuTrigger> : <React.Fragment></React.Fragment> </ContextMenuTrigger> : <React.Fragment></React.Fragment>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment