diff --git a/spug_web/src/pages/host/Group.js b/spug_web/src/pages/host/Group.js
index 6b419bd..657edb4 100644
--- a/spug_web/src/pages/host/Group.js
+++ b/spug_web/src/pages/host/Group.js
@@ -20,15 +20,20 @@ import store from './store';
import lds from 'lodash';
export default observer(function () {
- const [loading, setLoading] = useState(false);
+ const [loading, setLoading] = useState();
const [visible, setVisible] = useState(false);
const [draggable, setDraggable] = useState(false);
const [action, setAction] = useState('');
- const [expands, setExpands] = useState([]);
+ const [expands, setExpands] = useState();
const [bakTreeData, setBakTreeData] = useState();
useEffect(() => {
- if (!loading) store.fetchGroups()
+ if (!loading) store.fetchGroups().then(() => {
+ if (loading === undefined) {
+ const tmp = store.treeData.filter(x => x.children.length)
+ setExpands(tmp.map(x => x.key))
+ }
+ })
}, [loading])
const menus = (
@@ -132,7 +137,7 @@ export default observer(function () {
}>
+ extra={}>
setGroup(node)}
+ onSelect={(_, {node}) => handleChangeGrp(node)}
/>
diff --git a/spug_web/src/pages/host/index.js b/spug_web/src/pages/host/index.js
index a68d155..1d52b35 100644
--- a/spug_web/src/pages/host/index.js
+++ b/spug_web/src/pages/host/index.js
@@ -35,7 +35,8 @@ export default observer(function () {
{store.formVisible && }
{store.importVisible && }
- {store.selectorVisible && store.selectorVisible = false} onOk={store.updateGroup}/>}
+ {store.selectorVisible &&
+ store.selectorVisible = false} onOk={store.updateGroup}/>}
);
})