|
@@ -271,30 +271,80 @@ func (c *ChartPublicController) ListByEs() {
|
|
|
|
|
|
|
|
|
if len(chartInfoList) > 0 {
|
|
|
+
|
|
|
+ chartInfoMap := make(map[int]*data_manage.ChartInfo)
|
|
|
+ classifyMap := make(map[int]*data_manage.ChartClassify)
|
|
|
+ publicClassifyMap := make(map[int]*data_manage.ChartPublicClassify)
|
|
|
+
|
|
|
+
|
|
|
chartInfoIdList := make([]int, 0)
|
|
|
+ tmpClassifyIdList := make([]int, 0)
|
|
|
+ tmpPublicClassifyIdList := make([]int, 0)
|
|
|
+
|
|
|
for _, v := range chartInfoList {
|
|
|
v.ConvertToResp()
|
|
|
v.HaveOperaAuth = true
|
|
|
chartInfoIdList = append(chartInfoIdList, v.ChartInfoId)
|
|
|
+ tmpClassifyIdList = append(tmpClassifyIdList, v.ChartClassifyId)
|
|
|
+ tmpPublicClassifyIdList = append(tmpPublicClassifyIdList, v.ChartPublicClassifyId)
|
|
|
}
|
|
|
|
|
|
- tmpChartList, err := data_manage.GetChartInfoByIdList(chartInfoIdList)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取所有有权限的图表失败,Err:" + err.Error()
|
|
|
- return
|
|
|
+
|
|
|
+ {
|
|
|
+ tmpChartList, err := data_manage.GetChartInfoByIdList(chartInfoIdList)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取所有有权限的图表失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range tmpChartList {
|
|
|
+ chartInfoMap[v.ChartInfoId] = v
|
|
|
+ }
|
|
|
}
|
|
|
- chartInfoMap := make(map[int]*data_manage.ChartInfo)
|
|
|
- for _, v := range tmpChartList {
|
|
|
- chartInfoMap[v.ChartInfoId] = v
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ tmpList, err := data_manage.GetChartClassifyByIdList(tmpClassifyIdList)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取所有有权限的图表分类失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range tmpList {
|
|
|
+ classifyMap[v.ChartClassifyId] = v
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ obj := data_manage.ChartPublicClassify{}
|
|
|
+ tmpList, err := obj.GetChartClassifyByIdList(tmpPublicClassifyIdList)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取所有有权限的公共分类失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range tmpList {
|
|
|
+ publicClassifyMap[v.ChartPublicClassifyId] = v
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
for _, v := range chartInfoList {
|
|
|
- tmpChartInfo, ok := chartInfoMap[v.ChartInfoId]
|
|
|
- if !ok {
|
|
|
- continue
|
|
|
+ if tmpChartInfo, ok := chartInfoMap[v.ChartInfoId]; ok {
|
|
|
+ v.IsJoinPermission = tmpChartInfo.IsJoinPermission
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if classifyItem, ok := classifyMap[v.ChartInfoId]; ok {
|
|
|
+ v.ClassifyNamePath = classifyItem.ChartClassifyNamePath
|
|
|
}
|
|
|
- v.IsJoinPermission = tmpChartInfo.IsJoinPermission
|
|
|
+
|
|
|
+
|
|
|
+ if classifyItem, ok := publicClassifyMap[v.ChartPublicClassifyId]; ok {
|
|
|
+ v.PublicClassifyNamePath = classifyItem.ChartPublicClassifyNamePath
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -410,13 +460,13 @@ func (c *ChartPublicController) AllListByEs() {
|
|
|
br.Data = resp
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-func (c *ChartPublicController) BatchMoveChart() {
|
|
|
+func (c *ChartPublicController) BatchMove() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
defer func() {
|
|
|
c.Data["json"] = br
|
|
@@ -451,6 +501,9 @@ func (c *ChartPublicController) BatchMoveChart() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ req.SearchPublicChartReq.ChartPublicList = []int{3}
|
|
|
+
|
|
|
chartInfoIdList := make([]int, 0)
|
|
|
if req.IsSelectAll {
|
|
|
|