Преглед изворни кода

config: indicatorsCategory update

Yi пре 1 недеља
родитељ
комит
dd84c3e61f
2 измењених фајлова са 40 додато и 0 уклоњено
  1. 39 0
      module/backend/config_data_base.go
  2. 1 0
      module/backend/enum_options.go

+ 39 - 0
module/backend/config_data_base.go

@@ -258,6 +258,45 @@ func (s *StoreEntry) EventCategoryEnumList(isAll string) []*pasturePb.ConfigOpti
 	return configOptions
 }
 
+func (s *StoreEntry) IndicatorsCategoryEnumList(isAll string) []*pasturePb.ConfigOptionsList {
+	configOptions := make([]*pasturePb.ConfigOptionsList, 0)
+	if isAll == model.IsAllYes {
+		configOptions = append(configOptions,
+			&pasturePb.ConfigOptionsList{
+				Value:    int32(0),
+				Label:    "全部",
+				Disabled: true,
+			})
+	}
+
+	configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.IndicatorType_Basic),
+		Label:    "基本指标",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.IndicatorType_Breed),
+		Label:    "繁殖指标",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.IndicatorType_Health),
+		Label:    "健康指标",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.IndicatorType_Feed),
+		Label:    "饲喂指标",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.IndicatorType_Calf),
+		Label:    "犊牛指标",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.IndicatorType_Fatten),
+		Label:    "育肥指标",
+		Disabled: true,
+	})
+	return configOptions
+}
+
 func (s *StoreEntry) IndicatorsDetailsList(isAll string) []*pasturePb.ConfigOptionsList {
 	configOptions := make([]*pasturePb.ConfigOptionsList, 0)
 	if isAll == model.IsAllYes {

+ 1 - 0
module/backend/enum_options.go

@@ -272,6 +272,7 @@ func (s *StoreEntry) SystemBaseConfigOptions(ctx context.Context, optionsName, i
 		"behavior":                   s.Behavior,
 		"matingWindowPeriod":         s.MatingWindowPeriodEnumList,
 		"neckRingError":              s.NeckRingErrorEnumList,
+		"indicatorType":              s.IndicatorsCategoryEnumList,
 	}
 
 	getConfigFunc, ok := getConfigFuncMap[optionsName]