mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-19 07:26:50 +00:00
支持自定义表格字段值
This commit is contained in:
@@ -69,10 +69,28 @@ export default async function getPageProperties(id, block, schema, authToken, ta
|
||||
})
|
||||
}
|
||||
|
||||
// type\status是下拉选框 取数组第一个
|
||||
properties.type = properties.type?.[0]
|
||||
properties.status = properties.status?.[0]
|
||||
|
||||
if (properties.type === 'Post') {
|
||||
// 映射值:用户个性化type和status字段后,在此映射回代码的英文标识
|
||||
if (properties?.type === BLOG.NOTION_PROPERTY_NAME.type_post) {
|
||||
properties.type = 'Post'
|
||||
}
|
||||
if (properties?.type === BLOG.NOTION_PROPERTY_NAME.type_page) {
|
||||
properties.type = 'Page'
|
||||
}
|
||||
if (properties?.type === BLOG.NOTION_PROPERTY_NAME.type_notice) {
|
||||
properties.type = 'Notice'
|
||||
}
|
||||
if (properties?.status === BLOG.NOTION_PROPERTY_NAME.status_publish) {
|
||||
properties.status = 'Published'
|
||||
}
|
||||
if (properties?.status === BLOG.NOTION_PROPERTY_NAME.status_invisible) {
|
||||
properties.status = 'Invisible'
|
||||
}
|
||||
|
||||
if (properties.type === BLOG.NOTION_PROPERTY_NAME.type_post) {
|
||||
properties.slug = BLOG.POST_URL_PREFIX ? (BLOG.POST_URL_PREFIX + '/' + (properties.slug ?? properties.id)) : (properties.slug ?? properties.id)
|
||||
} else {
|
||||
properties.slug = (properties.slug ?? properties.id)
|
||||
|
||||
Reference in New Issue
Block a user