作者 yangfu

chore: optimize P0 case

@@ -110,7 +110,7 @@ func (fields Fields) Select(options map[string]interface{}) []*Field { @@ -110,7 +110,7 @@ func (fields Fields) Select(options map[string]interface{}) []*Field {
110 func ValidFields(fields []*Field) error { 110 func ValidFields(fields []*Field) error {
111 m := (Fields)(fields).ToMap() 111 m := (Fields)(fields).ToMap()
112 if len(m) != len(fields) { 112 if len(m) != len(fields) {
113 - return fmt.Errorf("列名重复") 113 + return fmt.Errorf("列名重复")
114 } 114 }
115 115
116 for _, f := range fields { 116 for _, f := range fields {
@@ -127,6 +127,11 @@ func (querySet *QuerySet) GetDependencyTables(queryComponents []*QueryComponent) @@ -127,6 +127,11 @@ func (querySet *QuerySet) GetDependencyTables(queryComponents []*QueryComponent)
127 set.AddInt(f.TableId) 127 set.AddInt(f.TableId)
128 } 128 }
129 } 129 }
  130 + if queryComponents[i].Layout != nil {
  131 + for _, c := range queryComponents[i].Layout.LayoutCells() {
  132 + set.AddInt(c.Data.TableField.TableId)
  133 + }
  134 + }
130 } 135 }
131 res := set.KeysInt() 136 res := set.KeysInt()
132 sort.Ints(res) 137 sort.Ints(res)
@@ -147,12 +147,12 @@ func (ptr *ByteCoreService) FormulasGenerate(param domain.ReqFormulasGenerate) ( @@ -147,12 +147,12 @@ func (ptr *ByteCoreService) FormulasGenerate(param domain.ReqFormulasGenerate) (
147 // } 147 // }
148 // return &domain.DataFormulasGenerate{}, nil 148 // return &domain.DataFormulasGenerate{}, nil
149 //} 149 //}
150 - if param.QuerySet.Type == domain.CalculateItem.ToString() {  
151 - if param.QuerySet.QueryComponents[0].Formula.ExprMode != 0 {  
152 - err := ptr.ExcelExprCalcPersistence(param.QuerySet.QueryComponents[0].Formula, param, true)  
153 - return &domain.DataFormulasGenerate{}, err  
154 - }  
155 - } 150 + //if param.QuerySet.Type == domain.CalculateItem.ToString() {
  151 + // if param.QuerySet.QueryComponents[0].Formula.ExprMode != 0 {
  152 + // err := ptr.ExcelExprCalcPersistence(param.QuerySet.QueryComponents[0].Formula, param, true)
  153 + // return &domain.DataFormulasGenerate{}, err
  154 + // }
  155 + //}
156 if param.QuerySet.Type == domain.CalculateSet.ToString() { 156 if param.QuerySet.Type == domain.CalculateSet.ToString() {
157 _, err := param.QuerySetService.(*QuerySetService).LoadCalculateSetData(param.Context.(*domain.Context), param.QuerySet, param.QueryComponents) 157 _, err := param.QuerySetService.(*QuerySetService).LoadCalculateSetData(param.Context.(*domain.Context), param.QuerySet, param.QueryComponents)
158 if err != nil { 158 if err != nil {