|
@@ -1601,6 +1601,7 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
|
|
|
}
|
|
|
|
|
|
resp := new(data_manage.ChartInfoDetailResp)
|
|
|
+ isSelected := 0
|
|
|
|
|
|
{
|
|
|
|
|
@@ -1610,7 +1611,7 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
|
|
|
br.ErrMsg = "获取图表分类信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ isSelected = chartClassify.IsSelected
|
|
|
|
|
|
permissionChartIdList, permissionClassifyIdList, err := data_manage_permission.GetUserChartAndClassifyPermissionList(this.SysUser.AdminId, chartInfo.ChartInfoId, chartInfo.ChartClassifyId)
|
|
|
if err != nil {
|
|
@@ -1818,6 +1819,7 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
classifyLevels := make([]string, 0)
|
|
|
{
|
|
|
list, e := data_manage.GetChartClassifyAllBySource(utils.CHART_SOURCE_DEFAULT)
|
|
@@ -1836,6 +1838,7 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
|
|
|
}
|
|
|
|
|
|
resp.ClassifyLevels = classifyLevels
|
|
|
+ resp.IsSelected = isSelected
|
|
|
|
|
|
|
|
|
chartInfo.IsEdit = data.CheckOpChartPermission(sysUser, chartInfo.SysUserId, chartInfo.HaveOperaAuth)
|
|
@@ -2287,6 +2290,32 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
|
|
|
|
keyword := this.GetString("Keyword")
|
|
|
+ isSelected, _ := this.GetInt("IsSelected", -1)
|
|
|
+ chartClassifyIds := make([]int, 0)
|
|
|
+ if isSelected >= 0 {
|
|
|
+
|
|
|
+ chartClassifyList, e := data_manage.GetChartClassifyAllBySourceIsSelected(utils.CHART_SOURCE_DEFAULT, isSelected)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取图表分类失败,Err:" + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(chartClassifyList) == 0 {
|
|
|
+ page := paging.GetPaging(currentIndex, pageSize, 0)
|
|
|
+ resp := data_manage.ChartInfoListByEsResp{
|
|
|
+ Paging: page,
|
|
|
+ List: make([]*data_manage.ChartInfoMore, 0),
|
|
|
+ }
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range chartClassifyList {
|
|
|
+ chartClassifyIds = append(chartClassifyIds, v.ChartClassifyId)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
isShowMe, _ := this.GetBool("IsShowMe")
|
|
@@ -2317,10 +2346,10 @@ func (this *ChartInfoController) ChartInfoSearchByEs() {
|
|
|
|
|
|
isEs := false
|
|
|
if keyword != "" {
|
|
|
- searchList, total, err = data.EsSearchChartInfo(keyword, showSysId, []int{utils.CHART_SOURCE_DEFAULT}, noPermissionChartIdList, startSize, pageSize)
|
|
|
+ searchList, total, err = data.EsSearchChartInfo(keyword, showSysId, []int{utils.CHART_SOURCE_DEFAULT}, noPermissionChartIdList, startSize, pageSize, chartClassifyIds)
|
|
|
isEs = true
|
|
|
} else {
|
|
|
- total, searchList, err = data_manage.ChartInfoSearchByEmptyKeyWord(showSysId, []int{utils.CHART_SOURCE_DEFAULT}, noPermissionChartIdList, startSize, pageSize)
|
|
|
+ total, searchList, err = data_manage.ChartInfoSearchByEmptyKeyWord(showSysId, []int{utils.CHART_SOURCE_DEFAULT}, noPermissionChartIdList, startSize, pageSize, chartClassifyIds)
|
|
|
if err != nil && !utils.IsErrNoRow(err) {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取图表信息失败,Err:" + err.Error()
|