修复某些情况下主机选择控件未展示过滤条件的问题

pull/605/head
vapao 2023-03-29 18:47:43 +08:00
parent a891b0989d
commit c692f8c4ca
1 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,7 @@ function HostSelector(props) {
hStore.initial().then(() => { hStore.initial().then(() => {
store.rawRecords = hStore.rawRecords; store.rawRecords = hStore.rawRecords;
store.rawTreeData = hStore.rawTreeData; store.rawTreeData = hStore.rawTreeData;
store.group = store.treeData[0] store.group = store.treeData[0] || {}
}) })
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []) }, [])
@ -166,7 +166,7 @@ function HostSelector(props) {
</Col> </Col>
<Col span={18} style={{paddingLeft: 12}}> <Col span={18} style={{paddingLeft: 12}}>
<div style={{display: 'flex', justifyContent: 'space-between', marginBottom: 12}}> <div style={{display: 'flex', justifyContent: 'space-between', marginBottom: 12}}>
<Input allowClear style={{width: 260}} placeholder="输入名称/IP检索" <Input allowClear style={{width: 260}} placeholder="输入名称/IP检索" value={store.f_word}
onChange={e => store.f_word = e.target.value}/> onChange={e => store.f_word = e.target.value}/>
<Space hidden={selectedRowKeys.length === 0}> <Space hidden={selectedRowKeys.length === 0}>
<div>已选择 {selectedRowKeys.length} 台主机</div> <div>已选择 {selectedRowKeys.length} 台主机</div>
@ -209,6 +209,7 @@ HostSelector.defaultProps = {
value: [], value: [],
type: 'text', type: 'text',
mode: 'ids', mode: 'ids',
onlyOne: false,
nullable: false, nullable: false,
onChange: () => null onChange: () => null
} }