This commit is contained in:
linfeng 2025-03-07 17:44:41 +08:00
parent cdceba2294
commit 6ff7105fd7
4 changed files with 10 additions and 11 deletions

View File

@ -12,7 +12,7 @@ import PostSelect from "../../models/post/PostSelect/PostSelect";
import { Lecture, PostType } from "@nice/common";
import { xmindColorPresets } from "./constant";
import { api } from "@nice/client";
import { env } from "@web/src/env";
import { useAuth } from "@web/src/providers/auth-provider";
interface NodeMenuProps {
mind: MindElixirInstance;
@ -20,12 +20,13 @@ interface NodeMenuProps {
//管理节点样式状态
const NodeMenu: React.FC<NodeMenuProps> = ({ mind }) => {
const [isOpen, setIsOpen] = useState(false);
const [selectedFontColor, setSelectedFontColor] = useState<string>("");
const [selectedBgColor, setSelectedBgColor] = useState<string>("");
const [selectedSize, setSelectedSize] = useState<string>("");
const [isBold, setIsBold] = useState(false);
const { user} = useAuth();
const [urlMode, setUrlMode] = useState<"URL" | "POSTURL">("POSTURL");
const [url, setUrl] = useState<string>("");
const [postId, setPostId] = useState<string>("");
@ -238,13 +239,15 @@ const NodeMenu: React.FC<NodeMenuProps> = ({ mind }) => {
{urlMode === "POSTURL" ? (
<PostSelect
onChange={(value) => {
if (typeof value === "string") {
if (typeof value === "string" ) {
setPostId(value);
}
}}
params={{
where: {
type: PostType.LECTURE,
deletedAt: null,
authorId: user?.id,
},
}}
/>

View File

@ -23,15 +23,9 @@ export default function CourseDetailTitle() {
{!selectedLectureId ? course?.title : lecture?.title}
</div>
<div className="text-gray-600 flex w-full justify-start items-center gap-5">
{course?.author?.showname && (
<div>
:
{course?.author?.showname}
</div>
)}
{course?.depts && course?.depts?.length > 0 && (
<div>
:
{course?.depts?.map((dept) => dept.name)}
</div>
)}

View File

@ -13,6 +13,7 @@ export default function PostSelect({
placeholder = "请选择课时",
params = { where: {}, select: {} },
className,
createdById,
}: {
value?: string | string[];
onChange?: (value: string | string[]) => void;
@ -22,6 +23,7 @@ export default function PostSelect({
select?: Prisma.PostSelect<DefaultArgs>;
};
className?: string;
createdById?: string;
}) {
const [searchValue, setSearch] = useState("");
const searchCondition: Prisma.PostWhereInput = useMemo(() => {