|
@@ -1906,8 +1906,11 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ isEs := false
|
|
|
if keyword != "" {
|
|
|
searchList, total, err = data.EsSearchChartInfo(keyword, showSysId, []int{utils.CHART_SOURCE_DEFAULT}, noPermissionChartIdList, startSize, pageSize)
|
|
|
+ isEs = true
|
|
|
} else {
|
|
|
total, searchList, err = data_manage.ChartInfoSearchByEmptyKeyWord(showSysId, []int{utils.CHART_SOURCE_DEFAULT}, noPermissionChartIdList, startSize, pageSize)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -1945,8 +1948,6 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
chartEdbMap[v.ChartInfoId] = append(chartEdbMap[v.ChartInfoId], v)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- chartInfoMap := make(map[int]*data_manage.ChartInfo)
|
|
|
|
|
|
chartClassifyMap := make(map[int]*data_manage.ChartClassify)
|
|
|
|
|
@@ -1963,7 +1964,9 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- {
|
|
|
+ if isEs {
|
|
|
+
|
|
|
+ chartInfoMap := make(map[int]*data_manage.ChartInfo)
|
|
|
tmpChartList, err := data_manage.GetChartInfoByIdList(chartInfoIdList)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -1973,6 +1976,14 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
for _, tmpChartInfo := range tmpChartList {
|
|
|
chartInfoMap[tmpChartInfo.ChartInfoId] = tmpChartInfo
|
|
|
}
|
|
|
+ for _, v := range searchList {
|
|
|
+
|
|
|
+ chartViewInfo, ok := chartInfoMap[v.ChartInfoId]
|
|
|
+ if !ok {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ v.IsJoinPermission = chartViewInfo.IsJoinPermission
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1984,12 +1995,6 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
}
|
|
|
|
|
|
for _, v := range searchList {
|
|
|
-
|
|
|
- chartViewInfo, ok := chartInfoMap[v.ChartInfoId]
|
|
|
- if !ok {
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
tmp := new(data_manage.ChartInfoMore)
|
|
|
tmp.ChartInfo = *v
|
|
|
|
|
@@ -1997,8 +2002,9 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
tmp.IsEnChart = data.CheckIsEnChart(v.ChartNameEn, edbTmpList, v.Source, v.ChartType)
|
|
|
}
|
|
|
|
|
|
- if currClassify, ok := chartClassifyMap[chartViewInfo.ChartClassifyId]; ok {
|
|
|
- tmp.HaveOperaAuth = data_manage_permission.CheckChartPermissionByPermissionIdList(chartViewInfo.IsJoinPermission, currClassify.IsJoinPermission, chartViewInfo.ChartInfoId, chartViewInfo.ChartClassifyId, permissionChartIdList, permissionClassifyIdList)
|
|
|
+
|
|
|
+ if currClassify, ok := chartClassifyMap[v.ChartClassifyId]; ok {
|
|
|
+ tmp.HaveOperaAuth = data_manage_permission.CheckChartPermissionByPermissionIdList(v.IsJoinPermission, currClassify.IsJoinPermission, v.ChartInfoId, v.ChartClassifyId, permissionChartIdList, permissionClassifyIdList)
|
|
|
}
|
|
|
|
|
|
finalList = append(finalList, tmp)
|