Commit 65b1d92d by zhaochengxiang

增加序号

parent 734c154d
......@@ -54,6 +54,7 @@ const ModelNameColumn = (props) => {
if (data.digest) {
_textComponent = <div style={{ width: 500, maxHeight: 300, overflow: 'auto' }}>
<Table
rowKey='name'
dataSource={data.digest.attributeDigests||[]}
columns={cols}
loading={false}
......@@ -113,12 +114,12 @@ const ModelTable = (props) => {
const [ subData, setSubData ] = useState([]);
const cols = [
// {
// name: '序号',
// key: 'key',
// width: 60,
// sortable: false,
// },
{
name: '序号',
key: 'index',
width: 60,
sortable: false,
},
{
name: '模型名称',
key: 'name',
......
......@@ -22,6 +22,7 @@ export enum RowType {
export interface RowData {
id: string,
index?: string;
__pid__?: string
__row__?: any
__type__?: RowType
......@@ -150,6 +151,11 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
const [sortColumns, setSortColumns] = useState<readonly SortColumn[]>([]); // 排序列图标状态
const [_rows, _setRows] = useState<readonly Row[]>([])
useEffect(() => {
(rows||[]).forEach((item, index) => {
item.index = `${index+1}`;
})
if (sortColumns.length === 0) {
_setRows(rows);
} else {
......
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