Commit 6d52b027 authored by shaoan123's avatar shaoan123

解决表字段bug

parent c18cb7e7
Pipeline #31314 skipped with stages
......@@ -39,7 +39,7 @@ const TableManager = () => {
const [groupArr, setGroupArr] = useState([])
const [allData, setAllData] = useState([])
const [tableData, setTableData] = useState([])
const [spread, setSpread] = useState([])
useEffect((record) => {
loadTable(searchValue)
getField()
......@@ -183,7 +183,8 @@ const TableManager = () => {
}
return tempObj
}
const expandedRowRender = () => {
const expandedRowRender = (item) => {
console.log('item',item);
const columns1 = [
{
title: '名称',
......@@ -293,7 +294,7 @@ const TableManager = () => {
];
return <Table columns={columns1} dataSource={spread} pagination={false} />;
return <Table columns={columns1} dataSource={allData[item.type]} pagination={false} />;
};
const columns = [
......@@ -305,14 +306,7 @@ const TableManager = () => {
},
];
const openClick = (status, item) => {
if (!status) return
let arr = []
allData[item.type].map((item, index) => {
arr.push({ ...item, key: index })
})
setSpread(arr)
}
return (
<Spin tip="loading..." spinning={treeLoading}>
<PageContainer>
......@@ -359,8 +353,6 @@ const TableManager = () => {
columns={columns}
expandable={{ expandedRowRender }}
dataSource={groupArr}
onExpand={openClick} // 展开时触发的回调
size="small"
style={{ height: '8rem' }}
pagination={{
......
......@@ -210,7 +210,7 @@ const AddModal = props => {
<Input placeholder="请输入方案名" allowClear />
</Item>
<Item
label="管网"
label="数据源"
>
<Select onChange={handleService} mode="multiple" >
{pipeArr.length ? pipeArr.map((item, index) => { return <Option key={index} value={item}>{item}</Option>; }) : ''}
......
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