diff --git a/apps/web/src/app/main/layout/MainLayout.tsx b/apps/web/src/app/main/layout/MainLayout.tsx index fa6627a..739bcaa 100755 --- a/apps/web/src/app/main/layout/MainLayout.tsx +++ b/apps/web/src/app/main/layout/MainLayout.tsx @@ -11,7 +11,7 @@ export function MainLayout() {
- + diff --git a/apps/web/src/components/common/editor/MindEditor.tsx b/apps/web/src/components/common/editor/MindEditor.tsx index bd4c877..88d745b 100755 --- a/apps/web/src/components/common/editor/MindEditor.tsx +++ b/apps/web/src/components/common/editor/MindEditor.tsx @@ -24,7 +24,7 @@ const MIND_OPTIONS = { draggable: true, contextMenu: true, toolBar: true, - //nodeMenu: true, + nodeMenu: true, keypress: true, locale: "zh_CN" as const, theme: { @@ -66,8 +66,8 @@ export default function MindEditor({ id }: { id?: string }) { }); const canEdit: boolean = useMemo(() => { //登录了且是作者、超管、无id新建模式 - const isAuth = isAuthenticated && user?.id == post?.authorId; - return !id || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST); + const isAuth = isAuthenticated && user?.id == post?.author.id + return !Boolean(id) || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST); }, [user]) const navigate = useNavigate(); const { create, update } = usePost(); @@ -183,14 +183,11 @@ export default function MindEditor({ id }: { id?: string }) { ); }; return ( -
+
{canEdit && taxonomies && (
{ - console.log(values); - }} form={form} - className=" bg-white p-2 "> + className=" bg-white p-4 ">
{taxonomies.map((tax, index) => ( @@ -217,13 +214,13 @@ export default function MindEditor({ id }: { id?: string }) { />
-
)} -
e.preventDefault()} /> +
e.preventDefault()} /> {canEdit && instance && } {isLoading && (
{ navigate(`/course/${post?.id}/detail`); - + window.scrollTo({ top: 0, behavior: "smooth" }); }}> ); } diff --git a/apps/web/src/components/models/post/SubPost/PathCard.tsx b/apps/web/src/components/models/post/SubPost/PathCard.tsx index c6e5a85..9de4ed0 100644 --- a/apps/web/src/components/models/post/SubPost/PathCard.tsx +++ b/apps/web/src/components/models/post/SubPost/PathCard.tsx @@ -9,6 +9,7 @@ export default function PathCard({ post }: { post: PostDto }) { post={post} onClick={() => { navigate(`/path/editor/${post?.id}`); + window.scrollTo({ top: 0, behavior: "smooth" }); }}> ); } diff --git a/apps/web/src/index.css b/apps/web/src/index.css index f65bd8b..f2767b1 100755 --- a/apps/web/src/index.css +++ b/apps/web/src/index.css @@ -162,6 +162,6 @@ } .mind-editor { - height: calc(100vh - 285px); + height: calc(82vh); width: 100%; } \ No newline at end of file