zwxi 6 months ago
parent
commit
a07097bf42
2 changed files with 22 additions and 4 deletions
  1. 20 3
      controllers/data_manage/chart_info.go
  2. 2 1
      models/data_manage/chart_info.go

+ 20 - 3
controllers/data_manage/chart_info.go

@@ -4553,6 +4553,7 @@ func (this *ChartInfoController) ChartList() {
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	keyWord := this.GetString("KeyWord")
 	sysUserIds := this.GetString("SysUserIds")
+	chartTypeIds := this.GetString("ChartTypeIds")
 
 	var total int
 	page := paging.GetPaging(currentIndex, pageSize, total)
@@ -4616,6 +4617,11 @@ func (this *ChartInfoController) ChartList() {
 		condition += "  AND sys_user_id in (" + utils.GetOrmInReplace(len(adminIds)) + ") "
 		pars = append(pars, adminIdsSlice)
 	}
+	if chartTypeIds != "" {
+		chartTypeIdList := strings.Split(chartTypeIds, ",")
+		condition += "  AND chart_type in (" + utils.GetOrmInReplace(len(chartTypeIdList)) + ") "
+		pars = append(pars, chartTypeIdList)
+	}
 
 	//只看我的
 	//isShowMe, _ := this.GetBool("IsShowMe")
@@ -4801,7 +4807,8 @@ func (this *ChartInfoController) ModifyChartList() {
 		//根据查询条件筛选
 		chartClassifyIds := strings.Split(req.ChartClassifyIds, ",")
 		sysUserIds := req.SysUserIds
-		chartName := req.ChartName
+		keyword := req.KeyWord
+		chartTypeIdsStr := req.ChartTypeIds
 
 		condition := " AND source = ? "
 		pars := make([]interface{}, 0)
@@ -4848,9 +4855,19 @@ func (this *ChartInfoController) ModifyChartList() {
 			pars = append(pars, adminIdsSlice)
 		}
 
-		if chartName != "" {
+		if keyword != "" {
 			condition = " AND chart_name LIKE ? "
-			pars = append(pars, utils.GetLikeKeyword(chartName))
+			pars = append(pars, utils.GetLikeKeyword(keyword))
+		}
+
+		if chartTypeIdsStr != "" {
+			chartTypeIds := strings.Split(chartTypeIdsStr, ",")
+			if len(chartTypeIds) == 0 {
+				br.Msg = "请选择正确的图表类型"
+				return
+			}
+			condition += " AND chart_type IN(" + utils.GetOrmInReplace(len(chartTypeIds)) + ") "
+			pars = append(pars, chartTypeIds)
 		}
 
 		allChartInfo, err := data_manage.GetChartInfoItemsByCondition(condition, pars)

+ 2 - 1
models/data_manage/chart_info.go

@@ -2873,9 +2873,10 @@ type ModifyChartListReq struct {
 	SubClassify      bool `description:"是否关联图表子分类"`
 	ChartClassifyIds string
 	SysUserIds       string
-	ChartName        string
+	KeyWord        string
 	ChartInfoIds     string `description:"图表ID"`
 	ChartClassifyId  int    `description:"新图表分类"`
+	ChartTypeIds     string
 }