feat(post-list): align list schema with Zibll paging contract
Replace the post_list.list admin contract with a dedicated schema module using Zibll keys (paging_ajax_s, paging_ajax_ias_s, ajax_trigger, ajax_nomore, list_orderby, post_list_author/time, target_blank). Runtime derives numbered/load_more/infinite from those keys and applies list orderby on main queries without legacy dual-write layers.
This commit is contained in:
@@ -41,11 +41,11 @@
|
||||
</div>
|
||||
<n-form :model="basic" label-placement="left" label-width="140" class="aksrt-form">
|
||||
<n-form-item label="文章列表分页">
|
||||
<n-radio-group v-model:value="basic.post_pagination_mode">
|
||||
<n-radio-group v-model:value="basic.paging_ajax_s">
|
||||
<n-space size="large">
|
||||
<n-radio-button value="numbered">数字翻页</n-radio-button>
|
||||
<n-radio-button value="load_more">加载更多</n-radio-button>
|
||||
<n-radio-button value="infinite">无限滚动</n-radio-button>
|
||||
<n-radio-button value="0">数字翻页</n-radio-button>
|
||||
<n-radio-button value="1">加载更多</n-radio-button>
|
||||
<n-radio-button value="1">无限滚动</n-radio-button>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</n-form-item>
|
||||
@@ -53,9 +53,9 @@
|
||||
<n-form-item label="评论列表分页">
|
||||
<n-radio-group v-model:value="basic.comment_pagination_mode">
|
||||
<n-space size="large">
|
||||
<n-radio-button value="numbered">数字翻页</n-radio-button>
|
||||
<n-radio-button value="load_more">加载更多</n-radio-button>
|
||||
<n-radio-button value="infinite">无限滚动</n-radio-button>
|
||||
<n-radio-button value="0">数字翻页</n-radio-button>
|
||||
<n-radio-button value="1">加载更多</n-radio-button>
|
||||
<n-radio-button value="1">无限滚动</n-radio-button>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</n-form-item>
|
||||
@@ -146,7 +146,7 @@ const basic = reactive({
|
||||
police_number: '',
|
||||
lazyload_enabled: true,
|
||||
lazyload_placeholder_url: '',
|
||||
post_pagination_mode: 'numbered',
|
||||
paging_ajax_s: '1',
|
||||
comment_pagination_mode: 'numbered',
|
||||
})
|
||||
|
||||
@@ -169,7 +169,7 @@ async function loadAll() {
|
||||
basic.police_number = d.police_number || ''
|
||||
basic.lazyload_enabled = d.lazyload_enabled !== false
|
||||
basic.lazyload_placeholder_url = d.lazyload_placeholder_url || ''
|
||||
basic.post_pagination_mode = d.post_pagination_mode || 'numbered'
|
||||
basic.paging_ajax_s = d.paging_ajax_s ?? '1'
|
||||
basic.comment_pagination_mode = d.comment_pagination_mode || 'numbered'
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -190,7 +190,7 @@ async function handleSave() {
|
||||
police_number: basic.police_number,
|
||||
lazyload_enabled: basic.lazyload_enabled,
|
||||
lazyload_placeholder_url: basic.lazyload_placeholder_url,
|
||||
post_pagination_mode: basic.post_pagination_mode,
|
||||
paging_ajax_s: basic.paging_ajax_s,
|
||||
comment_pagination_mode: basic.comment_pagination_mode,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,29 +1,31 @@
|
||||
/**
|
||||
* Post list — list section (Zibll-aligned admin contract).
|
||||
* Keys match PHP AKSRT_Admin_Schema_Post_List_List / Zibll option IDs.
|
||||
*/
|
||||
|
||||
export const listSchema = {
|
||||
key: 'post_list.list',
|
||||
title: '文章列表',
|
||||
icon: 'fas fa-list',
|
||||
description: '配置文章列表的卡片样式、元信息显示、分页方式和排序规则。',
|
||||
description: '对齐 Zibll 文章列表:默认排序、置顶范围、翻页模式(数字/AJAX/自动加载)与列表显示部件。',
|
||||
defaults: {
|
||||
post_card_style: 'thumb',
|
||||
post_show_author: true,
|
||||
post_show_date: true,
|
||||
post_show_views: true,
|
||||
post_show_category: true,
|
||||
post_excerpt_length: 120,
|
||||
post_pagination_mode: 'numbered',
|
||||
ias_max: 3,
|
||||
ajax_trigger_text: '',
|
||||
ajax_nomore_text: '',
|
||||
sticky_s: ['home', 'cat'],
|
||||
list_badge_show: ['pay', 'tag', 'topics', 'cat'],
|
||||
post_target_blank: false,
|
||||
item_heading_bold: false,
|
||||
list_orderby: 'modified',
|
||||
sticky_s: ['home', 'cat'],
|
||||
target_blank: false,
|
||||
item_heading_bold: false,
|
||||
post_list_author: true,
|
||||
post_list_time: true,
|
||||
list_meta_show: 'like',
|
||||
list_badge_show: ['pay', 'tag', 'topics', 'cat'],
|
||||
paging_ajax_s: '1',
|
||||
paging_ajax_ias_s: true,
|
||||
ias_max: 3,
|
||||
ajax_trigger: '加载更多',
|
||||
ajax_nomore: '没有更多了',
|
||||
post_card_style: 'thumb',
|
||||
post_excerpt_length: 120,
|
||||
post_list_per_page: 12,
|
||||
list_show_type: 'separate',
|
||||
thumb_postfirstimg_size: 'medium',
|
||||
post_t_placeholder: '',
|
||||
post_c_placeholder: '',
|
||||
list_list_style: '',
|
||||
list_list_img_position: 'left',
|
||||
list_list_scale: 70,
|
||||
@@ -37,122 +39,202 @@ export const listSchema = {
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'card',
|
||||
title: '卡片样式',
|
||||
icon: 'fas fa-th-large',
|
||||
fields: [
|
||||
{ key: 'post_card_style', label: '卡片样式', type: 'select', default: 'thumb', options: [
|
||||
{ label: '标准图文', value: 'thumb' },
|
||||
{ label: '紧凑卡', value: 'compact' },
|
||||
{ label: '大图卡', value: 'large_thumb' },
|
||||
{ label: '多图卡', value: 'multi_thumb' },
|
||||
{ label: '纯文字', value: 'text' },
|
||||
{ label: '有图则图文', value: 'thumb_if_has' },
|
||||
{ label: '卡片模式', value: 'card' },
|
||||
]},
|
||||
{ key: 'post_excerpt_length', label: '摘要长度 (字)', type: 'number', default: 120, min: 20, max: 500 },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'meta',
|
||||
title: '元信息显示',
|
||||
icon: 'fas fa-info-circle',
|
||||
fields: [
|
||||
{ key: 'post_show_author', label: '显示作者', type: 'switch', default: true },
|
||||
{ key: 'post_show_date', label: '显示日期', type: 'switch', default: true },
|
||||
{ key: 'post_show_views', label: '显示浏览数', type: 'switch', default: true },
|
||||
{ key: 'post_show_category', label: '显示分类', type: 'switch', default: true },
|
||||
{ key: 'list_badge_show', label: '显示徽章类型', type: 'checkbox', default: ['pay', 'tag', 'topics', 'cat'], options: [
|
||||
{ label: '付费', value: 'pay' },
|
||||
{ label: '分类', value: 'cat' },
|
||||
{ label: '专题', value: 'topics' },
|
||||
{ label: '标签', value: 'tag' },
|
||||
], help: '选择列表中显示哪些徽章类型' },
|
||||
{ key: 'list_meta_show', label: '移动端优先部件', type: 'radio', default: 'like', options: [
|
||||
{ label: '浏览数', value: 'view' },
|
||||
{ label: '点赞数', value: 'like' },
|
||||
{ label: '评论数', value: 'comm' },
|
||||
], help: '移动端空间不足时保留显示的单一部件' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'pagination',
|
||||
title: '分页方式',
|
||||
icon: 'fas fa-ellipsis-h',
|
||||
fields: [
|
||||
{ key: 'post_pagination_mode', label: '分页模式', type: 'radio', default: 'numbered', options: [
|
||||
{ label: '数字分页', value: 'numbered' },
|
||||
{ label: '加载更多', value: 'load_more' },
|
||||
{ label: '无限滚动', value: 'infinite' },
|
||||
]},
|
||||
{ key: 'ias_max', label: '最大加载页数', type: 'number', default: 3, min: 0, max: 10, help: '0 = 不限' },
|
||||
{ key: 'ajax_trigger_text', label: '加载更多文案', type: 'input', default: '', help: '留空使用默认"加载更多"' },
|
||||
{ key: 'ajax_nomore_text', label: '没有更多文案', type: 'input', default: '', help: '留空使用默认"没有更多了"' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'layout',
|
||||
title: '布局设置',
|
||||
icon: 'fas fa-columns',
|
||||
fields: [
|
||||
{ key: 'sticky_s', label: '置顶范围', type: 'checkbox', default: ['home', 'cat'], options: [
|
||||
{ label: '首页', value: 'home' },
|
||||
{ label: '分类页', value: 'cat' },
|
||||
{ label: '标签页', value: 'tag' },
|
||||
{ label: '专题页', value: 'topics' },
|
||||
], help: '选择哪些页面类型显示置顶文章' },
|
||||
{ key: 'post_target_blank', label: '新窗口打开', type: 'switch', default: false, help: '文章链接在新窗口打开' },
|
||||
{ key: 'item_heading_bold', label: '标题加粗', type: 'switch', default: false, help: '列表文章标题使用粗体' },
|
||||
{ key: 'list_show_type', label: '列表样式', type: 'radio', default: 'separate', options: [
|
||||
{ label: '分隔卡片', value: 'separate' },
|
||||
{ label: '无间距', value: 'no_margin' },
|
||||
], help: '列表模式时的卡片间距样式' },
|
||||
{ key: 'list_card_home', label: '首页卡片模式', type: 'switch', default: false, help: '首页列表切换为卡片模式' },
|
||||
{ key: 'list_card_cat', label: '分类卡片模式', type: 'taxonomy_select', taxonomy: 'category', multiple: true, default: [], help: '选择分类,访问这些分类时使用卡片模式显示(为空则不使用)' },
|
||||
{ key: 'list_card_tag', label: '标签页卡片模式', type: 'switch', default: false, help: '标签页列表切换为卡片模式' },
|
||||
{ key: 'list_card_topics', label: '专题页卡片模式', type: 'switch', default: false, help: '专题页列表切换为卡片模式' },
|
||||
{ key: 'list_card_author', label: '用户页卡片模式', type: 'switch', default: false, help: '用户页列表切换为卡片模式' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'sort',
|
||||
title: '默认排序',
|
||||
key: 'order',
|
||||
title: '默认排序与置顶',
|
||||
icon: 'fas fa-sort',
|
||||
fields: [
|
||||
{ key: 'list_orderby', label: '列表默认排序', type: 'radio', default: 'modified', options: [
|
||||
{ label: '更新时间', value: 'modified' },
|
||||
{ label: '发布时间', value: 'date' },
|
||||
{ label: '评论数', value: 'comments' },
|
||||
{ label: 'WordPress 默认', value: 'default' },
|
||||
], help: '分类/标签/归档页面的默认排序方式' },
|
||||
{
|
||||
key: 'list_orderby',
|
||||
label: '默认排序方式',
|
||||
type: 'radio',
|
||||
default: 'modified',
|
||||
options: [
|
||||
{ label: '发布时间', value: 'date' },
|
||||
{ label: '更新时间', value: 'modified' },
|
||||
{ label: 'WP默认', value: 'default' },
|
||||
],
|
||||
help: '文章列表全局默认排序(Zibll list_orderby)',
|
||||
},
|
||||
{
|
||||
key: 'sticky_s',
|
||||
label: '显示置顶文章',
|
||||
type: 'checkbox',
|
||||
default: ['home', 'cat'],
|
||||
options: [
|
||||
{ label: '首页', value: 'home' },
|
||||
{ label: '分类页', value: 'cat' },
|
||||
{ label: '标签页', value: 'tag' },
|
||||
{ label: '专题页', value: 'topics' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'list_option',
|
||||
title: '列表模式配置',
|
||||
icon: 'fas fa-list-ul',
|
||||
key: 'display',
|
||||
title: '列表显示',
|
||||
icon: 'fas fa-eye',
|
||||
fields: [
|
||||
{ key: 'list_list_style', label: '列表样式变体', type: 'radio', default: '', options: [
|
||||
{ label: '默认', value: '' },
|
||||
{ label: '样式2', value: 'style2' },
|
||||
], help: '列表模式的样式变体' },
|
||||
{ key: 'list_list_img_position', label: '缩略图位置', type: 'radio', default: 'left', options: [
|
||||
{ label: '左侧', value: 'left' },
|
||||
{ label: '右侧', value: 'right' },
|
||||
], help: '列表模式缩略图靠左或靠右' },
|
||||
{ key: 'list_list_scale', label: '缩略图比例 (%)', type: 'number', default: 70, min: 50, max: 200, help: '列表模式缩略图宽度百分比' },
|
||||
{ key: 'target_blank', label: '新窗口打开文章', type: 'switch', default: false },
|
||||
{ key: 'item_heading_bold', label: '列表标题粗体显示', type: 'switch', default: false },
|
||||
{ key: 'post_list_author', label: '显示文章作者', type: 'switch', default: true },
|
||||
{
|
||||
key: 'post_list_time',
|
||||
label: '显示文章时间',
|
||||
type: 'switch',
|
||||
default: true,
|
||||
help: '建议作者与时间至少开启一项',
|
||||
},
|
||||
{
|
||||
key: 'list_meta_show',
|
||||
label: '列表小部件(移动端优先)',
|
||||
type: 'radio',
|
||||
default: 'like',
|
||||
options: [
|
||||
{ label: '阅读量', value: 'view' },
|
||||
{ label: '点赞数', value: 'like' },
|
||||
{ label: '评论', value: 'comm' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'list_badge_show',
|
||||
label: '列表徽章',
|
||||
type: 'checkbox',
|
||||
default: ['pay', 'tag', 'topics', 'cat'],
|
||||
options: [
|
||||
{ label: '付费', value: 'pay' },
|
||||
{ label: '分类', value: 'cat' },
|
||||
{ label: '专题', value: 'topics' },
|
||||
{ label: '标签', value: 'tag' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'card_option',
|
||||
title: '卡片模式配置',
|
||||
icon: 'fas fa-th',
|
||||
key: 'paging',
|
||||
title: '列表翻页',
|
||||
icon: 'fas fa-ellipsis-h',
|
||||
fields: [
|
||||
{ key: 'list_card_style', label: '卡片样式变体', type: 'radio', default: '', options: [
|
||||
{ label: '默认', value: '' },
|
||||
{ label: '样式3', value: 'style3' },
|
||||
], help: '卡片模式的样式变体' },
|
||||
{ key: 'list_card_scale', label: '缩略图比例 (%)', type: 'number', default: 70, min: 20, max: 200, help: '卡片模式缩略图高度百分比' },
|
||||
{
|
||||
key: 'paging_ajax_s',
|
||||
label: '列表翻页模式',
|
||||
type: 'radio',
|
||||
default: '1',
|
||||
options: [
|
||||
{ label: 'AJAX 追加列表翻页', value: '1' },
|
||||
{ label: '数字翻页按钮', value: '0' },
|
||||
],
|
||||
help: '对齐 Zibll paging_ajax_s',
|
||||
},
|
||||
{
|
||||
key: 'paging_ajax_ias_s',
|
||||
label: 'AJAX 自动加载',
|
||||
type: 'switch',
|
||||
default: true,
|
||||
dependsOn: { key: 'paging_ajax_s', value: '1' },
|
||||
help: '滚动到列表尽头时自动加载下一页',
|
||||
},
|
||||
{
|
||||
key: 'ias_max',
|
||||
label: '自动加载页数',
|
||||
type: 'number',
|
||||
default: 3,
|
||||
min: 0,
|
||||
max: 10,
|
||||
dependsOn: { key: 'paging_ajax_s', value: '1' },
|
||||
help: '0 表示不限制',
|
||||
},
|
||||
{
|
||||
key: 'ajax_trigger',
|
||||
label: '加载更多文案',
|
||||
type: 'input',
|
||||
default: '加载更多',
|
||||
dependsOn: { key: 'paging_ajax_s', value: '1' },
|
||||
},
|
||||
{
|
||||
key: 'ajax_nomore',
|
||||
label: '没有更多文案',
|
||||
type: 'input',
|
||||
default: '没有更多了',
|
||||
dependsOn: { key: 'paging_ajax_s', value: '1' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'card',
|
||||
title: '卡片与布局',
|
||||
icon: 'fas fa-th-large',
|
||||
fields: [
|
||||
{
|
||||
key: 'post_card_style',
|
||||
label: '列表卡片样式',
|
||||
type: 'select',
|
||||
default: 'thumb',
|
||||
options: [
|
||||
{ label: '标准图文', value: 'thumb' },
|
||||
{ label: '紧凑卡', value: 'compact' },
|
||||
{ label: '大图卡', value: 'large_thumb' },
|
||||
{ label: '多图卡', value: 'multi_thumb' },
|
||||
{ label: '纯文字', value: 'text' },
|
||||
{ label: '有图则图文', value: 'thumb_if_has' },
|
||||
{ label: '卡片模式', value: 'card' },
|
||||
],
|
||||
},
|
||||
{ key: 'post_excerpt_length', label: '摘要长度', type: 'number', default: 120, min: 20, max: 500 },
|
||||
{ key: 'post_list_per_page', label: '每页文章数', type: 'number', default: 12, min: 4, max: 48 },
|
||||
{
|
||||
key: 'list_show_type',
|
||||
label: '列表间距样式',
|
||||
type: 'radio',
|
||||
default: 'separate',
|
||||
options: [
|
||||
{ label: '分隔卡片', value: 'separate' },
|
||||
{ label: '无间距', value: 'no_margin' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'list_list_style',
|
||||
label: '列表样式变体',
|
||||
type: 'radio',
|
||||
default: '',
|
||||
options: [
|
||||
{ label: '默认', value: '' },
|
||||
{ label: '样式2', value: 'style2' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'list_list_img_position',
|
||||
label: '列表缩略图位置',
|
||||
type: 'radio',
|
||||
default: 'left',
|
||||
options: [
|
||||
{ label: '左侧', value: 'left' },
|
||||
{ label: '右侧', value: 'right' },
|
||||
],
|
||||
},
|
||||
{ key: 'list_list_scale', label: '列表缩略图比例 (%)', type: 'number', default: 70, min: 50, max: 200 },
|
||||
{
|
||||
key: 'list_card_style',
|
||||
label: '卡片样式变体',
|
||||
type: 'radio',
|
||||
default: '',
|
||||
options: [
|
||||
{ label: '默认', value: '' },
|
||||
{ label: '样式3', value: 'style3' },
|
||||
],
|
||||
},
|
||||
{ key: 'list_card_scale', label: '卡片缩略图比例 (%)', type: 'number', default: 70, min: 20, max: 200 },
|
||||
{ key: 'list_card_home', label: '首页卡片模式', type: 'switch', default: false },
|
||||
{
|
||||
key: 'list_card_cat',
|
||||
label: '分类卡片模式',
|
||||
type: 'taxonomy_select',
|
||||
taxonomy: 'category',
|
||||
multiple: true,
|
||||
default: [],
|
||||
},
|
||||
{ key: 'list_card_tag', label: '标签页卡片模式', type: 'switch', default: false },
|
||||
{ key: 'list_card_topics', label: '专题页卡片模式', type: 'switch', default: false },
|
||||
{ key: 'list_card_author', label: '用户页卡片模式', type: 'switch', default: false },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user