Browse Source

【fix】【BOTA】当注释被筛选后,列表显示为空时,搜索和筛选不应该置灰禁用

tangchao 9 months ago
parent
commit
cc35fea808

+ 8 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift

@@ -778,11 +778,15 @@ extension KMLeftSideViewController {
                 let page = self.pdfDocument()?.page(at: UInt(i))
                 var annos: [CPDFAnnotation] = []
                 // 处理过滤
+                let types = ["Highlight","Underline","Strikeout","Freehand","FreeText","Note","Square","Circle","Line","Stamp","Arrow","Image","Redact","Sign"/*, "table"*/]
                 if typeArr.count == 0 && colorArr.count == 0 && authorArr.count == 0 {
-                    let types = ["Highlight","Underline","Strikeout","Freehand","FreeText","Note","Square","Circle","Line","Stamp","Arrow","Image","Redact","Sign"/*, "table"*/]
                     annos = KMOCToolClass.filterAnnotation(annotations: page?.annotations ?? [],types: types) as? [CPDFAnnotation] ?? []
+                    annotationArray += annos
                 } else {
                     var filterAnnos: [CPDFAnnotation] = page?.annotations ?? []
+                    let allAnnos = KMOCToolClass.filterAnnotation(annotations: filterAnnos,types: types) as? [CPDFAnnotation] ?? []
+                    annotationArray += allAnnos
+                    
                     if typeArr.count > 0 {
                         filterAnnos = (KMOCToolClass.filterAnnotation(annotations: filterAnnos, types: typeArr) as? [CPDFAnnotation]) ?? []
                     }
@@ -798,6 +802,8 @@ extension KMLeftSideViewController {
                 for annotation in page?.annotations ?? [] {
                     if annotation.isKind(of: CPDFSignatureAnnotation.self) {
                         annos.append(annotation)
+                        
+                        annotationArray.append(annotation)
                     }
                 }
                 for annotation in annos {
@@ -816,7 +822,7 @@ extension KMLeftSideViewController {
                 
                 //添加所有annotation 用于筛选
 //                annotationArray += (page?.annotations ?? [])
-                annotationArray += annos
+//                annotationArray += annos
             }
             
             //  处理排序