Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Oct 10, 2023
1 parent 40c4b27 commit 436b508
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/page/Workspace/components/CreateTable/TableIndex/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ import {
} from '../interface';
import { WrapReverseCheckboxFormatetr } from '../RdgFomatter/CheckboxFormatter';
import WrapValueFormatter from '../RdgFomatter/ValueFormatter';
import { ExclamationCircleFilled } from '@ant-design/icons';
import { Tooltip } from 'antd';

function NameFormatter({ row }) {
if (row.available !== false) {
return (
<span>
<Tooltip title="索引不可用">
<ExclamationCircleFilled style={{ color: 'var(--icon-orange-color)' }} />
</Tooltip>
{row.name}
</span>
);
}
return row.name || '';
}

export function useColumns(
columns: TableColumn[],
Expand Down Expand Up @@ -89,6 +105,7 @@ export function useColumns(
}), //名称
resizable: true,
editable: true,
formatter: NameFormatter,
editor: TextEditor,
},

Expand Down

0 comments on commit 436b508

Please sign in to comment.