mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 06:30:14 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
e2d0a0051d
commit
6e9d474bbe
2 changed files with 18 additions and 3 deletions
|
|
@ -287,9 +287,15 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s
|
|||
for _, asset := range value.MAsset {
|
||||
switch asset.Type {
|
||||
case AssetTypeFile:
|
||||
if filterTextContent(filter.Operator, asset.Name, filter.Value.MAsset[0].Content) ||
|
||||
filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {
|
||||
return false
|
||||
if "" != strings.TrimSpace(asset.Name) {
|
||||
if filterTextContent(filter.Operator, asset.Name, filter.Value.MAsset[0].Content) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if "" != strings.TrimSpace(asset.Content) {
|
||||
if filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
case AssetTypeImage:
|
||||
if filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {
|
||||
|
|
|
|||
|
|
@ -186,6 +186,15 @@ func getAttrViewAddingBlockDefaultValues(attrView *av.AttributeView, view, group
|
|||
continue
|
||||
}
|
||||
|
||||
if av.KeyTypeMAsset == keyValues.Key.Type {
|
||||
if nil != nearItem {
|
||||
if _, ok := ret[keyValues.Key.ID]; !ok {
|
||||
ret[keyValues.Key.ID] = getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
newValue := filter.GetAffectValue(keyValues.Key, addingItemID)
|
||||
if nil == newValue {
|
||||
newValue = getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue