fix(categories): align taxonomy moderation

This commit is contained in:
2026-09-08 20:32:27 +08:00
parent c2dec1e711
commit 0a3378afae
5 changed files with 27 additions and 19 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ function TreeNode({
{!node.is_active && <Badge variant="secondary"></Badge>}
{node.approval_status === 'pending' && <Badge variant="outline"></Badge>}
<span className="ml-auto hidden items-center gap-1 group-hover:flex">
{canCreate && (
{canCreate && node.level < 3 && (
<Button variant="ghost" size="icon-sm" onClick={() => onCreateChild(node)} aria-label="新建子分类">
<Plus className="size-4" />
</Button>
+9 -1
View File
@@ -154,7 +154,15 @@ function MergeDialog({
enabled: source !== null,
})
const options = flattenTree(tree.data?.data ?? []).filter((c) => c.id !== source?.id)
const options = flattenTree(tree.data?.data ?? []).filter(
(category) =>
category.id !== source?.id &&
category.level === source?.level &&
category.parent_id === source?.parent_id &&
category.is_active &&
category.visibility === 'public' &&
category.approval_status === 'approved',
)
const submit = async () => {
if (!source || !targetId) return