Commit 053e340a by zhaochengxiang

pg采集增加一项 资产详情增加路径

parent 38d7ef3f
......@@ -7,7 +7,7 @@ import { dispatch } from '../../../../model';
const AssetDetail = (props)=>{
const { id, terms } = props;
const { id, dirId, terms } = props;
const [ asset, setAsset ] = useState('');
const [ types, setTypes ] = useState([]);
const [ loading, setLoading ] = useState(false);
......@@ -25,7 +25,8 @@ const AssetDetail = (props)=>{
dispatch({
type: 'assetmanage.getDataAssetDetail',
payload: {
dataAssetId: id
dataAssetId: id,
dirId: dirId||''
},
callback: data => {
setLoading(false);
......@@ -48,6 +49,12 @@ const AssetDetail = (props)=>{
return(
<Spin spinning={loading}>
<Descriptions column={2}>
<Descriptions.Item label='路径'>
{asset.currentPath||''}
</Descriptions.Item>
</Descriptions>
<Divider style={{ margin: '10px 0' }} />
{
(types||[]).map((type, index) => {
......
......@@ -6,13 +6,16 @@ import { getQueryParam } from '../../../../util';
import './AssetDetailPage.less';
const AssetDetailPage = (props)=>{
const [ id, setId ] = useState('');
const [ data, setData ] = useState({ id: '', dirId: '' });
const { id, dirId } = data;
useEffect(() => {
const _id = getQueryParam('id', props.location.search);
setId(_id);
const _dirId = getQueryParam('dirId', props.location.search);
setData({ id: _id, dirId: _dirId });
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
......@@ -24,7 +27,7 @@ const AssetDetailPage = (props)=>{
</div>
<div className='detail-container'>
<div className='detail-container-card'>
<AssetDetail id={id} />
<AssetDetail id={id} dirId={dirId} />
</div>
</div>
</div>
......
......@@ -418,7 +418,7 @@ const AssetTable = (props) => {
const detailAsset = (item)=>{
setCurrentAssetId(item.id);
window.open(`/center-home/asset-detail?id=${item.id}`);
window.open(`/center-home/asset-detail?id=${item.id}&dirId=${nodeId}`);
}
const deleteAssets = () => {
......
......@@ -291,7 +291,14 @@ const UpdateDatasourceModal = (props) => {
key={index}
rules={[{ required: item.required, message: '必填项'}]}
>
{ ( item.show ? <Input placeholder={item.explain||''} /> : <Input.Password placeholder={item.explain||''} visibilityToggle={false} /> ) }
{
(item.selectMode==='singleSelect') ? <Select >
{
(item.selectItem||[]).map((item,index) => {
return <Select.Option key={index} value={item||''} >{item||''}</Select.Option>
})
}
</Select> : ( item.show ? <Input placeholder={item.explain||''} /> : <Input.Password placeholder={item.explain||''} visibilityToggle={false} /> ) }
</Form.Item>
)
})
......
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