Damon 4 years ago
parent
commit
671b2526ea

+ 2 - 2
src/components/GlobalHeader.vue

@@ -17,7 +17,7 @@
     </el-menu>
     </el-menu>
     <div id="global-header-icon">
     <div id="global-header-icon">
       <div class="global-header-icon-content" @click="this.$router.push('/message')" style="position: relative">
       <div class="global-header-icon-content" @click="this.$router.push('/message')" style="position: relative">
-        <sup v-if="unreadNum!==0" class="reminder">{{ unreadNum }}</sup>
+        <sup v-if="unreadNum !== '0'" class="reminder">{{ unreadNum }}</sup>
         <svg height="32" viewBox="0 0 1024 1024" width="32" xmlns="http://www.w3.org/2000/svg">
         <svg height="32" viewBox="0 0 1024 1024" width="32" xmlns="http://www.w3.org/2000/svg">
           <path
           <path
             d="M849.6 713.4c8.4-0.4 16.7 1.8 23.8 6.4-28.9-18.5-46.4-50.4-46.3-84.8V436c0-145.9-105.7-267.6-246.9-297.5v-7.2c0-37.1-30.1-67.1-67.2-67.1h-0.1c-37.1 0-67.3 30.1-67.3 67.2v7C304.3 168.4 198.7 290 198.7 436v199.1c0 35.7-18.6 66.9-46.4 84.8 7-4.6 15.4-6.9 23.8-6.4-24.7-0.9-45.5 18.4-46.4 43.1-0.9 24.7 18.4 45.5 43.1 46.4h676.6c24.7 0.1 44.8-20 44.9-44.7 0.1-24.8-19.9-44.9-44.7-44.9zM513 959.8c62 0 112.2-50.2 112.2-111.9H400.7c0 61.7 50.2 111.9 112.3 111.9z"
             d="M849.6 713.4c8.4-0.4 16.7 1.8 23.8 6.4-28.9-18.5-46.4-50.4-46.3-84.8V436c0-145.9-105.7-267.6-246.9-297.5v-7.2c0-37.1-30.1-67.1-67.2-67.1h-0.1c-37.1 0-67.3 30.1-67.3 67.2v7C304.3 168.4 198.7 290 198.7 436v199.1c0 35.7-18.6 66.9-46.4 84.8 7-4.6 15.4-6.9 23.8-6.4-24.7-0.9-45.5 18.4-46.4 43.1-0.9 24.7 18.4 45.5 43.1 46.4h676.6c24.7 0.1 44.8-20 44.9-44.7 0.1-24.8-19.9-44.9-44.7-44.9zM513 959.8c62 0 112.2-50.2 112.2-111.9H400.7c0 61.7 50.2 111.9 112.3 111.9z"
@@ -94,7 +94,7 @@ export default {
       return out;
       return out;
     },
     },
     unreadNum() {
     unreadNum() {
-      return this.myUnReadAnnouncements.length + this.myUnReadMessages.length > 99 ? "99+" : this.myUnReadAnnouncements.length + this.myUnReadMessages.length;
+      return this.myUnReadAnnouncements.length + this.myUnReadMessages.length > 99 ? "99+" : this.myUnReadAnnouncements.length + this.myUnReadMessages.length + "";
     },
     },
   },
   },
 
 

+ 2 - 1
src/views/AuthPage/components/AuthCard.vue

@@ -335,13 +335,14 @@ export default {
                       } else {
                       } else {
                         this.$router.push("/portal");
                         this.$router.push("/portal");
                       }
                       }
-                    }, 1000);
+                    }, 500);
                   } else {
                   } else {
                     this.$message({
                     this.$message({
                       showClose: true,
                       showClose: true,
                       message: res.data.message,
                       message: res.data.message,
                       type: "warning"
                       type: "warning"
                     });
                     });
+                    location.reload();
                   }
                   }
                 })
                 })
                 .catch((e) => {
                 .catch((e) => {

+ 72 - 43
src/views/CoursePage/CourseDetail.vue

@@ -108,30 +108,39 @@
               <el-timeline-item
               <el-timeline-item
                 v-for="task in courseTaskList"
                 v-for="task in courseTaskList"
                 :key="task.id"
                 :key="task.id"
-                :timestamp="task.examId ? task.startTime.substring(0, 16) : timestampToTime(task.startAt)"
+                :timestamp="task.examId ? task.startTime.substring(0, 16) + ' — ' + task.endTime.substring(0, 16) : timestampToTime(task.startAt * 1000) + ' — ' + timestampToTime(task.endAt * 1000)"
                 :color="courseTaskStatusColor(task)"
                 :color="courseTaskStatusColor(task)"
-                placement="top"
               >
               >
                 <div>
                 <div>
-                  <el-row v-if="task.examId" class="task-title">
-                    {{ task.examName }}
-                  </el-row>
-                  <el-row v-else class="task-title">
-                    {{ task.name }}
-                  </el-row>
-                  <el-row v-if="task.examId" class="task-info">
-                    截止时间: {{ task.endTime.substring(0, 16) }}
-                  </el-row>
-                  <el-row v-else class="task-info">
-                    截止时间: {{ timestampToTime(task.endAt) }}
-                  </el-row>
-                  <el-row v-if="task.examId" class="task-info">
-                    <el-tag v-if="this.state(task)==='NOT_STARTED'" size="small" type="info">未开始</el-tag>
-                    <el-tag v-else-if="this.state(task)==='RUNNING' && task.isJoined" size="small" type="success">已参加
-                    </el-tag>
-                    <el-tag v-else-if="this.state(task)==='RUNNING' && !task.isJoined" size="small">未参加</el-tag>
-                    <el-tag v-else-if="this.state(task)==='FINISHED'" size="small" type="info">已结束</el-tag>
-                    <el-tag v-else-if="this.state(task)==='CLOSED'" size="small" type="info">已关闭</el-tag>
+                  <el-row>
+                    <el-col :span="1">
+                      <el-tag v-if="task.examId" size="small" color="#8dc9e2" effect="dark" style="border: none">E</el-tag>
+                      <el-tag v-else size="small" color="#f5b86e" effect="dark" style="border: none">C</el-tag>
+                    </el-col>
+                    <el-col :span="5">
+                      <el-row v-if="task.examId" class="task-title">
+                        {{ task.examName }}
+                      </el-row>
+                      <el-row v-else class="task-title">
+                        {{ task.name }}
+                      </el-row>
+                    </el-col>
+                    <el-col :span="4">
+                      <el-row v-if="task.examId">
+                        <el-tag v-if="this.state(task)==='NOT_STARTED'" size="small" type="info">未开始</el-tag>
+                        <el-tag v-else-if="this.state(task)==='RUNNING' && task.isJoined" size="small" type="success">已参加</el-tag>
+                        <el-tag v-else-if="this.state(task)==='RUNNING' && !task.isJoined" size="small">未参加</el-tag>
+                        <el-tag v-else-if="this.state(task)==='FINISHED'" size="small" type="info">已结束</el-tag>
+                        <el-tag v-else-if="this.state(task)==='CLOSED'" size="small" type="info">已关闭</el-tag>
+                      </el-row>
+                      <el-row v-else>
+                        <el-tag v-if="this.state(task)==='NOT_STARTED'" size="small" type="info">未开始</el-tag>
+                        <el-tag v-else-if="this.state(task)==='RUNNING' && task.joined" size="small">已参加</el-tag>
+                        <el-tag v-else-if="this.state(task)==='RUNNING' && !task.joined" size="small">未参加</el-tag>
+                        <el-tag v-else-if="this.state(task)==='CLOSED'" size="small" type="info">已关闭</el-tag>
+                        <el-tag v-else-if="this.state(task)==='FINISHED'" size="small" type="danger">已结束</el-tag>
+                      </el-row>
+                    </el-col>
                   </el-row>
                   </el-row>
                 </div>
                 </div>
               </el-timeline-item>
               </el-timeline-item>
@@ -143,17 +152,17 @@
                         @delete="deleteAnnouncement(item, index)"/>
                         @delete="deleteAnnouncement(item, index)"/>
           </div>
           </div>
           <div v-else-if="tabName==='courseware'">
           <div v-else-if="tabName==='courseware'">
-            <!--          <div class="entry-header">-->
-            <!--            <span class="name">文件名</span>-->
-            <!--            <span class="size">文件大小</span>-->
-            <!--            <span class="uploadTime">上传时间</span>-->
-            <!--            <span class="operation">操作</span>-->
-            <!--          </div>-->
-            <!--          <FileEntry v-for="(entry,index) in fileEntryList"-->
-            <!--                     :key="index"-->
-            <!--                     :file-entry-info="entry"-->
-            <!--                     @downloadFileIconClick="handleDownloadFileIconClick"-->
-            <!--          ></FileEntry>-->
+            <div class="entry-header">
+              <span class="name">文件名</span>
+              <span class="size">文件大小</span>
+              <span class="uploadTime">上传时间</span>
+              <span class="operation">操作</span>
+            </div>
+            <FileEntry v-for="(entry,index) in fileEntryList"
+                       :key="index"
+                       :file-entry-info="entry"
+                       @downloadFileIconClick="handleDownloadFileIconClick"
+            ></FileEntry>
           </div>
           </div>
           <div v-else-if="tabName==='comment'">
           <div v-else-if="tabName==='comment'">
             <el-input v-model="commentContent" placeholder="发表一条友善的评论">
             <el-input v-model="commentContent" placeholder="发表一条友善的评论">
@@ -161,7 +170,24 @@
                 <el-button type="primary" @click="createComment">发表评论</el-button>
                 <el-button type="primary" @click="createComment">发表评论</el-button>
               </template>
               </template>
             </el-input>
             </el-input>
-            commentTree: {{ commentTree }}
+            <el-divider/>
+            <div class="comment">
+              <div v-for="message in commentTree" :key="message.id" class="comment-body">
+                <div class="comment-main">
+                  <el-row style="font-weight: bold; margin-bottom: 10px">
+                    <el-col>{{ message.mainMessage.sender.name }}</el-col>
+                    <el-col>{{ message.mainMessage.createdAt.substring(0, 16) }}</el-col>
+                  </el-row>
+                  <el-row>{{ message.mainMessage.content }}</el-row>
+                </div>
+                <div v-for="child in message.children" :key="child.id" class="comment-child">
+                  <el-row style="font-weight: bold; margin-bottom: 10px">{{ child.sender.name }}</el-row>
+                  <el-row>@{{ child.target.sender.username }}:{{ child.content }}</el-row>
+                </div>
+                <el-divider/>
+              </div>
+            </div>
+            <!--            commentTree: {{ commentTree }}-->
           </div>
           </div>
         </div>
         </div>
       </el-card>
       </el-card>
@@ -195,7 +221,7 @@
 <script>
 <script>
 import NoticeItem from "./components/NoticeItem";
 import NoticeItem from "./components/NoticeItem";
 import FileEntry from "./components/FileEntry";
 import FileEntry from "./components/FileEntry";
-import {ElMessageBox, ElMessage} from "element-plus";
+import { ElMessageBox, ElMessage } from "element-plus";
 import variables from "@/utils/variables";
 import variables from "@/utils/variables";
 
 
 export default {
 export default {
@@ -251,11 +277,11 @@ export default {
         color: "",
         color: "",
       },
       },
       noticeTypeMap: {
       noticeTypeMap: {
-        announce: {type: "公告", title: "发布公告", color: themeColor.orange},
-        homework: {type: "作业", title: "发布作业", color: themeColor.blue},
-        exam: {type: "考试", title: "发布考试", color: themeColor.red},
+        announce: { type: "公告", title: "发布公告", color: themeColor.orange },
+        homework: { type: "作业", title: "发布作业", color: themeColor.blue },
+        exam: { type: "考试", title: "发布考试", color: themeColor.red },
       },
       },
-      newNoticeInfo: {noticeDescription: "", priority: "1", fileList: []},
+      newNoticeInfo: { noticeDescription: "", priority: "1", fileList: [] },
       postNoticeInfo: {},
       postNoticeInfo: {},
       fileEntryList: [{
       fileEntryList: [{
         id: 1,
         id: 1,
@@ -338,8 +364,10 @@ export default {
       const date = new Date(timestamp);
       const date = new Date(timestamp);
       const Y = date.getFullYear() + "-";
       const Y = date.getFullYear() + "-";
       const M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
       const M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
-      const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
-      return Y + M + D;
+      const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
+      const h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
+      const m = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
+      return Y + M + D + h + m;
     },
     },
     // 任务
     // 任务
     courseTaskStatusColor(VO) {
     courseTaskStatusColor(VO) {
@@ -417,7 +445,7 @@ export default {
 
 
       function createAnnouncement() {
       function createAnnouncement() {
         let announcementVO = {
         let announcementVO = {
-          sender: {id: _this.$store.state.user.id,},
+          sender: { id: _this.$store.state.user.id, },
           courseId: _this.courseInfo.id,
           courseId: _this.courseInfo.id,
           title: _this.announcementForm.title,
           title: _this.announcementForm.title,
           content: _this.announcementForm.content,
           content: _this.announcementForm.content,
@@ -495,7 +523,7 @@ export default {
         confirmButtonText: "立即选课",
         confirmButtonText: "立即选课",
         cancelButtonText: "我再想想",
         cancelButtonText: "我再想想",
       })
       })
-        .then(({value}) => {
+        .then(({ value }) => {
           if (value !== this.courseInfo.invitationCode) {
           if (value !== this.courseInfo.invitationCode) {
             ElMessage.error("选课码错误");
             ElMessage.error("选课码错误");
           } else {
           } else {
@@ -588,6 +616,7 @@ export default {
         case "comment":
         case "comment":
           this.$apis.getCommentsByCourseId(this.$route.params.id)
           this.$apis.getCommentsByCourseId(this.$route.params.id)
             .then(res => {
             .then(res => {
+              console.log(res);
               this.commentTree = res.data.data;
               this.commentTree = res.data.data;
             })
             })
             .catch();
             .catch();
@@ -613,7 +642,7 @@ export default {
           createdAt: new Date(),
           createdAt: new Date(),
         })
         })
           .then(res => {
           .then(res => {
-            this.commentTree.push({mainMessage: res.data.data, children: []});
+            this.commentTree.push({ mainMessage: res.data.data, children: [] });
             this.commentContent = "";
             this.commentContent = "";
           })
           })
           .catch();
           .catch();

+ 16 - 0
src/views/CoursePage/style/CourseDetail.css

@@ -218,4 +218,20 @@
 
 
 .task-info {
 .task-info {
     padding: 5px 0 0 5px;
     padding: 5px 0 0 5px;
+}
+
+.comment {
+    margin: 30px 0 0 30px;
+}
+
+.comment-body {
+
+}
+
+.comment-main {
+
+}
+
+.comment-child {
+    padding: 20px 0 0 20px;
 }
 }

+ 2 - 1
src/views/TestPage/TestPage.vue

@@ -12,8 +12,9 @@
         <el-menu-item index="1">
         <el-menu-item index="1">
           <el-icon>
           <el-icon>
             <Document/>
             <Document/>
+<!--            todo 图标更改,数据要改-->
           </el-icon>
           </el-icon>
-          <span style="padding-left: 20px">全部测试</span>
+          <span style="padding-left: 20px">公开测试</span>
         </el-menu-item>
         </el-menu-item>
         <el-menu-item index="2">
         <el-menu-item index="2">
           <el-icon>
           <el-icon>