From 2a73e37b6e347963c63040b56c846b8867b4242b Mon Sep 17 00:00:00 2001 From: longdayi <13477510+longdayilongdayi@user.noreply.gitee.com> Date: Thu, 27 Feb 2025 23:50:23 +0800 Subject: [PATCH] 02272350 --- apps/web/src/app/main/layout/MainLayout.tsx | 2 +- apps/web/src/app/main/layout/UserMenu/UserForm.tsx | 6 +++--- apps/web/src/app/main/path/components/DeptInfo.tsx | 1 + apps/web/src/app/main/path/editor/page.tsx | 10 ++++------ apps/web/src/components/common/editor/MindEditor.tsx | 10 ++++------ apps/web/src/components/models/post/PostCard.tsx | 8 +++++--- apps/web/src/components/models/term/taxonomy-form.tsx | 2 +- 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/apps/web/src/app/main/layout/MainLayout.tsx b/apps/web/src/app/main/layout/MainLayout.tsx index 739bcaa..fa3bad7 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/app/main/layout/UserMenu/UserForm.tsx b/apps/web/src/app/main/layout/UserMenu/UserForm.tsx index a496ed0..edef377 100755 --- a/apps/web/src/app/main/layout/UserMenu/UserForm.tsx +++ b/apps/web/src/app/main/layout/UserMenu/UserForm.tsx @@ -12,7 +12,7 @@ import toast from "react-hot-toast"; export default function StaffForm() { const { user } = useAuth(); const { create, update } = useStaff(); // Ensure you have these methods in your hooks - const {formLoading,modalOpen,setModalOpen,domainId,setDomainId,form,setFormLoading,} = useContext(UserEditorContext); + const { formLoading, modalOpen, setModalOpen, domainId, setDomainId, form, setFormLoading, } = useContext(UserEditorContext); const { data, isLoading, @@ -68,7 +68,7 @@ export default function StaffForm() { } useEffect(() => { form.resetFields(); - console.log('cc',data); + console.log('cc', data); if (data) { form.setFieldValue("username", data.username); @@ -121,7 +121,7 @@ export default function StaffForm() { name={"showname"} label="名称"> { {post && (
+ 浏览量 {`${post?.meta?.views || 0}`} diff --git a/apps/web/src/app/main/path/editor/page.tsx b/apps/web/src/app/main/path/editor/page.tsx index 5ce3a20..eaed95d 100755 --- a/apps/web/src/app/main/path/editor/page.tsx +++ b/apps/web/src/app/main/path/editor/page.tsx @@ -2,11 +2,9 @@ import MindEditor from "@web/src/components/common/editor/MindEditor"; import { useParams } from "react-router-dom"; export default function PathEditorPage() { - const { id } = useParams(); + const { id } = useParams(); - return ( -
- -
- ); + return
+ +
} diff --git a/apps/web/src/components/common/editor/MindEditor.tsx b/apps/web/src/components/common/editor/MindEditor.tsx index 38fd4d7..3467d01 100755 --- a/apps/web/src/components/common/editor/MindEditor.tsx +++ b/apps/web/src/components/common/editor/MindEditor.tsx @@ -22,7 +22,6 @@ import { useAuth } from "@web/src/providers/auth-provider"; import { MIND_OPTIONS } from "./constant"; import { SaveOutlined } from "@ant-design/icons"; export default function MindEditor({ id }: { id?: string }) { - //containerRef 容器ref instance 实例 const containerRef = useRef(null); const [instance, setInstance] = useState(null); const { isAuthenticated, user, hasSomePermissions } = useAuth(); @@ -35,7 +34,6 @@ export default function MindEditor({ id }: { id?: string }) { select: postDetailSelect, }, { enabled: Boolean(id) }); const canEdit: boolean = useMemo(() => { - //登录了且是作者、超管、无id新建模式 const isAuth = isAuthenticated && user?.id === post?.author?.id; return !!id || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST); }, [user]); @@ -166,13 +164,13 @@ export default function MindEditor({ id }: { id?: string }) { ); }; useEffect(() => { - containerRef.current.style.height = `${Math.floor(window.innerHeight / 1.25)}px`; + + containerRef.current.style.height = `${Math.floor(window.innerHeight - 271)}px`; }, []); return ( - -
- + +
{canEdit && taxonomies && (
handleClick(post)} key={post?.id} hoverable - className="group overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl hover:shadow-2xl transition-all duration-300 transform hover:-translate-y-2" + className="group overflow-hidden rounded-2xl border border-gray-200 shadow-xl hover:shadow-2xl transition-all duration-300 transform hover:-translate-y-2" cover={ -
+
{post?.meta?.thumbnail ? (