[fix] compute edit bug
This commit is contained in:
parent
12f7fadc10
commit
2e239741d6
1 changed files with 13 additions and 13 deletions
|
|
@ -219,20 +219,20 @@ func (dsl *DSL) computeEditRow(name string, process *gou.Process, res map[string
|
||||||
messages := []string{}
|
messages := []string{}
|
||||||
row := maps.MapOf(res).Dot()
|
row := maps.MapOf(res).Dot()
|
||||||
data := maps.StrAny{"row": row}.Dot()
|
data := maps.StrAny{"row": row}.Dot()
|
||||||
for key, computes := range dsl.computes.edit {
|
for key := range res {
|
||||||
|
if computes, has := dsl.computes.edit[key]; has {
|
||||||
c := computes[0]
|
c := computes[0]
|
||||||
field := dsl.Fields.Table[c.name]
|
field := dsl.Fields.Table[c.name]
|
||||||
data.Set("value", res[key])
|
data.Set("value", res[key])
|
||||||
data.Set("type", field.Edit.Type)
|
data.Set("type", field.Edit.Type)
|
||||||
data.Set("props", field.Edit.Props)
|
data.Set("props", field.Edit.Props)
|
||||||
|
new, err := field.Edit.Compute.Value(data, process.Sid, process.Global)
|
||||||
new, err := field.Edit.Compute.Value(data, process.Sid, process.Global)
|
if err != nil {
|
||||||
if err != nil {
|
messages = append(messages, fmt.Sprintf("fields.table.%s bind: %s, value: %v error: %s", c.name, key, res[key], err.Error()))
|
||||||
messages = append(messages, fmt.Sprintf("fields.table.%s bind: %s, value: %v error: %s", c.name, key, res[key], err.Error()))
|
continue
|
||||||
continue
|
}
|
||||||
|
res[key] = new
|
||||||
}
|
}
|
||||||
res[key] = new
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue