package backend import ( "context" "kpt-pasture/model" pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" ) func (s *StoreEntry) DepartureTypeEnumList(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.DepartureType_Death), Label: "死亡", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DepartureType_Out), Label: "淘汰", Disabled: true, }) return configOptions } func (s *StoreEntry) OutReasonEnumList(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.OutReason_Long_Term_infertility), Label: "久配不孕", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Multiple_Miscarriages), Label: "多次流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Long_Treatment_Without_Recovery), Label: "久治不愈", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Postpartum_Paralysis), Label: "产后瘫痪", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Mastitis), Label: "乳房炎", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Hoof_Disease), Label: "蹄病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Congenital_Malformation), Label: "先天畸形", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Dysplasia), Label: "发育不良", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Hernia), Label: "疝气", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Excessive_Age), Label: "月龄过大", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Excessive_Weight), Label: "体重过肥", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Other_Disease), Label: "其他疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Weak_Child), Label: "弱仔", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Obsessive_Bull), Label: "恶癖牛", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Splitting), Label: "滑倒卧地不起", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReason_Other), Label: "其他", Disabled: true, }) return configOptions } func (s *StoreEntry) DeadReasonEnumList(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.DeadReason_Digestive_System_Diseases), Label: "消化性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeadReason_Respiratory_System_Diseases), Label: "呼吸性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeadReason_Reproductive_System_Diseases), Label: "繁殖性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeadReason_Metabolic_System_Diseases), Label: "代谢性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeadReason_Infectious_Diseases), Label: "传染性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeadReason_Difficult_Birth), Label: "难产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeadReason_Accident_Dead), Label: "意外死亡", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeadReason_Other), Label: "其他", Disabled: true, }) return configOptions } func (s *StoreEntry) MatingResultEnumList(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.MatingResult_Unknown), Label: "未知", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_ReMatch), Label: "复配", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_Pregnant), Label: "怀孕", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_Empty), Label: "空怀", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_Abort), Label: "流产", Disabled: true, }) return configOptions } func (s *StoreEntry) EventCategoryEnumList(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.EventCategory_Base), Label: "基础事件", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.EventCategory_Breed), Label: "繁殖事件", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.EventCategory_Health), Label: "兽医事件", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.EventCategory_Other), Label: "其他事件", Disabled: true, }) return configOptions } func (s *StoreEntry) IndicatorsDetailsList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } indicatorsDetailsList, _ := s.FindIndicatorsDetailsList(context.Background()) if len(indicatorsDetailsList) <= 0 { return configOptions } for _, v := range indicatorsDetailsList { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Label: v.Name, Disabled: true, Props: v.Kind, }) } return configOptions }