Skip to content

Commit dd3f5cf

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents f5468fe + 57ac3a6 commit dd3f5cf

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

kernel/av/filter.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa
360360
}
361361
case KeyTypeSelect, KeyTypeMSelect:
362362
if nil != value.MSelect {
363-
if nil == other || nil == other.MSelect || 1 > len(other.MSelect) {
364-
return true
365-
}
366-
367363
switch operator {
368364
case FilterOperatorIsEqual, FilterOperatorContains:
369365
contains := false
@@ -387,12 +383,7 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa
387383
}
388384
}
389385
return !contains
390-
case FilterOperatorIsEmpty:
391-
return 0 == len(value.MSelect) || 1 == len(value.MSelect) && "" == value.MSelect[0].Content
392-
case FilterOperatorIsNotEmpty:
393-
return 0 != len(value.MSelect) && !(1 == len(value.MSelect) && "" == value.MSelect[0].Content)
394386
}
395-
return false
396387
}
397388
case KeyTypeURL:
398389
if nil != value.URL && nil != other && nil != other.URL {

kernel/model/attribute_view.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,8 +1470,21 @@ func GetBlockAttributeViewKeys(nodeID string) (ret []*BlockAttributeViewKeys) {
14701470

14711471
destKey, _ := destAv.GetKey(kv.Key.Rollup.KeyID)
14721472
if nil != destKey {
1473+
var furtherCollection av.Collection
1474+
if av.KeyTypeTemplate == destKey.Type {
1475+
// 渲染目标视图,这样才能汇总渲染后的模板字段值
1476+
viewable := sql.RenderView(destAv, destAv.Views[0], "")
1477+
if nil != viewable {
1478+
furtherCollection = viewable.(av.Collection)
1479+
}
1480+
}
1481+
14731482
for _, bID := range relVal.Relation.BlockIDs {
14741483
destVal := destAv.GetValue(kv.Key.Rollup.KeyID, bID)
1484+
if nil != furtherCollection && av.KeyTypeTemplate == destKey.Type {
1485+
destVal = furtherCollection.GetValue(bID, destKey.ID)
1486+
}
1487+
14751488
if nil == destVal {
14761489
if destAv.ExistItem(bID) { // 数据库中存在项目但是字段值不存在是数据未初始化,这里补一个默认值
14771490
destVal = av.GetAttributeViewDefaultValue(ast.NewNodeID(), kv.Key.Rollup.KeyID, bID, destKey.Type)

kernel/model/export.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,10 +2618,6 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
26182618
} else if av.KeyTypeTemplate == cell.Value.Type {
26192619
if nil != cell.Value.Template {
26202620
val = cell.Value.Template.Content
2621-
if "<no value>" == val {
2622-
val = ""
2623-
}
2624-
26252621
val = strings.ReplaceAll(val, "\\|", "|")
26262622
val = strings.ReplaceAll(val, "|", "\\|")
26272623
col := table.GetColumn(cell.Value.KeyID)

kernel/sql/av.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ func RenderTemplateField(ial map[string]string, keyValues []*av.KeyValues, tplCo
242242
return
243243
}
244244
ret = buf.String()
245+
if ret == "<no value>" {
246+
ret = ""
247+
}
245248
return
246249
}
247250

@@ -506,7 +509,7 @@ func fillAttributeViewAutoGeneratedValues(attrView *av.AttributeView, collection
506509
}
507510
}
508511

509-
func fillAttributeViewTemplateValues(attrView *av.AttributeView, collection av.Collection, ials map[string]map[string]string, items map[string][]*av.KeyValues) (err error) {
512+
func fillAttributeViewTemplateValues(attrView *av.AttributeView, collection av.Collection, ials map[string]map[string]string, items map[string][]*av.KeyValues, renderedTemplateKeyCollections map[string]av.Collection) (err error) {
510513
existTemplateField := false
511514
for _, kVals := range attrView.KeyValues {
512515
if av.KeyTypeTemplate == kVals.Key.Type {

0 commit comments

Comments
 (0)