Commit 26cb3ccb by zhaochengxiang

bug fix

parent 0ad48f01
...@@ -102,7 +102,7 @@ const MetaModelSelect = ({ value = {}, metaModelTreeData = [], onChange, ...rest ...@@ -102,7 +102,7 @@ const MetaModelSelect = ({ value = {}, metaModelTreeData = [], onChange, ...rest
} }
const AttributeRelationWithSourceModel = (props) => { const AttributeRelationWithSourceModel = (props) => {
const { elements, sourceModel, supportSourceModelsName, metadataModelTreeData, activeKey, onChange } = props; const { elements, sourceModel, metadataModelTreeData, activeKey, onChange } = props;
console.log('sourceModel', sourceModel) console.log('sourceModel', sourceModel)
...@@ -234,21 +234,13 @@ const AttributeRelationWithSourceModel = (props) => { ...@@ -234,21 +234,13 @@ const AttributeRelationWithSourceModel = (props) => {
<Form.Item <Form.Item
label='来源模型名称' label='来源模型名称'
name='sourceModel' name='sourceModel'
rules={[{ required: true, message: '请输入来源名称'}]} rules={[{ required: true, message: '请输入来源模型名称'}]}
> >
<Select <TreeSelect
allowClear
placeholder='请选择来源模型名称' placeholder='请选择来源模型名称'
disabled={sourceModel} treeData={metadataModelTreeData}
> allowClear
{ />
supportSourceModelsName?.map((name, index) => {
return <Select.Option key={index} value={name}>
{ name }
</Select.Option>
})
}
</Select>
</Form.Item> </Form.Item>
{ {
(elements||[]).map((element, index) => { (elements||[]).map((element, index) => {
...@@ -273,7 +265,6 @@ const AttributeRelationWithSourceModel = (props) => { ...@@ -273,7 +265,6 @@ const AttributeRelationWithSourceModel = (props) => {
const AttributeRelationModal = (props) => { const AttributeRelationModal = (props) => {
const { visible, type = AssetManageReference, onCancel } = props; const { visible, type = AssetManageReference, onCancel } = props;
const [ supportSourceModelsName, setSupportSourceModelsName ] = useState()
const [ loadingSourceModels, setLoadingSourceModels] = useState(false) const [ loadingSourceModels, setLoadingSourceModels] = useState(false)
const [ sourceModels, setSourceModels ] = useState() const [ sourceModels, setSourceModels ] = useState()
const [ metadataModelTreeData, setMetadataModelTreeData ] = useState([]); const [ metadataModelTreeData, setMetadataModelTreeData ] = useState([]);
...@@ -335,7 +326,6 @@ const AttributeRelationModal = (props) => { ...@@ -335,7 +326,6 @@ const AttributeRelationModal = (props) => {
recursion(newData); recursion(newData);
setSupportSourceModelsName((newData||[]).map(item=>item.nodeName));
setMetadataModelTreeData(newData||[]); setMetadataModelTreeData(newData||[]);
} }
}) })
...@@ -390,7 +380,6 @@ const AttributeRelationModal = (props) => { ...@@ -390,7 +380,6 @@ const AttributeRelationModal = (props) => {
return <Tabs.TabPane tab={item} key={item}> return <Tabs.TabPane tab={item} key={item}>
<AttributeRelationWithSourceModel <AttributeRelationWithSourceModel
elements={elements} elements={elements}
supportSourceModelsName={supportSourceModelsName}
metadataModelTreeData={metadataModelTreeData} metadataModelTreeData={metadataModelTreeData}
sourceModel={item === AddSourceModelName ? undefined: item} sourceModel={item === AddSourceModelName ? undefined: item}
activeKey={activeKey} activeKey={activeKey}
......
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