Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-08-14 10:08:43 +08:00
commit dd3f5cfacf
4 changed files with 17 additions and 14 deletions

View file

@ -360,10 +360,6 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa
}
case KeyTypeSelect, KeyTypeMSelect:
if nil != value.MSelect {
if nil == other || nil == other.MSelect || 1 > len(other.MSelect) {
return true
}
switch operator {
case FilterOperatorIsEqual, FilterOperatorContains:
contains := false
@ -387,12 +383,7 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa
}
}
return !contains
case FilterOperatorIsEmpty:
return 0 == len(value.MSelect) || 1 == len(value.MSelect) && "" == value.MSelect[0].Content
case FilterOperatorIsNotEmpty:
return 0 != len(value.MSelect) && !(1 == len(value.MSelect) && "" == value.MSelect[0].Content)
}
return false
}
case KeyTypeURL:
if nil != value.URL && nil != other && nil != other.URL {

View file

@ -1470,8 +1470,21 @@ func GetBlockAttributeViewKeys(nodeID string) (ret []*BlockAttributeViewKeys) {
destKey, _ := destAv.GetKey(kv.Key.Rollup.KeyID)
if nil != destKey {
var furtherCollection av.Collection
if av.KeyTypeTemplate == destKey.Type {
// 渲染目标视图,这样才能汇总渲染后的模板字段值
viewable := sql.RenderView(destAv, destAv.Views[0], "")
if nil != viewable {
furtherCollection = viewable.(av.Collection)
}
}
for _, bID := range relVal.Relation.BlockIDs {
destVal := destAv.GetValue(kv.Key.Rollup.KeyID, bID)
if nil != furtherCollection && av.KeyTypeTemplate == destKey.Type {
destVal = furtherCollection.GetValue(bID, destKey.ID)
}
if nil == destVal {
if destAv.ExistItem(bID) { // 数据库中存在项目但是字段值不存在是数据未初始化,这里补一个默认值
destVal = av.GetAttributeViewDefaultValue(ast.NewNodeID(), kv.Key.Rollup.KeyID, bID, destKey.Type)

View file

@ -2618,10 +2618,6 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
} else if av.KeyTypeTemplate == cell.Value.Type {
if nil != cell.Value.Template {
val = cell.Value.Template.Content
if "<no value>" == val {
val = ""
}
val = strings.ReplaceAll(val, "\\|", "|")
val = strings.ReplaceAll(val, "|", "\\|")
col := table.GetColumn(cell.Value.KeyID)

View file

@ -242,6 +242,9 @@ func RenderTemplateField(ial map[string]string, keyValues []*av.KeyValues, tplCo
return
}
ret = buf.String()
if ret == "<no value>" {
ret = ""
}
return
}
@ -506,7 +509,7 @@ func fillAttributeViewAutoGeneratedValues(attrView *av.AttributeView, collection
}
}
func fillAttributeViewTemplateValues(attrView *av.AttributeView, collection av.Collection, ials map[string]map[string]string, items map[string][]*av.KeyValues) (err error) {
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) {
existTemplateField := false
for _, kVals := range attrView.KeyValues {
if av.KeyTypeTemplate == kVals.Key.Type {