Commit 4baaf79a by zhaochengxiang

可拖动列宽问题

parent 2ff10eeb
......@@ -650,7 +650,7 @@ const ImportActionIndex = (props) => {
return (
<div className='model-import-action-index'>
<h2>数据表结构</h2>
<h2>数据表索引</h2>
<div className='d-flex mb-3' style={{ justifyContent: editable?'space-between':'flex-end' }}>
{
editable && <Tooltip title={addTip}>
......
......@@ -80,8 +80,6 @@ const ModelNameColumn = (props) => {
const ResizeableHeaderCell = props => {
const { onResize, width, onClick, ...restProps } = props;
const [ resizing, setResizing ] = useState(false);
if (!width) {
return <th {...restProps} />;
}
......@@ -90,23 +88,21 @@ const ResizeableHeaderCell = props => {
<Resizable
width={width}
height={0}
onResize={(event, {element, size, handle}) => {
setResizing(true);
onResize && onResize(event, { size });
}}
handle={
<span
className="react-resizable-handle"
onClick={(e) => {
e.stopPropagation();
}}
/>
}
onResize={onResize}
draggableOpts={{ enableUserSelectHack: false }}
>
<th
onClick={(...args) => {
//解决可伸缩列与排序器冲突
if (!resizing && onClick) {
onClick(...args);
}
setResizing(false);
}}
onClick={onClick}
{...restProps}
/>
</Resizable>
);
};
......@@ -220,6 +216,7 @@ const ModelTable = (props) => {
ellipsis: true,
sorter: true,
sortDirections: ['ascend', 'descend'],
width: 200,
render: (text, _, __) => {
return (
<Tooltip title={text||''}>
......@@ -654,6 +651,9 @@ const ModelTable = (props) => {
onChange={onTableChange}
expandable={expandable}
sticky={!modelId}
scroll={{
x: 'max-content'
}}
/>
{
!modelId && (data||[]).length>0 && <Pagination
......
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