Commit 16c612fb by zhaochengxiang

模型增加路径

parent 59012d1e
...@@ -156,6 +156,19 @@ const ExpandedModelTable = (props) => { ...@@ -156,6 +156,19 @@ const ExpandedModelTable = (props) => {
} }
}, },
{ {
title: '路径',
dataIndex: 'path',
width: 120,
ellipsis: true,
render: (text, _, __) => {
return (
<Tooltip title={text||''}>
<Text ellipsis={true}>{text||''}</Text>
</Tooltip>
)
}
},
{
title: '状态', title: '状态',
dataIndex: 'state', dataIndex: 'state',
width: 100, width: 100,
...@@ -226,20 +239,6 @@ const ExpandedModelTable = (props) => { ...@@ -226,20 +239,6 @@ const ExpandedModelTable = (props) => {
}, },
]; ];
const pathColumn = {
title: '路径',
dataIndex: 'path',
width: 120,
ellipsis: true,
render: (text, _, __) => {
return (
<Tooltip title={text||''}>
<Text ellipsis={true}>{text||''}</Text>
</Tooltip>
)
}
};
useEffect(() => { useEffect(() => {
setSelectedRowKeys(checked?[id]:[]); setSelectedRowKeys(checked?[id]:[]);
if (dataMap.has(id)) { if (dataMap.has(id)) {
...@@ -253,9 +252,6 @@ const ExpandedModelTable = (props) => { ...@@ -253,9 +252,6 @@ const ExpandedModelTable = (props) => {
useEffect(() => { useEffect(() => {
if (tableWidth>0 && columns.length===0) { if (tableWidth>0 && columns.length===0) {
let newColumns = [...cols]; let newColumns = [...cols];
if (view==='state' || (keyword||'')!=='') {
newColumns.splice(3, 0, pathColumn);
}
newColumns.forEach((column, index) => { newColumns.forEach((column, index) => {
if (!column.width) { if (!column.width) {
......
...@@ -147,6 +147,20 @@ const ModelTable = (props) => { ...@@ -147,6 +147,20 @@ const ModelTable = (props) => {
} }
}, },
{ {
name: '路径',
key: 'path',
width: 120,
sortable: true,
resizable: true,
formatter(props) {
return (
<Tooltip title={props.row.path||''}>
<Text ellipsis={true}>{props.row.path||''}</Text>
</Tooltip>
)
}
},
{
name: '状态', name: '状态',
key: 'state', key: 'state',
width: 100, width: 100,
...@@ -202,30 +216,6 @@ const ModelTable = (props) => { ...@@ -202,30 +216,6 @@ const ModelTable = (props) => {
}, },
]; ];
const pathColumn = {
name: '路径',
key: 'path',
width: 120,
sortable: true,
resizable: true,
formatter(props) {
return (
<Tooltip title={props.row.path||''}>
<Text ellipsis={true}>{props.row.path||''}</Text>
</Tooltip>
)
}
};
const columns = useMemo(() => {
const newColumns = [...cols];
if (view==='state' || (keyword||'')!=='') {
newColumns.splice(3, 0, pathColumn);
}
return newColumns;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [view, keyword]);
const summarySelectedCount = useMemo(() => { const summarySelectedCount = useMemo(() => {
let newSelectedRowKeys = Array.from(new Set([...selectedRowKeys, ...expandedSelectedRowKeys])); let newSelectedRowKeys = Array.from(new Set([...selectedRowKeys, ...expandedSelectedRowKeys]));
...@@ -491,7 +481,7 @@ const ModelTable = (props) => { ...@@ -491,7 +481,7 @@ const ModelTable = (props) => {
gridRef={gridRef} gridRef={gridRef}
style={{ blockSize: 'calc(100vh - 94px - 37px - 57px - 24px - 32px)' }} style={{ blockSize: 'calc(100vh - 94px - 37px - 57px - 24px - 32px)' }}
checkable checkable
columns={columns} columns={cols}
rows={data||[]} rows={data||[]}
rowHeight={51} rowHeight={51}
rowClassName={(row) => { rowClassName={(row) => {
......
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