Browse Source

修改bug问题

zengyicheng 2 years ago
parent
commit
446d6d4cc0
2 changed files with 261 additions and 132 deletions
  1. 151 66
      src/components/study.vue
  2. 110 66
      src/components/studyStudent.vue

+ 151 - 66
src/components/study.vue

@@ -942,6 +942,8 @@
                             width: 200px;
                             height: 140px;
                             margin: 10px 10px 10px 0;
+                            border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                           "
                           v-for="(w, wIndex) in worksStudent[jdIndex][rwIndex][
                             toolIndex
@@ -1051,7 +1053,7 @@
                             class="works"
                             style="
                               width: 240px;
-                              height: 170px;
+                              height: 140px;
                               border: 1px solid #f8f8f8;
                               border-radius: 10px;
                               box-shadow: 0 0 6px 1px #dfdada;
@@ -1244,6 +1246,8 @@
                             width: 200px;
                             height: 140px;
                             margin: 10px 10px 10px 0;
+                            border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                           "
                           v-for="(w, wIndex) in worksStudent[jdIndex][rwIndex][
                             toolIndex
@@ -1339,6 +1343,8 @@
                             width: 200px;
                             height: 140px;
                             margin: 10px 10px 10px 0;
+                            border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                           "
                           v-for="(w, wIndex) in worksStudent[jdIndex][rwIndex][
                             toolIndex
@@ -1434,6 +1440,8 @@
                             width: 200px;
                             height: 140px;
                             margin: 10px 10px 10px 0;
+                            border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                           "
                           v-for="(w, wIndex) in worksStudent[jdIndex][rwIndex][
                             toolIndex
@@ -1529,6 +1537,8 @@
                             width: 200px;
                             height: 140px;
                             margin: 10px 10px 10px 0;
+                            border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                           "
                           v-for="(w, wIndex) in worksStudent[jdIndex][rwIndex][
                             toolIndex
@@ -1620,7 +1630,7 @@
                       >
                         <div
                           class="works"
-                          style="width: 240px; height: 170px; overflow: hidden"
+                          style="width: 240px; height: 140px; overflow: hidden"
                           v-for="(w, wIndex) in worksStudent[jdIndex][rwIndex][
                             toolIndex
                           ]"
@@ -1685,72 +1695,56 @@
                       >
                         <div
                           class="works"
+                          style="
+                            width: 200px;
+                            height: 140px;
+                            margin: 10px 10px 10px 0;
+                            border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
+                          "
                           v-for="(w, wIndex) in worksStudent[jdIndex][rwIndex][
                             toolIndex
                           ]"
                           :key="wIndex"
                         >
-                          <div
-                            class="workImg"
-                            style="
-                              border-radius: 15px;
-                              box-shadow: 0px 0px 10px 10px #f2f2f2;
-                            "
-                          >
-                            <!-- <img
+                          <div class="workImg">
+                          <img
                             src="../assets/icon/works/noImg.png"
-                            @click="openTools(15, toolIndex, taskCount, w.works)"
-                            alt=""
-                          />-->
-                            <div
-                              class="answerBg"
-                              style="border-radius: 15px 15px 0 0"
-                            >
-                              <div>{{ w.sName }}</div>
-                              <el-tooltip
-                                class="item"
-                                effect="light"
-                                :content="w.works"
-                                placement="top"
-                              >
-                                <div class="answerContent">
-                                  {{ w.works }}
-                                </div>
-                              </el-tooltip>
-                            </div>
-                            <div class="comment">
-                              <div class="commentList">
-                                <div
-                                  class="commentImg"
-                                  @click="
-                                    isLikes(w.wid, userid, 1, null, w.isLikes)
-                                  "
-                                >
-                                  <img
-                                    :src="w.isLikes == true ? likes : noLikes"
-                                    alt=""
-                                  />
-                                </div>
-                                <div>{{ w.likesCount }}</div>
-                              </div>
+                            @click="openPj(w.works)"
+                            alt
+                          />
+                        </div>
+                        <div class="comment" style="min-width: 200px">
+                          <div class="worksName">
+                            <div>{{ w.sName }}</div>
+                          </div>
+                          <div class="commentList">
+                            <div class="commentList">
                               <div
-                                class="commentList"
-                                style="margin-right: 15px"
+                                class="commentImg"
+                                @click="
+                                  isLikes(w.wid, userid, 1, null, w.isLikes)
+                                "
                               >
-                                <div
-                                  class="commentImg"
-                                  @click="commentOther(w)"
-                                >
-                                  <img
-                                    src="../assets/icon/comment/comment.png"
-                                    alt=""
-                                  />
-                                </div>
-                                <div>{{ w.commentCount }}</div>
+                                <img
+                                  :src="w.isLikes == true ? likes : noLikes"
+                                  alt=""
+                                />
+                              </div>
+                              <div>{{ w.likesCount }}</div>
+                            </div>
+                            <div class="commentList" style="margin-right: 15px">
+                              <div class="commentImg" @click="commentOther(w)">
+                                <img
+                                  src="../assets/icon/comment/comment.png"
+                                  alt=""
+                                />
                               </div>
+                              <div>{{ w.commentCount }}</div>
                             </div>
                           </div>
                         </div>
+                        </div>
                       </div>
                       <div style="padding-top: 15px; font-size: 18px">
                         未提交
@@ -2159,7 +2153,7 @@
       :title="noteName != '' ? noteName : '查看问卷调查'"
       :visible.sync="dialogVisible5"
       :append-to-body="true"
-      width="800px"
+      width="1000px"
       :before-close="handleClose"
       class="dialog_diy"
     >
@@ -2402,7 +2396,7 @@
       title="查看视频"
       :visible.sync="videoVisible"
       :append-to-body="true"
-      width="600px"
+      width="1000px"
       :before-close="handleClose"
       class="dialog_diy"
     >
@@ -2427,7 +2421,7 @@
       title="查看详情"
       :visible.sync="commentDialogVisible"
       :append-to-body="true"
-      width="400px"
+      width="600px"
       :before-close="handleClose"
       class="dialog_diy"
     >
@@ -2490,7 +2484,35 @@
           class="worksAnswer"
           v-if="commentDetail.works && commentDetail.type == 4"
         >
-          {{ commentDetail.works }}
+          <div class="evalCss">
+            <div class="nav">请选择星星进行评分</div>
+            <div class="middleBox" v-if="eScore.eStar">
+              <div class="pfBox" v-for="(e, eIndex) in rateJson" :key="eIndex">
+                <div class="nameAndrate">
+                  <div>{{ e.value }}</div>
+                  <el-rate v-model="eScore.eStar[eIndex]"></el-rate>
+                </div>
+                <div>{{ e.detail }}</div>
+              </div>
+              <div class="bz">
+                <div>备注</div>
+                <textarea
+                  rows="4"
+                  class="pj"
+                  style="
+                    padding: 10px 5px;
+                    width: 70%;
+                    background: #f7f6f9;
+                    font-size: 14px;
+                    text-indent: 10px;
+                  "
+                  cols
+                  v-model="eScore.eBzText"
+                  placeholder="请输入评价内容..."
+                ></textarea>
+              </div>
+            </div>
+          </div>
         </div>
         <div class="comment">
           <div class="commentList">
@@ -2633,7 +2655,7 @@
           <div class="pfBox" v-for="(e, eIndex) in rateJson" :key="eIndex">
             <div class="nameAndrate">
               <div>{{ e.value }}</div>
-              <el-rate v-model="e.score" disabled></el-rate>
+              <el-rate v-model="eScore.eStar[eIndex]" disabled></el-rate>
             </div>
             <div>{{ e.detail }}</div>
           </div>
@@ -2650,7 +2672,7 @@
                 text-indent: 10px;
               "
               cols
-              v-model="bzText"
+              v-model="eScore.eBzText"
               placeholder="请输入评价内容..."
             ></textarea>
           </div>
@@ -2684,6 +2706,7 @@ export default {
       videoDetail: {},
       commentDetail: [],
       rateJson: [],
+      eScore: { eBzText: "", eStar: [] },
       id: this.$route.query.courseId,
       userid: this.$route.query.userid,
       classId: this.$route.query.cid,
@@ -3133,7 +3156,6 @@ export default {
     commentOther(w) {
       this.commentDetail = [];
       this.commentDialogVisible = true;
-      this.commentDetail = w;
       if (w.works && w.type == 1) {
         this.pptImgUrl = "";
         var a = ["PPT", "PPTX", "XLSX", "XLS", "DOC", "DOCX"];
@@ -3155,6 +3177,20 @@ export default {
           this.pptImgUrl = w.works;
           this.showPDF = true;
         }
+      } else if (w.works && w.type == 3 && this.commentDialogVisible == false) {
+        this.videoDetail = {};
+        this.playerOptions1.sources[0].src = w.works;
+        this.videoDetail = this.playerOptions1;
+        this.videoVisible = true;
+      } else if (w.works && w.type == 4) {
+        this.commentDetail = w;
+        this.eScore = JSON.parse(w.works);
+        this.rateJson =
+          this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+            this.taskCount
+          ].toolChoose[this.toolindex].rateJson;
+      } else {
+        this.commentDetail = w;
       }
     },
     addComment(wid, uid, t) {
@@ -4255,7 +4291,7 @@ export default {
           stage: this.courseType,
           task: this.taskCount,
           tool: this.toolindex,
-          content: this.bzText,
+          content: JSON.stringify(this.eScore),
           type: 6,
         },
       ];
@@ -4693,6 +4729,14 @@ export default {
         this.studentEvalDialogVisible = true;
       }
     },
+    openPj(w) {
+      this.eScore = JSON.parse(w);
+      this.rateJson =
+        this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+          this.taskCount
+        ].toolChoose[this.toolindex].rateJson;
+      this.studentEvalDialogVisible = true;
+    },
     toolsCount(a, t) {
       let params = {
         cid: this.id,
@@ -6452,7 +6496,6 @@ export default {
   align-items: center;
   justify-content: flex-end;
   height: 35px;
-  padding-right: 15px;
 }
 .commentList {
   display: flex;
@@ -6484,7 +6527,7 @@ export default {
   margin-left: 10px;
 }
 .worksAnswer {
-  color: #91b7a2;
+  color: #4078dd;
   margin: 10px 0;
   font-size: 16px;
 }
@@ -6509,4 +6552,46 @@ export default {
   align-items: baseline;
   color: #78787a;
 }
+.evalCss {
+  background: #fff;
+  font-size: 18px;
+}
+.nav {
+  color: #9d9d9d;
+  padding: 5px 0 15px 20px;
+}
+.middleBox {
+  padding: 5px 0 15px 20px;
+}
+.pfBox {
+  padding-bottom: 30px;
+}
+.nameAndrate {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  padding-bottom: 10px;
+}
+.nameAndrate > div {
+  margin-left: 10px;
+}
+.pfBox > div:nth-child(2) {
+  background: #f7f6f9;
+  width: 400px;
+  height: 45px;
+  border-radius: 10px;
+  text-indent: 18px;
+  line-height: 45px;
+  font-size: 16px;
+}
+.bz {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+}
+.bz > div {
+  padding: 0 10px;
+}
 </style>

+ 110 - 66
src/components/studyStudent.vue

@@ -937,7 +937,7 @@
                         class="works"
                         style="
                           width: 240px;
-                          height: 170px;
+                          height: 140px;
                           border: 1px solid #f8f8f8;
                           border-radius: 10px;
                           box-shadow: 0 0 6px 1px #dfdada;
@@ -1225,12 +1225,14 @@
                           width: 200px;
                           height: 140px;
                           margin: 10px 10px 10px 0;
+                          border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                         "
                         v-for="(w, wIndex) in worksStudent[toolIndex]"
                         :key="wIndex"
                         :class="w.type == 1 ? 'isTypeOne' : ''"
                       >
-                        <div class="workImg" v-if="w.type == 0">
+                        <div class="workImg" v-if="w.type == 0" >
                           <img
                             :src="w.works"
                             @click="previewImg(w.works)"
@@ -1325,7 +1327,7 @@
                           class="works"
                           style="
                             width: 240px;
-                            height: 170px;
+                            height: 140px;
                             border: 1px solid #f8f8f8;
                             border-radius: 10px;
                             box-shadow: 0 0 6px 1px #dfdada;
@@ -1503,6 +1505,8 @@
                           width: 200px;
                           height: 140px;
                           margin: 10px 10px 10px 0;
+                          border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                         "
                         v-for="(w, wIndex) in worksStudent[toolIndex]"
                         :key="wIndex"
@@ -1588,6 +1592,8 @@
                           width: 200px;
                           height: 140px;
                           margin: 10px 10px 10px 0;
+                          border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                         "
                         v-for="(w, wIndex) in worksStudent[toolIndex]"
                         :key="wIndex"
@@ -1673,6 +1679,8 @@
                           width: 200px;
                           height: 140px;
                           margin: 10px 10px 10px 0;
+                          border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                         "
                         v-for="(w, wIndex) in worksStudent[toolIndex]"
                         :key="wIndex"
@@ -1758,6 +1766,8 @@
                           width: 200px;
                           height: 140px;
                           margin: 10px 10px 10px 0;
+                          border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
                         "
                         v-for="(w, wIndex) in worksStudent[toolIndex]"
                         :key="wIndex"
@@ -1839,7 +1849,7 @@
                     >
                       <div
                         class="works"
-                        style="width: 240px; height: 170px; overflow: hidden"
+                        style="width: 240px; height: 140px; overflow: hidden"
                         v-for="(w, wIndex) in worksStudent[toolIndex]"
                         :key="wIndex"
                         :class="w.type == 1 ? 'isTypeOne' : ''"
@@ -1900,38 +1910,29 @@
                     >
                       <div
                         class="works"
+                        style="
+                          width: 200px;
+                          height: 140px;
+                          margin: 10px 10px 10px 0;
+                          border-radius: 15px;
+                            box-shadow: 0px 0px 10px 10px #f2f2f2;
+                        "
                         v-for="(w, wIndex) in worksStudent[toolIndex]"
                         :key="wIndex"
+                        :class="w.type == 1 ? 'isTypeOne' : ''"
                       >
-                        <div
-                          class="workImg"
-                          style="
-                            border-radius: 15px;
-                            box-shadow: 0px 0px 10px 10px #f2f2f2;
-                          "
-                        >
-                          <!-- <img
+                        <div class="workImg">
+                          <img
                             src="../assets/icon/works/noImg.png"
-                            @click="openTools(15, toolIndex, taskCount, w.works)"
-                            alt=""
-                          />-->
-                          <div
-                            class="answerBg"
-                            style="border-radius: 15px 15px 0 0"
-                          >
+                            @click="openPj(w.works)"
+                            alt
+                          />
+                        </div>
+                        <div class="comment" style="min-width: 200px">
+                          <div class="worksName">
                             <div>{{ w.sName }}</div>
-                            <el-tooltip
-                              class="item"
-                              effect="light"
-                              :content="w.works"
-                              placement="top"
-                            >
-                              <div class="answerContent">
-                                {{ w.works }}
-                              </div>
-                            </el-tooltip>
                           </div>
-                          <div class="comment">
+                          <div class="commentList">
                             <div class="commentList">
                               <div
                                 class="commentImg"
@@ -1986,28 +1987,23 @@
                     >
                       <div
                         class="works"
+                        style="
+                          width: 200px;
+                          height: 140px;
+                          margin: 10px 10px 10px 0;
+                        "
                         v-for="(w, wIndex) in workStudent[toolIndex]"
                         :key="wIndex"
                       >
                         <div class="workImg">
-                          <!-- <img
+                          <img
                             src="../assets/icon/works/noImg.png"
-                            @click="openTools(15, toolIndex, taskCount, w.works)"
-                            alt=""
-                          />-->
-                          <div class="answerBg">
-                            <div>{{ w.sName }}</div>
-                            <el-tooltip
-                              class="item"
-                              effect="light"
-                              :content="w.works"
-                              placement="top"
-                            >
-                              <div class="answerContent">
-                                {{ w.works }}
-                              </div>
-                            </el-tooltip>
-                          </div>
+                            @click="openPj(w.works)"
+                            alt
+                          />
+                        </div>
+                        <div class="worksName">
+                          <div>{{ w.sName }}</div>
                         </div>
                       </div>
                     </div>
@@ -2402,7 +2398,7 @@
       :title="noteName != '' ? noteName : '查看问卷调查'"
       :visible.sync="dialogVisible5"
       :append-to-body="true"
-      width="800px"
+      width="1000px"
       :before-close="handleClose"
       class="dialog_diy"
     >
@@ -2645,7 +2641,7 @@
       title="查看视频"
       :visible.sync="videoVisible"
       :append-to-body="true"
-      width="600px"
+      width="1000px"
       :before-close="handleClose"
       class="dialog_diy"
     >
@@ -2670,7 +2666,7 @@
       title="查看详情"
       :visible.sync="commentDialogVisible"
       :append-to-body="true"
-      width="400px"
+      width="600px"
       :before-close="handleClose"
       class="dialog_diy"
     >
@@ -2733,7 +2729,35 @@
           class="worksAnswer"
           v-if="commentDetail.works && commentDetail.type == 4"
         >
-          {{ commentDetail.works }}
+          <div class="evalCss">
+            <div class="nav">请选择星星进行评分</div>
+            <div class="middleBox" v-if="eScore.eStar">
+              <div class="pfBox" v-for="(e, eIndex) in rateJson" :key="eIndex">
+                <div class="nameAndrate">
+                  <div>{{ e.value }}</div>
+                  <el-rate v-model="eScore.eStar[eIndex]"></el-rate>
+                </div>
+                <div>{{ e.detail }}</div>
+              </div>
+              <div class="bz">
+                <div>备注</div>
+                <textarea
+                  rows="4"
+                  class="pj"
+                  style="
+                    padding: 10px 5px;
+                    width: 70%;
+                    background: #f7f6f9;
+                    font-size: 14px;
+                    text-indent: 10px;
+                  "
+                  cols
+                  v-model="eScore.eBzText"
+                  placeholder="请输入评价内容..."
+                ></textarea>
+              </div>
+            </div>
+          </div>
         </div>
         <div class="comment">
           <div class="commentList">
@@ -2888,11 +2912,11 @@
     >
       <div class="evalCss">
         <div class="nav">请选择星星进行评分</div>
-        <div class="middleBox">
-          <div class="pfBox" v-for="(e,eIndex) in rateJson" :key="eIndex">
+        <div class="middleBox" v-if="eScore.eStar">
+          <div class="pfBox" v-for="(e, eIndex) in rateJson" :key="eIndex">
             <div class="nameAndrate">
-              <div>{{ e.value }} </div>
-              <el-rate v-model="e.score" disabled></el-rate>
+              <div>{{ e.value }}</div>
+              <el-rate v-model="eScore.eStar[eIndex]"></el-rate>
             </div>
             <div>{{ e.detail }}</div>
           </div>
@@ -2909,7 +2933,7 @@
                 text-indent: 10px;
               "
               cols
-              v-model="bzText"
+              v-model="eScore.eBzText"
               placeholder="请输入评价内容..."
             ></textarea>
           </div>
@@ -2940,9 +2964,10 @@ export default {
       commentDialogVisible: false,
       videoVisible: false,
       studentEvalDialogVisible: false,
-      bzText:"",
+      bzText: "",
       commentDetail: [],
       videoDetail: {},
+      eScore: { eBzText: "", eStar: [] },
       id: this.$route.query.courseId,
       userid: this.$route.query.userid,
       classId: this.$route.query.cid,
@@ -3405,7 +3430,6 @@ export default {
     commentOther(w) {
       this.commentDetail = [];
       this.commentDialogVisible = true;
-      this.commentDetail = w;
       if (w.works && w.type == 1) {
         this.pptImgUrl = "";
         var a = ["PPT", "PPTX", "XLSX", "XLS", "DOC", "DOCX"];
@@ -3427,11 +3451,20 @@ export default {
           this.pptImgUrl = w.works;
           this.showPDF = true;
         }
-      } else if (w.works && w.type == 3) {
+      } else if (w.works && w.type == 3 && this.commentDialogVisible == false) {
         this.videoDetail = {};
         this.playerOptions1.sources[0].src = w.works;
         this.videoDetail = this.playerOptions1;
         this.videoVisible = true;
+      } else if (w.works && w.type == 4) {
+        this.commentDetail = w;
+        this.eScore = JSON.parse(w.works);
+        this.rateJson =
+          this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+            this.taskCount
+          ].toolChoose[this.toolindex].rateJson;
+      } else {
+        this.commentDetail = w;
       }
     },
     addComment(wid, uid, t) {
@@ -3459,7 +3492,14 @@ export default {
           console.error(err);
         });
     },
-
+    openPj(w) {
+      this.eScore = JSON.parse(w);
+      this.rateJson =
+        this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+          this.taskCount
+        ].toolChoose[this.toolindex].rateJson;
+      this.studentEvalDialogVisible = true;
+    },
     selectSWorks() {
       //教师查看全部作业
       let params = {
@@ -3567,7 +3607,10 @@ export default {
                   }
                 }
                 if (
-                  (b[j].type == 1 || b[j].type == 4 || b[j].type == 5 || b[j].type == 6) &&
+                  (b[j].type == 1 ||
+                    b[j].type == 4 ||
+                    b[j].type == 5 ||
+                    b[j].type == 6) &&
                   a[i].tool[0] != 15 &&
                   a[i].tool[0] != 4
                 ) {
@@ -3607,7 +3650,7 @@ export default {
                       isLikes: isLikes,
                       commentJson: commentJson,
                     });
-                  }else if(b[j].type == 6){
+                  } else if (b[j].type == 6) {
                     this.worksStudent[i].push({
                       wid: b[j].id,
                       works: b[j].content,
@@ -4467,6 +4510,7 @@ export default {
         this.dialogVisible3 = true;
       }
     },
+
     downFile(f, i) {
       this.isClickNav = "";
       this.pptImgUrl1 = "";
@@ -4505,7 +4549,7 @@ export default {
     openAddWork() {
       this.dialogVisible = true;
     },
-    addBzWorks(){
+    addBzWorks() {
       let params = [
         {
           uid: this.userid,
@@ -4513,7 +4557,7 @@ export default {
           stage: this.courseType,
           task: this.taskCount,
           tool: this.toolindex,
-          content: this.bzText,
+          content: JSON.stringify(this.eScore),
           type: 6,
         },
       ];
@@ -4524,7 +4568,7 @@ export default {
             message: "提交成功",
             type: "success",
           });
-          this.bzText = "";
+          this.eScore = { eBzText: "", eStar: [] };
           this.studentEvalDialogVisible = false;
         })
         .catch((err) => {
@@ -6677,7 +6721,7 @@ export default {
   margin-left: 10px;
 }
 .worksAnswer {
-  color: #91b7a2;
+  color: #4078dd;
   margin: 10px 0;
   font-size: 16px;
 }