mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
@@ -3,16 +3,21 @@ export default function getAllPageIds (collectionQuery, collectionId, collection
|
||||
if (!collectionQuery && !collectionView) {
|
||||
return []
|
||||
}
|
||||
let pageIds = []
|
||||
// 优先按照第一个视图排序
|
||||
if (viewIds && viewIds.length > 0) {
|
||||
const ids = collectionView[viewIds[0]].value.page_sort
|
||||
// console.log('PageIds: 从viewId获取', viewIds)
|
||||
for (const id of ids) {
|
||||
pageIds.push(id)
|
||||
let pageIds = []
|
||||
try {
|
||||
if (viewIds && viewIds.length > 0) {
|
||||
const ids = collectionQuery[collectionId][viewIds[0]]?.collection_group_results?.blockIds
|
||||
for (const id of ids) {
|
||||
pageIds.push(id)
|
||||
}
|
||||
}
|
||||
// 否则按照数据库原始排序
|
||||
} else if (collectionQuery && Object.values(collectionQuery).length > 0) {
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
// 否则按照数据库原始排序
|
||||
if (pageIds.length === 0 && collectionQuery && Object.values(collectionQuery).length > 0) {
|
||||
const pageSet = new Set()
|
||||
Object.values(collectionQuery[collectionId]).forEach(view => {
|
||||
view?.blockIds?.forEach(id => pageSet.add(id)) // group视图
|
||||
|
||||
Reference in New Issue
Block a user