mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 10:30:13 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
260c13eaeb
2 changed files with 20 additions and 15 deletions
|
|
@ -206,30 +206,35 @@ func (value *Value) CompareOperator(other *Value, operator FilterOperator) bool
|
|||
|
||||
if nil != value.MSelect && nil != other.MSelect && 0 < len(value.MSelect) && 0 < len(other.MSelect) {
|
||||
switch operator {
|
||||
case FilterOperatorIsEqual:
|
||||
return value.MSelect[0].Content == other.MSelect[0].Content
|
||||
case FilterOperatorIsNotEqual:
|
||||
return value.MSelect[0].Content != other.MSelect[0].Content
|
||||
case FilterOperatorContains:
|
||||
case FilterOperatorIsEqual, FilterOperatorContains:
|
||||
contains := false
|
||||
for _, v := range value.MSelect {
|
||||
if v.Content == other.MSelect[0].Content {
|
||||
return true
|
||||
for _, v2 := range other.MSelect {
|
||||
if v.Content == v2.Content {
|
||||
contains = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
case FilterOperatorDoesNotContain:
|
||||
return contains
|
||||
case FilterOperatorIsNotEqual, FilterOperatorDoesNotContain:
|
||||
contains := false
|
||||
for _, v := range value.MSelect {
|
||||
if v.Content == other.MSelect[0].Content {
|
||||
return false
|
||||
for _, v2 := range other.MSelect {
|
||||
if v.Content == v2.Content {
|
||||
contains = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
return !contains
|
||||
case FilterOperatorIsEmpty:
|
||||
return 0 == len(value.MSelect)
|
||||
return 0 == len(value.MSelect) || 1 == len(value.MSelect) && "" == value.MSelect[0].Content
|
||||
case FilterOperatorIsNotEmpty:
|
||||
return 0 != len(value.MSelect)
|
||||
return 0 != len(value.MSelect) && !(1 == len(value.MSelect) && "" == value.MSelect[0].Content)
|
||||
}
|
||||
}
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
// Table 描述了表格实例的结构。
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ func (tx *Transaction) doSetAttrViewName(operation *Operation) (ret *TxErr) {
|
|||
}
|
||||
|
||||
func setAttributeViewName(operation *Operation) (err error) {
|
||||
attrView, err := av.ParseAttributeView(operation.AvID)
|
||||
attrView, err := av.ParseAttributeView(operation.ID)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue