feat(B5): 栏目工作台-树+类型化内容面板,ArticleList 组件化薄壳

- 新建 ArticleListPanel(props categoryId/fixedCategory):无props=全局检索行为不变(薄壳红线);
  固定栏目模式隐藏栏目下拉,watch categoryId 联动 reload(拖拽排序不触发,红线)
- CategoryManage 右侧:列表型=本栏目文章面板+新建文章(query.categoryId 预选)+预览;
  单页型=摘要+编辑内容+预览;外链型=URL+打开链接;空态引导;工具栏增树折叠(窄屏)
- ArticleEdit 支持 query.categoryId 新建态预选栏目
- 后端零改动(红线);vitest 32/32 绿(新增 categoryWorkbench.spec 7 例,手写挂载+vi.mock 桩)
This commit is contained in:
chenxing
2026-09-08 15:14:09 +08:00
parent e494a2d2d8
commit fc566eed8b
5 changed files with 723 additions and 274 deletions
+8 -1
View File
@@ -112,7 +112,14 @@ async function load() {
if (!store.siteId) return;
const tree = await categoryApi.tree(store.siteId).send();
categoryOptions.value = flattenCategories(tree || []);
if (!editId.value) return;
if (!editId.value) {
// B5:栏目工作台「新建文章」带 categoryId 预选(仅新建态;编辑态以详情回填为准)
const preselect = route.query.categoryId ? parseInt(String(route.query.categoryId)) : undefined;
if (preselect && categoryOptions.value.some(o => o.id === preselect)) {
form.categoryId = preselect;
}
return;
}
const detail = await articleApi.get(store.siteId, editId.value).send();
if (!detail) return;
Object.assign(form, {