| | |
| | | if (drawerState.type === SubModuleType.Column) { |
| | | let columnModuleList = drawerState.tableData; //.filter((d) => d.isEdit); |
| | | if (columnModuleList.length > 0) { |
| | | const groups = currentDrawerModule.value.groups.map((group) => { |
| | | if (group.group === state.group) { |
| | | group.fields = columnModuleList.map((c) => ({ |
| | | let groups = [...currentDrawerModule.value.groups]; |
| | | const isExist = groups.some((g) => g.group === state.group); |
| | | if (isExist) { |
| | | groups = groups.map((group) => { |
| | | if (group.group === state.group) { |
| | | group.fields = columnModuleList.map((c) => ({ |
| | | code: c.enCode, |
| | | name: c.name, |
| | | width: c.width, |
| | | sort: c.sortCode, |
| | | })); |
| | | } |
| | | return group; |
| | | }); |
| | | } else { |
| | | const group: API.GetMenuQueryResultGroup = { |
| | | group: state.group, |
| | | fields: columnModuleList.map((c) => ({ |
| | | code: c.enCode, |
| | | name: c.name, |
| | | width: c.width, |
| | | sort: c.sortCode, |
| | | })); |
| | | } |
| | | return group; |
| | | }); |
| | | })), |
| | | }; |
| | | groups.push(group); |
| | | } |
| | | let params: API.SaveMenuCommand = { |
| | | ...currentDrawerModule.value, |
| | | groups: groups, |