Commit 0e4daab5 by zhaochengxiang

模型高亮

parent 7b7154d0
......@@ -300,6 +300,7 @@ const ImportActionTable = (props) => {
const moveRowRef = useRef({ data, pageNum, pageSize });
const tableRef = useRef(null);
const termsRef = useRef(null);
const { show } = useContextMenu({
id: MENU_ID,
......@@ -328,7 +329,7 @@ const ImportActionTable = (props) => {
return (
<Tooltip title={text||''}>
<span>
{highlightSearchContentByTerms(text, terms)}
{highlightSearchContentByTerms(text, termsRef.current)}
</span>
</Tooltip>
)
......@@ -344,7 +345,7 @@ const ImportActionTable = (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>
)
}
......@@ -452,7 +453,7 @@ const ImportActionTable = (props) => {
return (
<Tooltip title={text||''}>
<span>
{highlightSearchContentByTerms(text, terms)}
{highlightSearchContentByTerms(text, termsRef.current)}
</span>
</Tooltip>
)
......@@ -468,7 +469,7 @@ const ImportActionTable = (props) => {
return (
<Tooltip title={text||''}>
<span>
{highlightSearchContentByTerms(text, terms)}
{highlightSearchContentByTerms(text, termsRef.current)}
</span>
</Tooltip>
)
......@@ -484,7 +485,7 @@ const ImportActionTable = (props) => {
return (
<Tooltip title={text||''}>
<span>
{highlightSearchContentByTerms(text, terms)}
{highlightSearchContentByTerms(text, termsRef.current)}
</span>
</Tooltip>
)
......@@ -500,7 +501,7 @@ const ImportActionTable = (props) => {
return (
<Tooltip title={text||''}>
<span>
{highlightSearchContentByTerms(text, terms)}
{highlightSearchContentByTerms(text, termsRef.current)}
</span>
</Tooltip>
)
......@@ -520,17 +521,17 @@ const ImportActionTable = (props) => {
}, [constraint, template, modelerData])
useEffect(() => {
termsRef.current = terms;
setData(modelerData?.easyDataModelerDataModelAttributes||[]);
setData(modelerData.easyDataModelerDataModelAttributes||[]);
moveRowRef.current.data = (modelerData?.easyDataModelerDataModelAttributes||[]);
moveRowRef.current.data = (modelerData.easyDataModelerDataModelAttributes||[]);
let _filterData = (modelerData.easyDataModelerDataModelAttributes||[]).filter(item => (item?.name||'').indexOf(keyword)!==-1 || (item.cnName).indexOf(keyword)!==-1);
let _filterData = (modelerData?.easyDataModelerDataModelAttributes||[]).filter(item => (item?.name||'').indexOf(keyword)!==-1 || (item.cnName).indexOf(keyword)!==-1);
setFilterPageCondition({...filterPageCondition, filterData: _filterData});
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [modelerData])
}, [modelerData, terms])
useEffect(() => {
if (needFilter) {
......
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