Commit 41a38336 by zhaochengxiang

资产数据源系统

parent 6337d61d
......@@ -137,7 +137,10 @@ export class App extends React.Component {
setGlobalState,
onGlobalStateChange
}}>
<DataService isOnlyEnding={message==='showDataServiceManage'} />
<DataService
isOnlyEnding={message==='showDataServiceManage'}
{...this.props}
/>
</AppContext.Provider>
);
}
......
......@@ -255,5 +255,9 @@ export function* subs(payload) {
}
export function* startFlow(payload) {
return yield call(service.startFlow, payload)
return yield call(service.startFlow, payload);
}
export function* getSystems(payload) {
return yield call(service.getSystems, payload);
}
\ No newline at end of file
......@@ -262,4 +262,8 @@ export function subs(payload) {
export function startFlow(payload) {
return Post("/dataassetmanager/flowApi/startDataAssetFlow", payload);
}
export function getSystems(payload) {
return GetJSON(`/authservice/domains/${payload.env}/systems`);
}
\ No newline at end of file
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState, useContext } from 'react';
import { Form, Spin, Input, Descriptions, Space, Button, Tooltip, Select } from 'antd';
import { DownOutlined, UpOutlined } from '@ant-design/icons';
......@@ -29,9 +29,14 @@ const AssetAction = (props) => {
const { assets, attributes, attributesFoldMap } = assetParams;
const [ assetTagModalVisible, setAssetTagModalVisible ] = useState(false);
const [ selectTag, setSelectTag ] = useState({});
const [ systems, setSystems] = useState([]);
const [ loadingSystems, setLoadingSystems ] = useState(false);
const app = useContext(AppContext);
useEffect(() => {
if (action === 'add') {
getSystems();
getElements();
} else {
setCurrentAction('detail');
......@@ -66,6 +71,23 @@ const AssetAction = (props) => {
});
}
const getSystems = () => {
setLoadingSystems(true);
dispatch({
type: 'assetmanage.getSystems',
payload: {
env: app?.env?.domainId,
},
callback: data => {
setLoadingSystems(false);
setSystems(data||[])
},
error: () => {
setLoadingSystems(false);
}
});
}
const getResourceRelations = () => {
dispatch({
type: 'assetmanage.getResourceRelations',
......@@ -376,7 +398,25 @@ const AssetAction = (props) => {
};
const elementComponent = (element) => {
if (element.name==='资产项') return <MetadataInfo />
if (element.name==='资产项') return <MetadataInfo />;
if (element.name === '数据源系统') {
return (
<Select
allowClear
loading={loadingSystems}
disabled={element.manualMaintain==='否'}
>
{
systems?.map((system, index) => {
return <Select.Option key={index} value={system.scopeName}>
{system.scopeName}
</Select.Option>
})
}
</Select>
)
}
if (element.selectMode==='单选') {
return (
......
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