diff --git a/apps/server/src/models/post/post.service.ts b/apps/server/src/models/post/post.service.ts index 5d4db4c..c3a465d 100755 --- a/apps/server/src/models/post/post.service.ts +++ b/apps/server/src/models/post/post.service.ts @@ -134,7 +134,7 @@ export class PostService extends BaseTreeService { return result; } async update(args: Prisma.PostUpdateArgs, staff?: UserProfile) { - args.data.authorId = staff?.id; + //args.data.authorId = staff?.id; args.data.updatedAt = dayjs().toDate(); const result = await super.update(args); EventBus.emit('dataChanged', { diff --git a/apps/web/src/app/main/courses/components/CoursesContainer.tsx b/apps/web/src/app/main/courses/components/CoursesContainer.tsx index 72b9499..0b87258 100755 --- a/apps/web/src/app/main/courses/components/CoursesContainer.tsx +++ b/apps/web/src/app/main/courses/components/CoursesContainer.tsx @@ -13,6 +13,7 @@ export function CoursesContainer() { pageSize: 12, where: { type: PostType.COURSE, + deletedAt: null, ...termsCondition, ...searchCondition, }, diff --git a/apps/web/src/app/main/home/components/CoursesSection.tsx b/apps/web/src/app/main/home/components/CoursesSection.tsx index bd7e18d..c4f4f7d 100755 --- a/apps/web/src/app/main/home/components/CoursesSection.tsx +++ b/apps/web/src/app/main/home/components/CoursesSection.tsx @@ -92,6 +92,7 @@ const CoursesSection: React.FC = ({ page: 1, pageSize: initialVisibleCoursesCount, where: { + deletedAt:null, terms: !(selectedCategory === "全部") ? { some: { diff --git a/apps/web/src/app/main/my-duty-path/components/MyDutyPathContainer.tsx b/apps/web/src/app/main/my-duty-path/components/MyDutyPathContainer.tsx index 4b7f273..38e381e 100755 --- a/apps/web/src/app/main/my-duty-path/components/MyDutyPathContainer.tsx +++ b/apps/web/src/app/main/my-duty-path/components/MyDutyPathContainer.tsx @@ -14,6 +14,7 @@ export default function MyDutyPathContainer() { params={{ pageSize: 12, where: { + deletedAt: null, type: PostType.PATH, authorId: user?.id, ...termsCondition, diff --git a/apps/web/src/app/main/my-duty/components/MyDutyListContainer.tsx b/apps/web/src/app/main/my-duty/components/MyDutyListContainer.tsx index 727e828..79258a8 100755 --- a/apps/web/src/app/main/my-duty/components/MyDutyListContainer.tsx +++ b/apps/web/src/app/main/my-duty/components/MyDutyListContainer.tsx @@ -15,6 +15,7 @@ export default function MyDutyListContainer() { params={{ pageSize: 12, where: { + deletedAt:null, type: PostType.COURSE, authorId: user.id, ...termsCondition, diff --git a/apps/web/src/app/main/my-learning/components/MyLearningListContainer.tsx b/apps/web/src/app/main/my-learning/components/MyLearningListContainer.tsx index be281ae..19c5266 100755 --- a/apps/web/src/app/main/my-learning/components/MyLearningListContainer.tsx +++ b/apps/web/src/app/main/my-learning/components/MyLearningListContainer.tsx @@ -15,6 +15,7 @@ export default function MyLearningListContainer() { params={{ pageSize: 12, where: { + deletedAt: null, type: PostType.COURSE, students: { some: { diff --git a/apps/web/src/app/main/my-path/components/MyPathListContainer.tsx b/apps/web/src/app/main/my-path/components/MyPathListContainer.tsx index b7dfd33..a481263 100755 --- a/apps/web/src/app/main/my-path/components/MyPathListContainer.tsx +++ b/apps/web/src/app/main/my-path/components/MyPathListContainer.tsx @@ -22,7 +22,7 @@ export default function MyPathListContainer() { id: user?.id, }, }, - + deletedAt: null, ...termsCondition, ...searchCondition, }, diff --git a/apps/web/src/app/main/path/components/PathListContainer.tsx b/apps/web/src/app/main/path/components/PathListContainer.tsx index 4e7ade6..0c424e6 100755 --- a/apps/web/src/app/main/path/components/PathListContainer.tsx +++ b/apps/web/src/app/main/path/components/PathListContainer.tsx @@ -16,6 +16,7 @@ export function PathListContainer() { type: PostType.PATH, ...termsCondition, ...searchCondition, + deletedAt:null }, }} cols={4}> diff --git a/apps/web/src/app/main/search/components/SearchContainer.tsx b/apps/web/src/app/main/search/components/SearchContainer.tsx index 292d9b5..7413ce5 100755 --- a/apps/web/src/app/main/search/components/SearchContainer.tsx +++ b/apps/web/src/app/main/search/components/SearchContainer.tsx @@ -25,6 +25,7 @@ export default function SearchListContainer() { type: searchMode === "both" ? undefined : searchMode, ...termsCondition, ...searchCondition, + deletedAt: null, }, }} cols={4}> diff --git a/apps/web/src/components/common/editor/MindEditor.tsx b/apps/web/src/components/common/editor/MindEditor.tsx index 0aba7cf..7608c8a 100755 --- a/apps/web/src/components/common/editor/MindEditor.tsx +++ b/apps/web/src/components/common/editor/MindEditor.tsx @@ -39,6 +39,11 @@ export default function MindEditor({ id }: { id?: string }) { const { isAuthenticated, user, hasSomePermissions } = useAuth(); const { read } = useVisitor(); const queryClient = useQueryClient(); + useEffect(()=>{ + console.log("post",post) + console.log("user",user) + console.log(canEdit) + }) // const { data: post, isLoading }: { data: PathDto; isLoading: boolean } = // api.post.findFirst.useQuery( // { @@ -56,11 +61,13 @@ export default function MindEditor({ id }: { id?: string }) { }) const canEdit: boolean = useMemo(() => { const isAuth = isAuthenticated && user?.id === post?.author?.id; + return ( isAuthenticated && (!id || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST)) ); - }, [user]); + }, [user,post]); + const navigate = useNavigate(); const { create, update } = usePost(); @@ -141,12 +148,14 @@ export default function MindEditor({ id }: { id?: string }) { //挂载实例 setInstance(mind); - }, [canEdit]); + }, [canEdit,post]); useEffect(() => { handleIcon() }); useEffect(() => { if ((!id || post) && instance) { + containerRef.current.style.height = `${Math.floor(window.innerHeight - 271)}px`; + containerRef.current.style.width = `100%`; containerRef.current.hidden = false; instance.toCenter(); if ((post as any as PathDto)?.meta?.nodeData) { @@ -154,6 +163,7 @@ export default function MindEditor({ id }: { id?: string }) { } } }, [id, post, instance]); + //保存 按钮 函数 const handleSave = async () => { if (!instance) return; @@ -175,6 +185,7 @@ export default function MindEditor({ id }: { id?: string }) { id, }, data: { + //authorId: post.authorId, title: data.nodeData.topic, meta: { ...data, diff --git a/apps/web/src/components/models/post/PostSelect/PostSelect.tsx b/apps/web/src/components/models/post/PostSelect/PostSelect.tsx index 63b01ee..e9e924d 100644 --- a/apps/web/src/components/models/post/PostSelect/PostSelect.tsx +++ b/apps/web/src/components/models/post/PostSelect/PostSelect.tsx @@ -62,7 +62,7 @@ export default function PostSelect({ where: safeOR([ { ...idCondition }, - { ...searchCondition, ...(params?.where || {}) }, + {...(params?.where || {}), ...searchCondition }, ]), select: { ...postDetailSelect, ...(params?.select || {}) }, take: 15, diff --git a/apps/web/web-dist.zip b/apps/web/web-dist.zip deleted file mode 100644 index 2e31d07..0000000 Binary files a/apps/web/web-dist.zip and /dev/null differ