Commit 6d52b027 authored by shaoan123's avatar shaoan123

解决表字段bug

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