fix issue

pull/410/head
vapao 2021-09-17 16:40:49 +08:00
parent f1e414626a
commit ce69718202
1 changed files with 13 additions and 6 deletions

View File

@ -137,14 +137,16 @@ export default observer(function () {
} else if (action === 'del' && nodeData.key === store.group.key) { } else if (action === 'del' && nodeData.key === store.group.key) {
return <LoadingOutlined style={{marginLeft: '4px'}}/> return <LoadingOutlined style={{marginLeft: '4px'}}/>
} else { } else {
const extend = nodeData.all_host_ids && nodeData.all_host_ids.length ? `${nodeData.all_host_ids.length}` : null
return ( return (
<span style={{lineHeight: '24px'}}> <div style={{display: 'inline-block', lineHeight: '24px'}}>
{nodeData.title}{nodeData.all_host_ids && nodeData.all_host_ids.length ? `${nodeData.all_host_ids.length}` : null} <span>{nodeData.title}{extend}</span>
</span> </div>
) )
} }
} }
const treeData = store.treeData;
return ( return (
<Card <Card
title="分组列表" title="分组列表"
@ -157,7 +159,9 @@ export default observer(function () {
onChange={setDraggable} onChange={setDraggable}
checkedChildren="排版" checkedChildren="排版"
unCheckedChildren="浏览"/> unCheckedChildren="浏览"/>
<Tooltip title="右键点击分组进行编辑,开启排版模式后可通过拖拽分组进行快速排序。"><QuestionCircleOutlined style={{marginLeft: 8, color: '#999'}}/></Tooltip> <Tooltip title="右键点击分组进行编辑,开启排版模式后可通过拖拽分组进行快速排序。">
<QuestionCircleOutlined style={{marginLeft: 8, color: '#999'}}/>
</Tooltip>
</AuthFragment>)}> </AuthFragment>)}>
<Dropdown <Dropdown
overlay={menus} overlay={menus}
@ -168,7 +172,7 @@ export default observer(function () {
autoExpandParent autoExpandParent
expandAction="doubleClick" expandAction="doubleClick"
draggable={draggable} draggable={draggable}
treeData={store.treeData} treeData={treeData}
titleRender={treeRender} titleRender={treeRender}
expandedKeys={expands} expandedKeys={expands}
selectedKeys={[store.group.key]} selectedKeys={[store.group.key]}
@ -178,7 +182,10 @@ export default observer(function () {
onRightClick={handleRightClick} onRightClick={handleRightClick}
/> />
</Dropdown> </Dropdown>
{store.records && store.treeData.length === 0 && ( {treeData.length === 1 && treeData[0].children.length === 0 && (
<div style={{color: '#999', marginTop: 20, textAlign: 'center'}}>右键点击分组进行分组管理哦~</div>
)}
{store.records && treeData.length === 0 && (
<div style={{color: '#999'}}>你还没有可访问的主机分组请联系管理员分配主机权限</div> <div style={{color: '#999'}}>你还没有可访问的主机分组请联系管理员分配主机权限</div>
)} )}
</Card> </Card>