This commit is contained in:
Daniel 2025-08-10 16:02:59 +08:00
parent 0220f38d94
commit 548ae028cc
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 16 additions and 16 deletions

View file

@ -564,9 +564,9 @@ func (av *AttributeView) GetCurrentView(viewID string) (ret *View, err error) {
return
}
func (av *AttributeView) ExistBlock(blockID string) bool {
func (av *AttributeView) ExistItem(itemID string) bool {
for _, blockVal := range av.GetBlockKeyValues().Values {
if blockVal.BlockID == blockID {
if blockVal.BlockID == itemID {
return true
}
}
@ -582,11 +582,11 @@ func (av *AttributeView) ExistBoundBlock(nodeID string) bool {
return false
}
func (av *AttributeView) GetValue(keyID, blockID string) (ret *Value) {
func (av *AttributeView) GetValue(keyID, itemID string) (ret *Value) {
for _, kv := range av.KeyValues {
if kv.Key.ID == keyID {
for _, v := range kv.Values {
if v.BlockID == blockID {
if v.BlockID == itemID {
ret = v
return
}

View file

@ -185,7 +185,7 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, rowID st
for _, blockID := range relVal.Relation.BlockIDs {
destVal := destAv.GetValue(key.Rollup.KeyID, blockID)
if nil == destVal {
if destAv.ExistBlock(blockID) { // 数据库中存在项目但是字段值不存在是数据未初始化,这里补一个默认值
if destAv.ExistItem(blockID) { // 数据库中存在项目但是字段值不存在是数据未初始化,这里补一个默认值
destVal = GetAttributeViewDefaultValue(ast.NewNodeID(), key.Rollup.KeyID, blockID, destKey.Type)
}
if nil == destVal {