Commit 3414372b by zhaochengxiang

关联标准

parent c9aa0814
......@@ -11,6 +11,7 @@ import { AppContext } from '../../../../App';
import Tag from '../../Tag';
import Separate from './Separate';
import AssetTagModal from './AssetTagModal';
import StandardName from './StandardName';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
......@@ -478,8 +479,14 @@ const AssetAction = (props) => {
(sameAttributeElements||[]).map((item, index) => {
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 }}>
{
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>
);
......
......@@ -4,6 +4,7 @@ import { Spin, Descriptions, Divider } from "antd";
import MetadataInfo from './MetadataInfo';
import { highlightSearchContentByTerms } from '../../../../util';
import { dispatch } from '../../../../model';
import StandardName from './StandardName';
const AssetDetail = (props)=>{
......@@ -76,8 +77,14 @@ const AssetDetail = (props)=>{
(_currentValues||[]).map((item, index) => {
return (
<Descriptions.Item label={item.name||''} key={index}>
{
item.name==='资产项' ? <MetadataInfo config={false} value={item.value||''} /> : <span>{highlightSearchContentByTerms(item.value||'', terms)}</span>
{
item.name==='资产项' && <MetadataInfo config={false} value={item.value||''} terms={terms} />
}
{
item.name==='关联标准' && <StandardName value={item.value||''} terms={terms} />
}
{
item.name!=='资产项' && item.name!=='关联标准' && <span className='text-color'>{highlightSearchContentByTerms(item.value||'', terms)}</span>
}
</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;
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