Commit c1c5612f by zhaochengxiang

模型索引高亮

parent bad86e00
......@@ -296,6 +296,7 @@ const ImportActionIndex = (props) => {
dataRef.current = data;
const tableRef = useRef(null);
const termsRef = useRef(null);
const { show } = useContextMenu({
id: MENU_ID,
......@@ -311,6 +312,7 @@ const ImportActionIndex = (props) => {
}, [constraint, template, modelerData])
useEffect(() => {
termsRef.current = terms;
setAttributes(modelerData.easyDataModelerDataModelAttributes||[]);
setData(modelerData.easyDataModelerIndices||[]);
......@@ -329,7 +331,7 @@ const ImportActionIndex = (props) => {
setFilterData(__filterData);
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [modelerData])
}, [modelerData, terms])
useEffect(() => {
if (needFilter) {
......@@ -594,7 +596,7 @@ const ImportActionIndex = (props) => {
render: (text, record, index) => {
return (
<Tooltip title={text||''}>
<span style={{ fontWeight: 'bold' }} >{highlightSearchContentByTerms(text, terms)}</span>
<span style={{ fontWeight: 'bold' }} >{highlightSearchContentByTerms(text, termsRef.current)}</span>
</Tooltip>
)
}
......@@ -635,7 +637,7 @@ const ImportActionIndex = (props) => {
return (
<Row key={index}>
<span>字段: </span>
{ highlightSearchContentByTerms(item.name||'', terms) }
{ highlightSearchContentByTerms(item.name||'', termsRef.current) }
<span>{` 排序: ${order||''}`}</span>
</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