fix:处理保存格式

This commit is contained in:
shixiaohua 2024-02-06 16:03:26 +08:00
parent dc537ef714
commit 8e07b42789
2 changed files with 3 additions and 3 deletions

View File

@ -190,7 +190,7 @@ const ItemTree = (prop) => {
} else {
//
dispatch(addTableBarItem({
label: e.node.title,
label: e.node.title.props.children[0],
children: e.node.key,
key: e.node.key,
activeKey: e.node.key

View File

@ -18,9 +18,9 @@ export const tableBarItemSlice = createSlice({
},
reducers: {
addTableBarItem: (state, action) => {
console.log("tableBarItemSlice:tableBarItem", state, action,)
console.log("tableBarItemSlice:addTableBarItem", state, action)
if (state.data.filter(file=>file.key===action.payload.key).length===0){
state.data.push(action.payload)
state.data.push({"label":action.payload.label,"key":action.payload.key,"children":action.payload.children})
}
if (action.payload.activeKey){
state.activeKey=action.payload.activeKey