|
@@ -51,7 +51,7 @@ const Option = () => {
|
|
|
enable: true
|
|
|
}
|
|
|
})
|
|
|
- console.log(state.items)
|
|
|
+ console.log(state.menuDataItems)
|
|
|
|
|
|
const { run: tryFetchList } = useRequest(queryDataSource, {
|
|
|
onSuccess: (result: API.DataSourceMenuItem) => {
|
|
@@ -77,6 +77,10 @@ const Option = () => {
|
|
|
}
|
|
|
)
|
|
|
|
|
|
+ const onSelect = (key: string, node) => {
|
|
|
+ setState({ ...state, activeID: key, menuDataItems: node.node.items })
|
|
|
+ }
|
|
|
+
|
|
|
const columns: ColumnsType<API.DataSourceItem> = [
|
|
|
{
|
|
|
title: '排序',
|
|
@@ -123,7 +127,6 @@ const Option = () => {
|
|
|
...state,
|
|
|
modalType: ModalType.UPDATE,
|
|
|
modalVisible: true,
|
|
|
- // items: state.menuDataItems,
|
|
|
current: {
|
|
|
ID: record.ID,
|
|
|
name: record.name,
|
|
@@ -174,9 +177,7 @@ const Option = () => {
|
|
|
return (
|
|
|
<div className="flex flex-nowrap h-full">
|
|
|
<LeftMenu
|
|
|
- onSelect={(key: string, node) =>
|
|
|
- setState({ ...state, activeID: key, menuDataItems: node.node.items })
|
|
|
- }
|
|
|
+ onSelect={onSelect}
|
|
|
showDelIcon={!state.menuDataItems.length}
|
|
|
options={state.menuData}
|
|
|
initFn={() => tryFetchList()}
|
|
@@ -242,7 +243,6 @@ const Option = () => {
|
|
|
})
|
|
|
setState({ ...state, items: newItemData })
|
|
|
await tryUpdateDataSourceItem({
|
|
|
- ...values,
|
|
|
ID: state.activeID,
|
|
|
items: newItemData
|
|
|
})
|