mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +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 {
|
for _, asset := range value.MAsset {
|
||||||
switch asset.Type {
|
switch asset.Type {
|
||||||
case AssetTypeFile:
|
case AssetTypeFile:
|
||||||
if filterTextContent(filter.Operator, asset.Name, filter.Value.MAsset[0].Content) ||
|
if "" != strings.TrimSpace(asset.Name) {
|
||||||
filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {
|
if filterTextContent(filter.Operator, asset.Name, filter.Value.MAsset[0].Content) {
|
||||||
return false
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if "" != strings.TrimSpace(asset.Content) {
|
||||||
|
if filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case AssetTypeImage:
|
case AssetTypeImage:
|
||||||
if filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {
|
if filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,15 @@ func getAttrViewAddingBlockDefaultValues(attrView *av.AttributeView, view, group
|
||||||
continue
|
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)
|
newValue := filter.GetAffectValue(keyValues.Key, addingItemID)
|
||||||
if nil == newValue {
|
if nil == newValue {
|
||||||
newValue = getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
|
newValue = getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue