Commit 053e340a by zhaochengxiang

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

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