Skip to content

Commit

Permalink
Fixed menu action
Browse files Browse the repository at this point in the history
  • Loading branch information
LyricTian committed Apr 28, 2020
1 parent 1c8de9e commit 43678c2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pages/Menu/MenuAction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class MenuAction extends PureComponent {
}
}
if (!exists) {
data.push({ key: formData.code, record_id: newUUID(), ...formData });
data.push({ key: formData.code, ...formData });
}
this.setState({ dataSource: data, formVisible: false }, () => {
this.triggerChange(data);
Expand Down Expand Up @@ -100,6 +100,11 @@ export default class MenuAction extends PureComponent {
name: '删除',
resources: [{ method: 'DELETE', path: `${path}/:id` }],
},
{
code: 'view',
name: '查看',
resources: [{ method: 'GET', path: `${path}/:id` }],
},
{
code: 'query',
name: '查询',
Expand All @@ -117,7 +122,7 @@ export default class MenuAction extends PureComponent {
}, {});
for (let i = 0; i < newData.length; i += 1) {
if (!mDataSource[newData[i].key]) {
data.push({ record_id: newUUID(), ...newData[i] });
data.push({ ...newData[i] });
}
}

Expand Down

0 comments on commit 43678c2

Please sign in to comment.