Commit 22ab8517 by zhaochengxiang

业务对象

parent fc0bfcb1
import React, { useEffect, useState, useContext, useMemo } from 'react'; import React, { useEffect, useState, useContext, useMemo } from 'react';
import { Form, Spin, Input, Descriptions, Space, Button, Tooltip, Select } from 'antd'; import { Form, Spin, Input, Descriptions, Space, Button, Tooltip, Select, Cascader } from 'antd';
import { DownOutlined, UpOutlined } from '@ant-design/icons'; import { DownOutlined, UpOutlined } from '@ant-design/icons';
import MetadataInfo from './MetadataInfo'; import MetadataInfo from './MetadataInfo';
...@@ -40,6 +40,7 @@ const AssetAction = (props) => { ...@@ -40,6 +40,7 @@ const AssetAction = (props) => {
const [ loadingDepartments, setLoadingDepartments ] = useState(false); const [ loadingDepartments, setLoadingDepartments ] = useState(false);
const [ treeData, setTreeData ] = useState([]); const [ treeData, setTreeData ] = useState([]);
const [ treeDataMap, setTreeDataMap ] = useState(undefined); const [ treeDataMap, setTreeDataMap ] = useState(undefined);
const [ businessData, setBusinessData ] = useState(undefined);
const [currentDomainGroup, setCurrentDomainGroup] = useState(undefined); const [currentDomainGroup, setCurrentDomainGroup] = useState(undefined);
const [canEdit, setEdit] = useState(false); const [canEdit, setEdit] = useState(false);
...@@ -131,6 +132,31 @@ const AssetAction = (props) => { ...@@ -131,6 +132,31 @@ const AssetAction = (props) => {
newTreeDataMap[item.text] = item.children; newTreeDataMap[item.text] = item.children;
}) })
setTreeDataMap(newTreeDataMap); setTreeDataMap(newTreeDataMap);
let newBusinessData = [];
data?.forEach(level1Item => {
level1Item.children?.forEach(level2Item => {
const businessItem = {
label: level2Item.text,
value: level2Item.text,
children: []
};
level2Item.children?.forEach(level3Item => {
businessItem.children.push({
label: level3Item.text,
value: level3Item.text,
})
})
if (businessItem.children.length !== 0) {
newBusinessData.push(businessItem);
}
});
});
setBusinessData(newBusinessData);
} }
}) })
} }
...@@ -547,6 +573,17 @@ const AssetAction = (props) => { ...@@ -547,6 +573,17 @@ const AssetAction = (props) => {
) )
} }
if (element.name === '业务对象') {
return (
<Cascader
allowClear
disabled={element.manualMaintain==='否'}
options={businessData}
placeholder='请选择业务对象'
/>
)
}
if (element.selectMode==='单选') { if (element.selectMode==='单选') {
return ( return (
<Select <Select
......
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