Commit 1cefe58c by zhaochengxiang

代码编码

parent 41b0f123
......@@ -10,6 +10,7 @@ import Tag from '../../Tag';
import Separate from './Separate';
import AssetTagModal from './AssetTagModal';
import { AnchorId, AnchorDirId } from '../../../../util/constant';
import StandardCode from './StandardCode';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
......@@ -561,8 +562,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==='代码编码' && <StandardCode 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>
);
......
......@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
import { Spin, Descriptions, Divider } from "antd";
import MetadataInfo from './MetadataInfo';
import StandardCode from './StandardCode';
import { highlightSearchContentByTerms } from '../../../../util';
import { dispatch } from '../../../../model';
......@@ -99,8 +100,14 @@ const AssetDetail = (props)=>{
(_currentValues||[]).map((item, index) => {
return (
<Descriptions.Item label={item.name||''} key={index}>
{
item.name==='资产项' && <MetadataInfo config={false} value={item.value||''} terms={terms} />
}
{
item.name==='代码编码' && <StandardCode 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>{highlightSearchContentByTerms(item.value||'', terms)}</span>
}
</Descriptions.Item>
);
......
import React from 'react';
import { Row, Col, Typography } from 'antd';
import MetadataInfo from './MetadataInfo';
import './AssetItem.less';
const AssetItem = (props) => {
const { data } = props;
return (
<div className='asset-item'>
{
(data.elementsGroup||[]).map((elementGroup, index) => {
const _type = elementGroup.type||'';
return (
<div key={index}>
<div className='flex' style={{ alignItems: 'center', padding: '15px 0' }}>
<div style={{ width: 3, height: 14, backgroundColor: '#0069AC', marginRight: 5 }} />
<span style={{ fontWeight: 'bold', color: '#464646' }}>{_type||''}</span>
</div>
<Row>
{
elementGroup && elementGroup.elements && elementGroup.elements.map((element, _index) => {
return (
<Col className='mb-3' key={_index} md={8}>
<Typography.Paragraph title={ `${element.name||''}: ${element.value||''}` } style={{ color: '#464646' }} ellipsis>
{ `${element.name||''}: `}
{ element.name==='资产项'?<MetadataInfo config={false} value={element.value||''} />:`${element.value||''}` }
</Typography.Paragraph>
</Col>
);
})
}
</Row>
<div style={{ width: '100%', height: 2, backgroundColor: '#ededed' }} />
</div>
)
})
}
</div>
);
}
export default AssetItem;
\ No newline at end of file
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