mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15565
This commit is contained in:
parent
6803c6483e
commit
599cf0cf46
2 changed files with 13 additions and 9 deletions
|
@ -29,8 +29,8 @@ type ViewFilter struct {
|
|||
Column string `json:"column"` // 列(字段)ID
|
||||
Operator FilterOperator `json:"operator"` // 过滤操作符
|
||||
Value *Value `json:"value"` // 过滤值
|
||||
RelativeDate *RelativeDate `json:"relativeDate"` // 相对时间
|
||||
RelativeDate2 *RelativeDate `json:"relativeDate2"` // 第二个相对时间,用于某些操作符,比如 FilterOperatorIsBetween
|
||||
RelativeDate *RelativeDate `json:"relativeDate,omitempty"` // 相对时间
|
||||
RelativeDate2 *RelativeDate `json:"relativeDate2,omitempty"` // 第二个相对时间,用于某些操作符,比如 FilterOperatorIsBetween
|
||||
}
|
||||
|
||||
type RelativeDateUnit int
|
||||
|
@ -360,6 +360,10 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa
|
|||
}
|
||||
case KeyTypeSelect, KeyTypeMSelect:
|
||||
if nil != value.MSelect {
|
||||
if 1 > len(other.MSelect) {
|
||||
return true
|
||||
}
|
||||
|
||||
switch operator {
|
||||
case FilterOperatorIsEqual, FilterOperatorContains:
|
||||
contains := false
|
||||
|
|
|
@ -374,11 +374,11 @@ func (value *Value) GetValByType(typ KeyType) (ret interface{}) {
|
|||
}
|
||||
|
||||
type ValueBlock struct {
|
||||
ID string `json:"id"` // 绑定的块 ID,非绑定块时为空
|
||||
Icon string `json:"icon"`
|
||||
ID string `json:"id,omitempty"` // 绑定的块 ID,非绑定块时为空
|
||||
Icon string `json:"icon,omitempty"`
|
||||
Content string `json:"content"`
|
||||
Created int64 `json:"created"`
|
||||
Updated int64 `json:"updated"`
|
||||
Created int64 `json:"created,omitempty"`
|
||||
Updated int64 `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
type ValueText struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue