Commit ee798b20 by zhaochengxiang

资产关联标准

parent 022c92d0
...@@ -10,6 +10,7 @@ import Tag from '../../Tag'; ...@@ -10,6 +10,7 @@ import Tag from '../../Tag';
import Separate from './Separate'; import Separate from './Separate';
import AssetTagModal from './AssetTagModal'; import AssetTagModal from './AssetTagModal';
import { AnchorId, AnchorDirId } from '../../../../util/constant'; import { AnchorId, AnchorDirId } from '../../../../util/constant';
import StandardName from './StandardName';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg'; import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
...@@ -620,8 +621,14 @@ const AssetAction = (props) => { ...@@ -620,8 +621,14 @@ const AssetAction = (props) => {
(sameAttributeElements||[]).map((item, index) => { (sameAttributeElements||[]).map((item, index) => {
return ( return (
<Descriptions.Item label={<div className='title-common' style={{ textAlign: 'right', width: 60 }}>{item.name||''}</div>} key={index} style={{ paddingBottom: (index===sameAttributeElements.length-1)? 0 : 10 }}> <Descriptions.Item label={<div className='title-common' style={{ textAlign: 'right', width: 60 }}>{item.name||''}</div>} key={index} style={{ paddingBottom: (index===sameAttributeElements.length-1)? 0 : 10 }}>
{
item.name==='资产项' && <MetadataInfo config={false} value={item.value||''} terms={terms} />
}
{
item.name==='关联标准' && <StandardName value={item.value||''} terms={terms} />
}
{ {
item.name==='资产项' ? <MetadataInfo config={false} value={item.value||''} /> : <span className='text-color'>{highlightSearchContentByTerms(item.value||'', terms)}</span> item.name!=='资产项' && item.name!=='关联标准' && <span className='text-color'>{highlightSearchContentByTerms(item.value||'', terms)}</span>
} }
</Descriptions.Item> </Descriptions.Item>
); );
......
...@@ -4,6 +4,7 @@ import { Spin, Descriptions, Divider } from "antd"; ...@@ -4,6 +4,7 @@ import { Spin, Descriptions, Divider } from "antd";
import MetadataInfo from './MetadataInfo'; import MetadataInfo from './MetadataInfo';
import { highlightSearchContentByTerms } from '../../../../util'; import { highlightSearchContentByTerms } from '../../../../util';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import StandardName from './StandardName';
const AssetDetail = (props)=>{ const AssetDetail = (props)=>{
...@@ -99,8 +100,14 @@ const AssetDetail = (props)=>{ ...@@ -99,8 +100,14 @@ const AssetDetail = (props)=>{
(_currentValues||[]).map((item, index) => { (_currentValues||[]).map((item, index) => {
return ( return (
<Descriptions.Item label={item.name||''} key={index}> <Descriptions.Item label={item.name||''} key={index}>
{
item.name==='资产项' && <MetadataInfo config={false} value={item.value||''} terms={terms} />
}
{
item.name==='关联标准' && <StandardName value={item.value||''} terms={terms} />
}
{ {
item.name==='资产项' ? <MetadataInfo config={false} value={item.value||''} terms={terms} /> : <span>{highlightSearchContentByTerms(item.value||'', terms)}</span> item.name!=='资产项' && item.name!=='关联标准' && <span className='text-color'>{highlightSearchContentByTerms(item.value||'', terms)}</span>
} }
</Descriptions.Item> </Descriptions.Item>
); );
......
import React from 'react';
import { highlightSearchContentByTerms } from '../../../../util';
import { AppContext } from '../../../../App';
const FC = ({ value = '', terms = [] }) => {
return (
<AppContext.Consumer>
{
appValue => <a onClick={() => {
appValue?.setGlobalState && appValue?.setGlobalState({
message: 'data-govern-show-standard-detail-message',
data: { name: value }
})
}}>
<span>{highlightSearchContentByTerms(value, terms)}</span>
</a>
}
</AppContext.Consumer>
);
}
export default FC;
\ No newline at end of file
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