Commit c1c5612f by zhaochengxiang

模型索引高亮

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