lin
This commit is contained in:
parent
cdceba2294
commit
6ff7105fd7
|
@ -12,7 +12,7 @@ import PostSelect from "../../models/post/PostSelect/PostSelect";
|
||||||
import { Lecture, PostType } from "@nice/common";
|
import { Lecture, PostType } from "@nice/common";
|
||||||
import { xmindColorPresets } from "./constant";
|
import { xmindColorPresets } from "./constant";
|
||||||
import { api } from "@nice/client";
|
import { api } from "@nice/client";
|
||||||
import { env } from "@web/src/env";
|
import { useAuth } from "@web/src/providers/auth-provider";
|
||||||
|
|
||||||
interface NodeMenuProps {
|
interface NodeMenuProps {
|
||||||
mind: MindElixirInstance;
|
mind: MindElixirInstance;
|
||||||
|
@ -20,12 +20,13 @@ interface NodeMenuProps {
|
||||||
|
|
||||||
//管理节点样式状态
|
//管理节点样式状态
|
||||||
const NodeMenu: React.FC<NodeMenuProps> = ({ mind }) => {
|
const NodeMenu: React.FC<NodeMenuProps> = ({ mind }) => {
|
||||||
|
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [selectedFontColor, setSelectedFontColor] = useState<string>("");
|
const [selectedFontColor, setSelectedFontColor] = useState<string>("");
|
||||||
const [selectedBgColor, setSelectedBgColor] = useState<string>("");
|
const [selectedBgColor, setSelectedBgColor] = useState<string>("");
|
||||||
const [selectedSize, setSelectedSize] = useState<string>("");
|
const [selectedSize, setSelectedSize] = useState<string>("");
|
||||||
const [isBold, setIsBold] = useState(false);
|
const [isBold, setIsBold] = useState(false);
|
||||||
|
const { user} = useAuth();
|
||||||
const [urlMode, setUrlMode] = useState<"URL" | "POSTURL">("POSTURL");
|
const [urlMode, setUrlMode] = useState<"URL" | "POSTURL">("POSTURL");
|
||||||
const [url, setUrl] = useState<string>("");
|
const [url, setUrl] = useState<string>("");
|
||||||
const [postId, setPostId] = useState<string>("");
|
const [postId, setPostId] = useState<string>("");
|
||||||
|
@ -245,6 +246,8 @@ const NodeMenu: React.FC<NodeMenuProps> = ({ mind }) => {
|
||||||
params={{
|
params={{
|
||||||
where: {
|
where: {
|
||||||
type: PostType.LECTURE,
|
type: PostType.LECTURE,
|
||||||
|
deletedAt: null,
|
||||||
|
authorId: user?.id,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -23,15 +23,9 @@ export default function CourseDetailTitle() {
|
||||||
{!selectedLectureId ? course?.title : lecture?.title}
|
{!selectedLectureId ? course?.title : lecture?.title}
|
||||||
</div>
|
</div>
|
||||||
<div className="text-gray-600 flex w-full justify-start items-center gap-5">
|
<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 && (
|
{course?.depts && course?.depts?.length > 0 && (
|
||||||
<div>
|
<div>
|
||||||
发布单位:
|
发布单位:
|
||||||
{course?.depts?.map((dept) => dept.name)}
|
{course?.depts?.map((dept) => dept.name)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -13,6 +13,7 @@ export default function PostSelect({
|
||||||
placeholder = "请选择课时",
|
placeholder = "请选择课时",
|
||||||
params = { where: {}, select: {} },
|
params = { where: {}, select: {} },
|
||||||
className,
|
className,
|
||||||
|
createdById,
|
||||||
}: {
|
}: {
|
||||||
value?: string | string[];
|
value?: string | string[];
|
||||||
onChange?: (value: string | string[]) => void;
|
onChange?: (value: string | string[]) => void;
|
||||||
|
@ -22,6 +23,7 @@ export default function PostSelect({
|
||||||
select?: Prisma.PostSelect<DefaultArgs>;
|
select?: Prisma.PostSelect<DefaultArgs>;
|
||||||
};
|
};
|
||||||
className?: string;
|
className?: string;
|
||||||
|
createdById?: string;
|
||||||
}) {
|
}) {
|
||||||
const [searchValue, setSearch] = useState("");
|
const [searchValue, setSearch] = useState("");
|
||||||
const searchCondition: Prisma.PostWhereInput = useMemo(() => {
|
const searchCondition: Prisma.PostWhereInput = useMemo(() => {
|
||||||
|
|
Loading…
Reference in New Issue