作者 yangfu

chore: optimize P0 case

... ... @@ -110,7 +110,7 @@ func (fields Fields) Select(options map[string]interface{}) []*Field {
func ValidFields(fields []*Field) error {
m := (Fields)(fields).ToMap()
if len(m) != len(fields) {
return fmt.Errorf("列名重复")
return fmt.Errorf("列名重复")
}
for _, f := range fields {
... ...
... ... @@ -127,6 +127,11 @@ func (querySet *QuerySet) GetDependencyTables(queryComponents []*QueryComponent)
set.AddInt(f.TableId)
}
}
if queryComponents[i].Layout != nil {
for _, c := range queryComponents[i].Layout.LayoutCells() {
set.AddInt(c.Data.TableField.TableId)
}
}
}
res := set.KeysInt()
sort.Ints(res)
... ...
... ... @@ -147,12 +147,12 @@ func (ptr *ByteCoreService) FormulasGenerate(param domain.ReqFormulasGenerate) (
// }
// return &domain.DataFormulasGenerate{}, nil
//}
if param.QuerySet.Type == domain.CalculateItem.ToString() {
if param.QuerySet.QueryComponents[0].Formula.ExprMode != 0 {
err := ptr.ExcelExprCalcPersistence(param.QuerySet.QueryComponents[0].Formula, param, true)
return &domain.DataFormulasGenerate{}, err
}
}
//if param.QuerySet.Type == domain.CalculateItem.ToString() {
// if param.QuerySet.QueryComponents[0].Formula.ExprMode != 0 {
// err := ptr.ExcelExprCalcPersistence(param.QuerySet.QueryComponents[0].Formula, param, true)
// return &domain.DataFormulasGenerate{}, err
// }
//}
if param.QuerySet.Type == domain.CalculateSet.ToString() {
_, err := param.QuerySetService.(*QuerySetService).LoadCalculateSetData(param.Context.(*domain.Context), param.QuerySet, param.QueryComponents)
if err != nil {
... ...