Просмотр исходного кода

Merge pull request #2129 from visuddhinanda/agile

学生discussion 只显示学生的
visuddhinanda 1 год назад
Родитель
Сommit
c307b13acf

+ 3 - 0
dashboard/src/components/discussion/Discussion.tsx

@@ -23,6 +23,7 @@ interface IWidget {
   showTopicId?: string;
   focus?: string;
   type?: TDiscussionType;
+  showStudent?: boolean;
   onTopicReady?: Function;
 }
 
@@ -30,6 +31,7 @@ const DiscussionWidget = ({
   resId,
   resType,
   showTopicId,
+  showStudent = false,
   focus,
   type = "discussion",
   onTopicReady,
@@ -103,6 +105,7 @@ const DiscussionWidget = ({
           resId={resId}
           resType={resType}
           type={type}
+          showStudent={showStudent}
           onSelect={(
             e: React.MouseEvent<HTMLSpanElement, MouseEvent>,
             comment: IComment

+ 1 - 0
dashboard/src/components/discussion/DiscussionBox.tsx

@@ -58,6 +58,7 @@ const DiscussionBoxWidget = ({ onTopicChange }: IWidget) => {
         resId={discussionMessage?.resId}
         resType={discussionMessage?.resType}
         focus={discussionMessage?.comment}
+        showStudent={discussionMessage?.withStudent}
         showTopicId={topicId}
         onTopicReady={(value: IComment) => {
           setCurrTopic(value);

+ 1 - 0
dashboard/src/components/discussion/DiscussionButton.tsx

@@ -83,6 +83,7 @@ const DiscussionButton = ({
             type: "discussion",
             resId: resId,
             resType: resType,
+            withStudent: wbw ? true : false,
           };
           console.debug("discussion show", data);
           store.dispatch(show(data));

+ 5 - 1
dashboard/src/components/discussion/DiscussionListCard.tsx

@@ -36,6 +36,7 @@ interface IWidget {
   changedAnswerCount?: IAnswerCount;
   type?: TDiscussionType;
   pageSize?: number;
+  showStudent?: boolean; //在课程中是否显示学生discussions
   onSelect?: Function;
   onItemCountChange?: Function;
   onReply?: Function;
@@ -46,6 +47,7 @@ const DiscussionListCardWidget = ({
   resType,
   topicId,
   userId,
+  showStudent = false,
   onSelect,
   changedAnswerCount,
   type = "discussion",
@@ -182,7 +184,9 @@ const DiscussionListCardWidget = ({
               url += `&course=${course.courseId}`;
             }
           }
-
+          if (showStudent) {
+            url += `&show_student=true`;
+          }
           console.info("DiscussionListCard api request", url);
           const res = await get<ICommentListResponse>(url);
           console.info("DiscussionListCard api response", res);

+ 1 - 0
dashboard/src/reducers/discussion.ts

@@ -17,6 +17,7 @@ export interface IShowDiscussion {
   topic?: string;
   comment?: string;
   sent?: ISentence;
+  withStudent?: boolean;
 }
 export interface ICount {
   count: number;