+
+ }
+ placeholder="搜索课程"
+ className="w-full md:w-96 rounded-full"
+ value={searchValue}
+ onClick={(e) => {
+ if (!window.location.pathname.startsWith("/search")) {
+ navigate(`/search`);
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+ }
+ }}
+ onChange={(e) => setSearchValue(e.target.value)}
+ onPressEnter={(e) => {
+ if (!window.location.pathname.startsWith("/search")) {
+ navigate(`/search`);
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+ }
+ }}
+ />
{isAuthenticated && (
<>
)}
-
e.preventDefault()}/>
+
e.preventDefault()}
+ />
{canEdit && instance &&
}
- {isLoading && (
-
-
-
- )}
- {!post && id && !isLoading && (
-
-
-
- )}
-
+ {
+ isLoading && (
+
+
+
+ )
+ }
+ {
+ !post && id && !isLoading && (
+
+
+
+ )
+ }
+
);
}
diff --git a/apps/web/src/components/common/editor/constant.ts b/apps/web/src/components/common/editor/constant.ts
new file mode 100644
index 0000000..29e6890
--- /dev/null
+++ b/apps/web/src/components/common/editor/constant.ts
@@ -0,0 +1,34 @@
+import MindElixir from "mind-elixir";
+export const MIND_OPTIONS = {
+ direction: MindElixir.SIDE,
+ draggable: true,
+ contextMenu: true,
+ toolBar: true,
+ nodeMenu: true,
+ keypress: true,
+ locale: "zh_CN" as const,
+ theme: {
+ name: "Latte",
+ palette: [
+ "#dd7878",
+ "#ea76cb",
+ "#8839ef",
+ "#e64553",
+ "#fe640b",
+ "#df8e1d",
+ "#40a02b",
+ "#209fb5",
+ "#1e66f5",
+ "#7287fd",
+ ],
+ cssVar: {
+ "--main-color": "#444446",
+ "--main-bgcolor": "#ffffff",
+ "--color": "#777777",
+ "--bgcolor": "#f6f6f6",
+ "--panel-color": "#444446",
+ "--panel-bgcolor": "#ffffff",
+ "--panel-border-color": "#eaeaea",
+ },
+ },
+};
diff --git a/apps/web/src/components/models/course/detail/CourseDetail.tsx b/apps/web/src/components/models/course/detail/CourseDetail.tsx
index 353ec4f..c33c268 100755
--- a/apps/web/src/components/models/course/detail/CourseDetail.tsx
+++ b/apps/web/src/components/models/course/detail/CourseDetail.tsx
@@ -8,11 +8,7 @@ export default function CourseDetail({
id?: string;
lectureId?: string;
}) {
- const iframeStyle = {
- width: "50%",
- height: "100vh",
- border: "none",
- };
+
return (
<>
diff --git a/apps/web/src/components/models/course/detail/CourseDetailDisplayArea.tsx b/apps/web/src/components/models/course/detail/CourseDetailDisplayArea.tsx
index cfcea17..7d89f1a 100755
--- a/apps/web/src/components/models/course/detail/CourseDetailDisplayArea.tsx
+++ b/apps/web/src/components/models/course/detail/CourseDetailDisplayArea.tsx
@@ -7,25 +7,10 @@ import { Course, LectureType, PostType } from "@nice/common";
import { CourseDetailContext } from "./CourseDetailContext";
import CollapsibleContent from "@web/src/components/common/container/CollapsibleContent";
import { Skeleton } from "antd";
-import { CoursePreview } from "./CoursePreview/CoursePreview";
import ResourcesShower from "@web/src/components/common/uploader/ResourceShower";
-import {
- BookOutlined,
- CalendarOutlined,
- EditTwoTone,
- EyeOutlined,
- ReloadOutlined,
-} from "@ant-design/icons";
-import dayjs from "dayjs";
import { useNavigate } from "react-router-dom";
import CourseDetailTitle from "./CourseDetailTitle";
-// interface CourseDetailDisplayAreaProps {
-// // course: Course;
-// // videoSrc?: string;
-// // videoPoster?: string;
-// // isLoading?: boolean;
-// }
export const CourseDetailDisplayArea: React.FC = () => {
// 创建滚动动画效果
diff --git a/apps/web/src/components/models/course/detail/CourseDetailLayout.tsx b/apps/web/src/components/models/course/detail/CourseDetailLayout.tsx
index 56831e4..4ac0d73 100755
--- a/apps/web/src/components/models/course/detail/CourseDetailLayout.tsx
+++ b/apps/web/src/components/models/course/detail/CourseDetailLayout.tsx
@@ -19,11 +19,7 @@ export default function CourseDetailLayout() {
const [isSyllabusOpen, setIsSyllabusOpen] = useState(true);
return (
- {/*
*/}
- {/* 添加 Header 组件 */}
- {/* 主内容区域 */}
- {/* 为了防止 Header 覆盖内容,添加上边距 */}
{" "}
{/* 添加这个包装 div */}
diff --git a/apps/web/src/components/models/course/detail/CourseDetailTitle.tsx b/apps/web/src/components/models/course/detail/CourseDetailTitle.tsx
index cc984e1..90228ad 100755
--- a/apps/web/src/components/models/course/detail/CourseDetailTitle.tsx
+++ b/apps/web/src/components/models/course/detail/CourseDetailTitle.tsx
@@ -44,7 +44,7 @@ export default function CourseDetailTitle() {
-
{`观看次数${course?.meta?.views || 0}`}
+
{`播放次数${course?.meta?.views || 0}`}
diff --git a/apps/web/src/components/models/course/detail/course-objectives.tsx b/apps/web/src/components/models/course/detail/course-objectives.tsx
deleted file mode 100755
index b849eac..0000000
--- a/apps/web/src/components/models/course/detail/course-objectives.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { CheckOutlined } from '@ant-design/icons';
-import React from 'react';
-interface CourseObjectivesProps {
- objectives: string[];
- title?: string;
-}
-const CourseObjectives: React.FC
= ({
- objectives,
- title = "您将会学到"
-}) => {
- return (
-
-
{title}
-
- {objectives.map((objective, index) => (
-
-
- {objective}
-
- ))}
-
-
- );
-};
-
-export default CourseObjectives;
\ No newline at end of file
diff --git a/apps/web/src/components/models/course/editor/context/CourseEditorContext.tsx b/apps/web/src/components/models/course/editor/context/CourseEditorContext.tsx
index bc84b18..90bcd04 100755
--- a/apps/web/src/components/models/course/editor/context/CourseEditorContext.tsx
+++ b/apps/web/src/components/models/course/editor/context/CourseEditorContext.tsx
@@ -82,7 +82,7 @@ export function CourseFormProvider({
}, [course, form]);
const onSubmit = async (values: any) => {
- console.log(values);
+
const sections = values?.sections || [];
const deptIds = values?.deptIds || [];
const termIds = taxonomies
@@ -149,6 +149,7 @@ export function CourseFormProvider({
}
};
+
return (
({
label: value,
diff --git a/apps/web/src/routes/index.tsx b/apps/web/src/routes/index.tsx
index 7740621..b12f419 100755
--- a/apps/web/src/routes/index.tsx
+++ b/apps/web/src/routes/index.tsx
@@ -88,6 +88,14 @@ export const routes: CustomRouteObject[] = [
),
},
+ {
+ path: "my-duty-path",
+ element: (
+
+
+
+ ),
+ },
{
path: "my-duty",
element: (
diff --git a/packages/common/prisma/schema.prisma b/packages/common/prisma/schema.prisma
index db764d2..6bcd44b 100755
--- a/packages/common/prisma/schema.prisma
+++ b/packages/common/prisma/schema.prisma
@@ -206,6 +206,7 @@ model Post {
rating Int? @default(0)
students Staff[] @relation("post_student")
depts Department[] @relation("post_dept")
+ views Int @default(0) @map("views")
// 索引
// 日期时间类型字段
createdAt DateTime @default(now()) @map("created_at")
@@ -226,8 +227,6 @@ model Post {
ancestors PostAncestry[] @relation("DescendantPosts")
descendants PostAncestry[] @relation("AncestorPosts")
resources Resource[] // 附件列表
- // watchableStaffs Staff[] @relation("post_watch_staff")
- // watchableDepts Department[] @relation("post_watch_dept") // 可观看的部门列表,关联 Department 模型
meta Json? // 封面url 视频url objectives具体的学习目标 rating评分Int
// 索引
@@ -240,6 +239,7 @@ model Post {
@@index([type, publishedAt])
@@index([state])
@@index([level])
+ @@index([views])
@@index([important])
@@map("post")
}