mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01: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
|
Column string `json:"column"` // 列(字段)ID
|
||||||
Operator FilterOperator `json:"operator"` // 过滤操作符
|
Operator FilterOperator `json:"operator"` // 过滤操作符
|
||||||
Value *Value `json:"value"` // 过滤值
|
Value *Value `json:"value"` // 过滤值
|
||||||
RelativeDate *RelativeDate `json:"relativeDate"` // 相对时间
|
RelativeDate *RelativeDate `json:"relativeDate,omitempty"` // 相对时间
|
||||||
RelativeDate2 *RelativeDate `json:"relativeDate2"` // 第二个相对时间,用于某些操作符,比如 FilterOperatorIsBetween
|
RelativeDate2 *RelativeDate `json:"relativeDate2,omitempty"` // 第二个相对时间,用于某些操作符,比如 FilterOperatorIsBetween
|
||||||
}
|
}
|
||||||
|
|
||||||
type RelativeDateUnit int
|
type RelativeDateUnit int
|
||||||
|
|
@ -360,6 +360,10 @@ func (value *Value) filter(other *Value, relativeDate, relativeDate2 *RelativeDa
|
||||||
}
|
}
|
||||||
case KeyTypeSelect, KeyTypeMSelect:
|
case KeyTypeSelect, KeyTypeMSelect:
|
||||||
if nil != value.MSelect {
|
if nil != value.MSelect {
|
||||||
|
if 1 > len(other.MSelect) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
switch operator {
|
switch operator {
|
||||||
case FilterOperatorIsEqual, FilterOperatorContains:
|
case FilterOperatorIsEqual, FilterOperatorContains:
|
||||||
contains := false
|
contains := false
|
||||||
|
|
|
||||||
|
|
@ -374,11 +374,11 @@ func (value *Value) GetValByType(typ KeyType) (ret interface{}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ValueBlock struct {
|
type ValueBlock struct {
|
||||||
ID string `json:"id"` // 绑定的块 ID,非绑定块时为空
|
ID string `json:"id,omitempty"` // 绑定的块 ID,非绑定块时为空
|
||||||
Icon string `json:"icon"`
|
Icon string `json:"icon,omitempty"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
Created int64 `json:"created"`
|
Created int64 `json:"created,omitempty"`
|
||||||
Updated int64 `json:"updated"`
|
Updated int64 `json:"updated,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ValueText struct {
|
type ValueText struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue