Browse Source

fix:修改pdf品种层级

zqbao 8 months ago
parent
commit
6c3badc809
1 changed files with 16 additions and 14 deletions
  1. 16 14
      controllers/user.go

+ 16 - 14
controllers/user.go

@@ -802,14 +802,14 @@ func (this *UserAuthController) PermissionList() {
 		for _, vi := range vi.Child {
 			vi.ChartPermissionType = utils.PermissionTypeEta
 		}
+		vi.Child = append(vi.Child, &models.ChartPermissionTreeView{
+			ChartPermissionId:   1,
+			PermissionName:      utils.MINI_CUSTOM_PERMISSION_NAME,
+			IsPublic:            0,
+			Sort:                0,
+			ChartPermissionType: utils.ReportTypePdf,
+		})
 	}
-	publicView = append(publicView, &models.ChartPermissionTreeView{
-		ChartPermissionId:   1,
-		PermissionName:      utils.MINI_CUSTOM_PERMISSION_NAME,
-		IsPublic:            0,
-		Sort:                0,
-		ChartPermissionType: utils.ReportTypePdf,
-	})
 
 	br.Data = publicView
 	br.Msg = "查询成功"
@@ -874,13 +874,15 @@ func (this *UserAuthController) PurchasedPermission() {
 			privateView = append(privateView, curPermissionView)
 		}
 	}
-	privateView = append(privateView, &models.ChartPermissionTreeView{
-		ChartPermissionId:   1,
-		PermissionName:      utils.MINI_CUSTOM_PERMISSION_NAME,
-		IsPublic:            0,
-		Sort:                0,
-		ChartPermissionType: utils.ReportTypePdf,
-	})
+	for _, vi := range privateView {
+		vi.Child = append(vi.Child, &models.ChartPermissionTreeView{
+			ChartPermissionId:   1,
+			PermissionName:      utils.MINI_CUSTOM_PERMISSION_NAME,
+			IsPublic:            0,
+			Sort:                0,
+			ChartPermissionType: utils.ReportTypePdf,
+		})
+	}
 
 	br.Data = privateView
 	br.Msg = "查询成功"