|  |  |  | 
|---|
|  |  |  | name: subModule.name, | 
|---|
|  |  |  | group: state.group, | 
|---|
|  |  |  | // location: 'string', | 
|---|
|  |  |  | width: subModule.width, | 
|---|
|  |  |  | width: subModule.width.toString(), | 
|---|
|  |  |  | sort: subModule.sortCode, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | if (subModule.id) { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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.toString(), | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | width: c.width.toString(), | 
|---|
|  |  |  | sort: c.sortCode, | 
|---|
|  |  |  | })); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return group; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | })), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | groups.push(group); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | let params: API.SaveMenuCommand = { | 
|---|
|  |  |  | ...currentDrawerModule.value, | 
|---|
|  |  |  | groups: groups, | 
|---|