|
@@ -48,8 +48,20 @@ func (this *ReportChapterTypeController) List() {
|
|
|
br.ErrMsg = "获取报告章节列表失败, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
+ mappingList, e := models.GetChapterTypePermissionByResearchType(reportType)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取章节类型权限列表失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mappingMap := make(map[int][]int)
|
|
|
+ for _, v := range mappingList {
|
|
|
+ mappingMap[v.ReportChapterTypeId] = append(mappingMap[v.ReportChapterTypeId], v.ChartPermissionId)
|
|
|
+ }
|
|
|
+
|
|
|
respList := make([]*models.ReportChapterTypeListItem, 0)
|
|
|
for i := range list {
|
|
|
+ permissionIds, _ := mappingMap[list[i].ReportChapterTypeId]
|
|
|
respList = append(respList, &models.ReportChapterTypeListItem{
|
|
|
ReportChapterTypeId: list[i].ReportChapterTypeId,
|
|
|
ReportChapterTypeName: list[i].ReportChapterTypeName,
|
|
@@ -61,6 +73,8 @@ func (this *ReportChapterTypeController) List() {
|
|
|
WordsImage: list[i].YbBottomIcon, // 此处的不一样
|
|
|
EditImgUrl: list[i].EditImgUrl,
|
|
|
IsShow: list[i].IsShow,
|
|
|
+ Enabled: list[i].Enabled,
|
|
|
+ ChartPermissionIdList: permissionIds,
|
|
|
})
|
|
|
}
|
|
|
|