Commit 74a7ba70 by zhaochengxiang

模型预览增加字段

parent 48c01c00
......@@ -179,7 +179,7 @@ tr.drop-over-upward td {
}
.tooltip-common {
max-width: 600px;
max-width: 800px;
color: #000 !important;
.yy-popover-inner-content {
......
......@@ -92,7 +92,14 @@ const FC = (props) => {
sorter: true,
render: (text, record) => {
return (
<Tooltip title={text||''}>
<Tooltip
title={
<div style={{ maxWidth: 400, maxHeight: 300, overflow: 'auto' }}>
{text}
</div>
}
overlayClassName='tooltip-common'
>
<Typography.Text ellipsis={true}>{text||''}</Typography.Text>
</Tooltip>
);
......
......@@ -44,11 +44,51 @@ const ModelNameColumn = (props) => {
editable: true,
ellipsis: true,
},
{
title: '类型',
width: 150,
dataIndex: 'datatype',
editable: true,
ellipsis: true,
require: true,
render: (_, record, __) => {
if (record?.datatype) {
if ((record?.datatype?.name==='Char'||record?.datatype?.name==='Varchar') && record?.datatype?.parameterValues?.length>0) {
return `${record?.datatype?.name||''}(${(record?.datatype?.parameterValues[0]?record.datatype.parameterValues[0]:0)})`;
} else if ((record?.datatype?.name==='Decimal'||record?.datatype?.name==='Numeric') && record?.datatype?.parameterValues?.length>1) {
return `${record?.datatype?.name||''}(${(record?.datatype?.parameterValues[0]?record.datatype.parameterValues[0]:0)},${(record?.datatype?.parameterValues[1]?record.datatype.parameterValues[1]:0)})`;
}
return record.datatype.name||'';
}
return '';
}
},
{
title: '是否允许为空',
width: 100,
dataIndex: 'nullable',
editable: true,
ellipsis: true,
render: (nullable) => nullable?'YES':'NO'
},
{
title: '是否为主键',
width: 100,
dataIndex: 'primaryKey',
editable: true,
ellipsis: true,
render: (primaryKey) => primaryKey?'YES':'NO'
}
];
let _textComponent = <span style={{ color: '#000' }}>{text}</span>;
if (data.digest) {
_textComponent = <div style={{ width: 500, maxHeight: 300, overflow: 'auto' }}>
_textComponent = <div style={{ maxHeight: 300, overflow: 'auto' }}>
<Table
rowKey='name'
dataSource={data.digest.attributeDigests||[]}
......@@ -250,7 +290,11 @@ const ModelTable = (props) => {
useEffect(() => {
if (data && gridRef.current) {
setTimeout(() => {
gridRef.current?.scrollToRow(0);
try {
gridRef.current?.scrollToRow(0);
} catch(ex) {
}
}, 100)
}
}, [data])
......@@ -288,7 +332,11 @@ const ModelTable = (props) => {
if (shouldScrollRef.current && gridRef.current && offset!==null && (data||[]).length>0) {
setScrollRowIndex(offset);
setTimeout(() => {
gridRef.current?.scrollToRow((offset-1)%defaultPageSize);
try {
gridRef.current?.scrollToRow((offset-1)%defaultPageSize);
} catch(ex) {
}
shouldScrollRef.current = false;
}, 300)
}
......
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