refactor(admin): remove content-type resource/post module option

This commit is contained in:
2026-07-13 23:59:32 +08:00
parent 1af0e9b753
commit fb1a4e110c
6 changed files with 22 additions and 100 deletions
+10 -31
View File
@@ -109,8 +109,8 @@ export const MODULE_LIBRARY = [
type: 'ranking',
label: '排行榜',
icon: 'trophy',
desc: '按下载量 / 阅读量 / 评论数排序',
defaultConfig: { metric: 'downloads', count: 6, post_type: 'resource', title: '' },
desc: '按下载量 / 阅读量 / 评论数排序(普通文章)',
defaultConfig: { metric: 'downloads', count: 6, title: '' },
fields: [
{ key: 'title', type: 'text', label: '标题' },
{
@@ -121,31 +121,17 @@ export const MODULE_LIBRARY = [
{ label: '评论数', value: 'comments' },
],
},
{
key: 'post_type', type: 'select', label: '内容类型',
options: [
{ label: '资源', value: 'resource' },
{ label: '文章', value: 'post' },
],
},
{ key: 'count', type: 'number', label: '数量', min: 1, max: 20 },
],
},
{
type: 'recent',
label: '最新内容',
label: '最新文章',
icon: 'clock',
desc: '按时间倒序的最新文章 / 资源',
defaultConfig: { post_type: 'post', count: 6, layout: 'card', title: '' },
desc: '按时间倒序的最新文章',
defaultConfig: { count: 6, layout: 'card', title: '' },
fields: [
{ key: 'title', type: 'text', label: '标题' },
{
key: 'post_type', type: 'select', label: '内容类型',
options: [
{ label: '文章', value: 'post' },
{ label: '资源', value: 'resource' },
],
},
{ key: 'count', type: 'number', label: '数量', min: 1, max: 20 },
{
key: 'layout', type: 'select', label: '布局',
@@ -196,7 +182,7 @@ export const MODULE_LIBRARY = [
label: '热点推荐',
icon: 'fire',
desc: '文章推荐列表(纯文本,仅桌面端显示)',
defaultConfig: { count: 6, post_type: 'post', source: 'auto', title: '' },
defaultConfig: { count: 6, source: 'auto', title: '' },
fields: [
{ key: 'title', type: 'text', label: '标题' },
{ key: 'count', type: 'number', label: '数量', min: 3, max: 20 },
@@ -208,13 +194,6 @@ export const MODULE_LIBRARY = [
{ label: '最热文章(按阅读量)', value: 'views' },
],
},
{
key: 'post_type', type: 'select', label: '内容类型',
options: [
{ label: '文章', value: 'post' },
{ label: '资源', value: 'resource' },
],
},
],
},
{
@@ -478,12 +457,12 @@ export const PRESET_TEMPLATES = [
{
key: 'resource_standard',
label: '资源站标准',
desc: 'Hero(固定骨架)+ Tabs + 最新资源 + 下载排行',
desc: 'Hero(固定骨架)+ Tabs + 最新文章 + 下载排行',
modules: [
{ type: 'hero', config: {} },
{ type: 'tabs', config: { count: 8, layout: 'grid-cms' } },
{ type: 'recent', config: { post_type: 'resource', count: 8, layout: 'grid-cms' } },
{ type: 'ranking', config: { metric: 'downloads', post_type: 'resource', count: 6 } },
{ type: 'recent', config: { count: 8, layout: 'grid-cms' } },
{ type: 'ranking', config: { metric: 'downloads', count: 6 } },
],
},
{
@@ -503,7 +482,7 @@ export const PRESET_TEMPLATES = [
desc: 'Hero(固定骨架)+ 最新文章 + 多个分类块',
modules: [
{ type: 'hero', config: {} },
{ type: 'recent', config: { post_type: 'post', count: 6, layout: 'card' } },
{ type: 'recent', config: { count: 6, layout: 'card' } },
{ type: 'category', config: { count: 6, columns: 3, layout: 'card' } },
{ type: 'category', config: { count: 6, columns: 3, layout: 'card' } },
],