Commit 4925ac78 by zhaochengxiang

标记

parent 2e7a2c4d
......@@ -597,6 +597,7 @@ const ModelTable = (props) => {
rowExpandable={(row) => {
return row?.alreadyCheckedOut;
}}
anchorId={anchorId}
contextMenu={{
menu: onMenuRender
}}
......
......@@ -114,6 +114,10 @@
}
.anchor {
background-color: #e7f7ff;
}
.loadMoreRowsClassname {
inline-size: 180px;
padding-block: 8px;
......
......@@ -48,6 +48,7 @@ interface Props<Row> {
onSelectedRowsChange?: (selectedRows: Array<any>) => void
rowHeight?: number
expandedRowHeight?: number
anchorId?: string
}
const CheckboxFormatter = forwardRef<HTMLInputElement, CheckboxFormatterProps>(
......@@ -116,7 +117,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
getComparator,
loadMoreRows,
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 => {
return row.id as K;
......@@ -166,6 +167,8 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
setCheckAll(false)
}
console.log('new rows', newRows);
(newRows||[]).forEach((item, index) => {
item.index = `${index+1}`;
})
......@@ -234,15 +237,16 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
rowRenderer: (props) => {
return (
contextMenu ? <ContextMenuTrigger
id={contextMenuId}
id={contextMenuId}
collect={() => ({ rowIdx: props?.rowIdx })}
disable={props.row.__type__===RowType.Detail}
>
<GridRow
className={(props.row.id===anchorId)?'anchor': ''}
id={`row-${props.row.id}`}
onContextMenu={(e: React.MouseEvent) => {
setContextItem(props.row);
}}
}}
{...props}
/>
</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