@@ -233,18 +233,16 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s
233233 }
234234 return true
235235 case FilterQuantifierNone :
236- if len ( value . Rollup . Contents ) < len ( relVal . Relation . Contents ) {
237- if FilterOperatorIsEmpty == filter . Operator {
236+ if FilterOperatorIsEmpty == filter . Operator {
237+ if len ( value . Rollup . Contents ) < len ( relVal . Relation . Contents ) || 1 > len ( value . Rollup . Contents ) {
238238 return false
239- } else if FilterOperatorIsNotEmpty == filter .Operator {
239+ }
240+ } else if FilterOperatorIsNotEmpty == filter .Operator {
241+ if 1 > len (value .Rollup .Contents ) {
240242 return true
241243 }
242244 }
243245
244- if 1 > len (filter .Value .Rollup .Contents ) {
245- return true
246- }
247-
248246 for _ , content := range value .Rollup .Contents {
249247 if content .filter (filter .Value .Rollup .Contents [0 ], filter .RelativeDate , filter .RelativeDate2 , filter .Operator ) {
250248 return false
@@ -304,12 +302,28 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s
304302
305303 switch filter .Qualifier {
306304 case FilterQuantifierUndefined , FilterQuantifierAny :
307- if 1 > len ( value . MAsset ) { // 说明资源字段为空
308- if FilterOperatorIsEmpty == filter . Operator {
305+ if FilterOperatorIsEmpty == filter . Operator {
306+ if 1 > len ( value . MAsset ) {
309307 return true
310- } else if FilterOperatorIsNotEmpty == filter .Operator {
308+ }
309+
310+ for _ , asset := range value .MAsset {
311+ if "" == strings .TrimSpace (asset .Content ) {
312+ return true
313+ }
314+ }
315+ return false
316+ } else if FilterOperatorIsNotEmpty == filter .Operator {
317+ if 1 > len (value .MAsset ) {
311318 return false
312319 }
320+
321+ for _ , asset := range value .MAsset {
322+ if "" != strings .TrimSpace (asset .Content ) {
323+ return true
324+ }
325+ }
326+ return false
313327 }
314328
315329 for _ , asset := range value .MAsset {
@@ -326,12 +340,28 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s
326340 }
327341 }
328342 case FilterQuantifierAll :
329- if 1 > len ( value . MAsset ) {
330- if FilterOperatorIsEmpty == filter . Operator {
343+ if FilterOperatorIsEmpty == filter . Operator {
344+ if 1 > len ( value . MAsset ) {
331345 return true
332- } else if FilterOperatorIsNotEmpty == filter .Operator {
346+ }
347+
348+ for _ , asset := range value .MAsset {
349+ if "" != strings .TrimSpace (asset .Content ) {
350+ return false
351+ }
352+ }
353+ return true
354+ } else if FilterOperatorIsNotEmpty == filter .Operator {
355+ if 1 > len (value .MAsset ) {
333356 return false
334357 }
358+
359+ for _ , asset := range value .MAsset {
360+ if "" == strings .TrimSpace (asset .Content ) {
361+ return false
362+ }
363+ }
364+ return true
335365 }
336366
337367 for _ , asset := range value .MAsset {
@@ -349,26 +379,38 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s
349379 }
350380 return true
351381 case FilterQuantifierNone :
352- if 1 > len (value .MAsset ) {
353- if FilterOperatorIsEmpty == filter .Operator {
354- return false
355- } else if FilterOperatorIsNotEmpty == filter .Operator {
382+ if FilterOperatorIsEmpty == filter .Operator {
383+ if 1 > len (value .MAsset ) {
356384 return true
357385 }
386+
387+ for _ , asset := range value .MAsset {
388+ if "" == strings .TrimSpace (asset .Content ) {
389+ return false
390+ }
391+ }
392+ return true
393+ } else if FilterOperatorIsNotEmpty == filter .Operator {
394+ if 1 > len (value .MAsset ) {
395+ return false
396+ }
397+
398+ for _ , asset := range value .MAsset {
399+ if "" != strings .TrimSpace (asset .Content ) {
400+ return false
401+ }
402+ }
403+ return true
358404 }
359405
360406 for _ , asset := range value .MAsset {
361407 switch asset .Type {
362408 case AssetTypeFile :
363- if "" != strings .TrimSpace (asset .Name ) {
364- if filterTextContent (filter .Operator , asset .Name , filterContent ) {
365- return false
366- }
409+ if filterTextContent (filter .Operator , asset .Name , filterContent ) {
410+ return false
367411 }
368- if "" != strings .TrimSpace (asset .Content ) {
369- if filterTextContent (filter .Operator , asset .Content , filterContent ) {
370- return false
371- }
412+ if filterTextContent (filter .Operator , asset .Content , filterContent ) {
413+ return false
372414 }
373415 case AssetTypeImage :
374416 if filterTextContent (filter .Operator , asset .Content , filterContent ) {
0 commit comments