zengyicheng 2 سال پیش
والد
کامیت
1b64b8482d
1فایلهای تغییر یافته به همراه357 افزوده شده و 37 حذف شده
  1. 357 37
      src/components/studyStudent.vue

+ 357 - 37
src/components/studyStudent.vue

@@ -231,8 +231,7 @@
                           ].taskDetail
                         : '暂无描述'
                     "
-                  >
-                  </div>
+                  ></div>
                 </div>
               </div>
               <div class="vedioTaskBox">
@@ -408,7 +407,8 @@
                               : ''
                           "
                         >
-                          <span v-if="media.text">{{  media.text }}-</span>{{ media.name }}
+                          <span v-if="media.text">{{ media.text }}-</span
+                          >{{ media.name }}
                         </div>
                       </div>
                     </div>
@@ -549,7 +549,7 @@
                             isClickNav == 'word' + fileIndex ? 'isClickNav' : ''
                           "
                         >
-                        <span v-if="f.text">{{ f.text }}-</span>{{ f.name }}
+                          <span v-if="f.text">{{ f.text }}-</span>{{ f.name }}
                         </div>
                       </div>
                     </div>
@@ -953,6 +953,14 @@
                             />
                             <div style="margin: 5px 0">表格</div>
                           </div>
+                          <div v-if="tooC == 52">
+                            <img
+                              @click="addTools(tooC, toolIndex, taskCount)"
+                              src="../assets/icon/fourthToolList/text.png"
+                              alt
+                            />
+                            <div style="margin: 5px 0">文档</div>
+                          </div>
                           <div v-if="tooC == 49">
                             <img
                               @click="addTools(tooC, toolIndex, taskCount)"
@@ -966,8 +974,7 @@
                     </div>
                     <div class="tooldetail" v-if="tool.toolDetail != ''">
                       <!-- <div class="toolTitle">工具描述</div> -->
-                      <div v-html="contentConvent(tool.toolDetail)">
-                      </div>
+                      <div v-html="contentConvent(tool.toolDetail)"></div>
                     </div>
                     <el-button
                       type="primary"
@@ -4100,6 +4107,217 @@
                       </div>
                     </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      ((tType == 2 && sIsOpen == true) ||
+                        tType == 1 ||
+                        tType == 4) &&
+                      tool.tool.indexOf(52) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                    >
+                      <span>作业预览</span>
+                      <el-button
+                        type="text"
+                        @click="jump()"
+                        v-if="tType == 2"
+                        class="buttonA"
+                        >我的评价</el-button
+                      >
+                    </div>
+                    <div
+                      class="worksDetailBox"
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                    >
+                      <div
+                        class="works"
+                        style="
+                          width: 200px;
+                          height: 140px;
+                          margin: 10px 10px 10px 0;
+                          border-radius: 15px;
+                          box-shadow: 0 0 6px 1px #dfdada;
+                        "
+                        v-for="(w, wIndex) in worksStudent[toolIndex]"
+                        :key="wIndex"
+                        :class="w.type == 1 ? 'isTypeOne' : ''"
+                      >
+                        <div class="workImg">
+                          <img :src="word" @click="openTable(w)" alt />
+                          <!-- @click="openFile(w.works)" -->
+                          <div
+                            class="answerScore"
+                            v-if="w.score"
+                            @click.stop="openScore(w)"
+                            :class="{
+                              rightW:
+                                w.userid == userid ||
+                                tType == 1 ||
+                                tType == 4 ||
+                                w.ateacher == userid,
+                            }"
+                          >
+                            {{ JSON.parse(w.score).wScore }}分
+                          </div>
+                          <div
+                            class="answerScore"
+                            @click.stop="openScore(w)"
+                            v-else-if="courseDetail.userid == userid"
+                            :class="{
+                              rightW:
+                                w.userid == userid ||
+                                tType == 1 ||
+                                tType == 4 ||
+                                w.ateacher == userid,
+                            }"
+                          >
+                            评分
+                          </div>
+                          <img
+                            class="deleteImg"
+                            src="../assets/deleteworks.png"
+                            v-if="
+                              w.userid == userid || tType == 1 || tType == 4
+                            "
+                            @click.stop="deleteWorks(w.wid)"
+                            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="commentImg"
+                                @click="
+                                  isLikes(w.wid, userid, 1, null, w.isLikes)
+                                "
+                              >
+                                <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, toolIndex, wIndex)"
+                              >
+                                <img
+                                  src="../assets/icon/comment/comment.png"
+                                  alt=""
+                                />
+                              </div>
+                              <div>{{ w.commentCount }}</div>
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                    <div style="font-size: 18px">未提交</div>
+                    <div class="noWorksS">
+                      <div
+                        v-for="(s, sIndex) in noWorksS[toolIndex]"
+                        :key="sIndex"
+                        class="noWorksName"
+                      >
+                        {{ s.student }}
+                      </div>
+                    </div>
+                  </div>
+                  <div
+                    v-if="
+                      tType &&
+                      tType == 2 &&
+                      !sIsOpen &&
+                      tool.tool.indexOf(52) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <span>作业预览</span>
+                      <el-button
+                        type="text"
+                        @click="jump()"
+                        v-if="tType == 2"
+                        class="buttonA"
+                        >我的评价</el-button
+                      >
+                    </div>
+                    <div
+                      class="worksDetailBox"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <div
+                        class="works"
+                        style="
+                          width: 200px;
+                          height: 140px;
+                          margin: 10px 10px 10px 0;
+                          box-shadow: 0 0 6px 1px #dfdada;
+                        "
+                        v-for="(w, wIndex) in workStudent[toolIndex]"
+                        :key="wIndex"
+                      >
+                        <div class="workImg">
+                          <img :src="word" @click="openTable(w)" alt />
+                          <div
+                            class="answerScore"
+                            v-if="w.score"
+                            @click.stop="openScore(w)"
+                            :class="{
+                              rightW:
+                                w.userid == userid || tType == 1 || tType == 4,
+                            }"
+                          >
+                            {{ JSON.parse(w.score).wScore }}分
+                          </div>
+                          <div
+                            class="answerScore"
+                            @click.stop="openScore(w)"
+                            v-else-if="courseDetail.userid == userid"
+                            :class="{
+                              rightW:
+                                w.userid == userid || tType == 1 || tType == 4,
+                            }"
+                          >
+                            评分
+                          </div>
+                          <img
+                            class="deleteImg"
+                            src="../assets/deleteworks.png"
+                            v-if="
+                              w.userid == userid || tType == 1 || tType == 4
+                            "
+                            @click.stop="deleteWorks(w.wid)"
+                            alt
+                          />
+                        </div>
+                        <div class="worksName">
+                          <div>{{ w.sName }}</div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="tool.tool.indexOf(49) != -1"
                     class="xuan_right_box"
@@ -4817,8 +5035,7 @@
               class="pzContent cont"
               v-html="pz.content"
               v-if="pz.type == '1'"
-            >
-            </div>
+            ></div>
             <div class="pzContent" v-if="pz.type == '2'">
               <audio :src="pz.content" controls="controls" ref="audio">
                 Your browser does not support the audio element.
@@ -5022,8 +5239,18 @@
             <div class="a_add_head">
               <div style="display: flex">
                 {{ index1 + 1 + "、" }}
-                <div v-if="testJson.testJson[index1].type == '1'" style="margin-right:5px;">(单选题)</div>
-              <div v-if="testJson.testJson[index1].type == '2'" style="margin-right:5px;">(多选题)</div>
+                <div
+                  v-if="testJson.testJson[index1].type == '1'"
+                  style="margin-right: 5px"
+                >
+                  (单选题)
+                </div>
+                <div
+                  v-if="testJson.testJson[index1].type == '2'"
+                  style="margin-right: 5px"
+                >
+                  (多选题)
+                </div>
                 <div>题目:{{ testJson.testJson[index1].teststitle }}</div>
               </div>
               <img
@@ -6216,6 +6443,23 @@
         <el-button type="primary" @click="addTableWorks">确定</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+      title="文档"
+      :visible.sync="dialogVisibleWord"
+      :append-to-body="true"
+      width="95%"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <el-form>
+        <div>文档内容</div>
+        <editor-bar v-model="wordJson.text"></editor-bar>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleWord = false">取 消</el-button>
+        <el-button type="primary" @click="addWordWorks">确定</el-button>
+      </span>
+    </el-dialog>
     <el-dialog
       title="表格"
       :visible.sync="dialogVisibleTable2"
@@ -6975,6 +7219,7 @@ export default {
       dialogVisibleSentence1: false,
       dialogVisibleWorks: false,
       dialogVisibleTable: false,
+      dialogVisibleWord: false,
       dialogVisibleTable2: false,
       dialogVisibleGroupWork: false,
       dialogVisibleUpdateGroup: false,
@@ -7011,6 +7256,7 @@ export default {
       sentenceList: [{ sentenceTitle: "", addSentence: [], rightAnswer: [] }],
       sentenceList1: [],
       tableJson: [],
+      wordJson: [],
       vedio: [],
       text: [],
       textList: [],
@@ -7372,6 +7618,35 @@ export default {
           console.error(err);
         });
     },
+    addWordWorks() {
+      let params = {
+        uid: this.userid,
+        cid: this.id,
+        stage: this.courseType,
+        task: this.taskCount,
+        tool: this.toolindex,
+        content: JSON.stringify(this.wordJson).replaceAll(/%/g, "%25"),
+        type: 12,
+        atool: 52,
+      };
+      console.log(params);
+      this.ajax
+        .get(this.$store.state.api + "addCourseWorks3", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.dialogVisibleWord = false;
+          // this.selectAnswer = {};
+          this.selectSWorks();
+          this.selectStudent();
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+    },
     addCourseWorks(i) {
       var typesql;
       if (this.fileType === 0) {
@@ -7602,14 +7877,14 @@ export default {
               studentK = studentK.join(",");
               for (var j = 0; j < a.length; j++) {
                 if (studentK.indexOf(a[j].userid) == -1) {
-                  if(this.tcid){
-                    if(this.tcid == a[j].classid){
+                  if (this.tcid) {
+                    if (this.tcid == a[j].classid) {
                       this.noWorksS[i].push({
                         student: a[j].name,
                         userid: a[j].userid,
                       });
                     }
-                  }else{
+                  } else {
                     this.noWorksS[i].push({
                       student: a[j].name,
                       userid: a[j].userid,
@@ -7619,14 +7894,14 @@ export default {
               }
             } else {
               for (var k = 0; k < a.length; k++) {
-                if(this.tcid){
-                  if(this.tcid == a[k].classid){
+                if (this.tcid) {
+                  if (this.tcid == a[k].classid) {
                     this.noWorksS[i].push({
                       student: a[k].name,
                       userid: a[k].userid,
                     });
                   }
-                }else{
+                } else {
                   this.noWorksS[i].push({
                     student: a[k].name,
                     userid: a[k].userid,
@@ -7910,7 +8185,19 @@ export default {
                     userid: b[j].userid,
                     wid: b[j].id,
                   });
-                } else if (b[j].type == 12 && a[i].tool[0] == 32) {
+                } else if (b[j].type == 12 && a[i].atool[0] == 52) {
+                  //选择题
+                  this.workStudent[i].push({
+                    works: b[j].content,
+                    sName: b[j].name,
+                    score: b[j].score,
+                    img: b[j].img,
+                    type: 12,
+                    time: b[j].time,
+                    userid: b[j].userid,
+                    wid: b[j].id,
+                  });
+                }  else if (b[j].type == 12 && a[i].tool[0] == 32) {
                   //选择题
                   this.workStudent[i].push({
                     works: b[j].content,
@@ -8269,8 +8556,12 @@ export default {
                 this.worksStudent[i][gA] = [];
 
                 for (var g = 0; g < f.length; g++) {
-                  if(this.tcid && this.tcid != f[g].classid && f[g].ttype == 2){
-                    continue
+                  if (
+                    this.tcid &&
+                    this.tcid != f[g].classid &&
+                    f[g].ttype == 2
+                  ) {
+                    continue;
                   }
                   if (gA == f[g].group && f[g].tool == i) {
                     this.groupStudent[i][gA].push(f[g]);
@@ -8281,8 +8572,8 @@ export default {
               this.$forceUpdate();
             }
             for (var j = 0; j < b.length; j++) {
-              if(this.tcid && this.tcid != b[j].classid && b[j].ttype == 2){
-                  continue
+              if (this.tcid && this.tcid != b[j].classid && b[j].ttype == 2) {
+                continue;
               }
               var likesCount = 0;
               var commentCount = 0;
@@ -8651,6 +8942,23 @@ export default {
                     isLikes: isLikes,
                     commentJson: commentJson,
                   });
+                } else if (b[j].type == 12 && a[i].tool[0] == 52) {
+                  //选择题
+                  this.worksStudent[i].push({
+                    userid: b[j].userid,
+                    ateacher: b[j].ateacher,
+                    wid: b[j].id,
+                    works: b[j].content,
+                    sName: b[j].name,
+                    type: 12,
+                    time: b[j].time,
+                    score: b[j].score,
+                    img: b[j].img,
+                    likesCount: likesCount,
+                    commentCount: commentCount,
+                    isLikes: isLikes,
+                    commentJson: commentJson,
+                  });
                 } else if (b[j].type == 11 && a[i].tool[0] == 49) {
                   let _gindex = JSON.parse(b[j].content);
                   if (
@@ -9663,7 +9971,7 @@ export default {
               "DAT",
               "OGG",
               "OGM",
-              "MP3"
+              "MP3",
             ];
             for (var i = 0; i < a.length; i++) {
               var c = a[i].chapterData;
@@ -10086,18 +10394,18 @@ export default {
           });
           for (var r = 0; r < w.length; r++) {
             e = w[r].task;
-            if(this.chapInfoList[l].easy){
+            if (this.chapInfoList[l].easy) {
               this.navList[l].task.push({
-              taskName: q,
-              id: l + "-" + r,
-              isLook: w[r].isLook,
-            });
-            }else{
+                taskName: q,
+                id: l + "-" + r,
+                isLook: w[r].isLook,
+              });
+            } else {
               this.navList[l].task.push({
-              taskName: e,
-              id: l + "-" + r,
-              isLook: w[r].isLook,
-            });
+                taskName: e,
+                id: l + "-" + r,
+                isLook: w[r].isLook,
+              });
             }
 
             // this.navId = this.navId ? this.navId : l + "-" + r;
@@ -10956,6 +11264,18 @@ export default {
             )
           : { text: "" };
         this.dialogVisibleTable = true;
+      } else if (t == 52) {
+        this.wordJson = this.chapInfoList[this.courseType].chapterInfo[0]
+          .taskJson[index].toolChoose[i].wordJson
+          ? JSON.parse(
+              JSON.stringify(
+                this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+                  index
+                ].toolChoose[i].wordJson
+              )
+            )
+          : { text: "" };
+        this.dialogVisibleWord = true;
       } else if (t == 49) {
         this.groupJson =
           this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
@@ -11154,7 +11474,7 @@ export default {
       x.open("GET", _url, true);
       x.responseType = "blob";
       const loading = this.openLoading();
-      _this.$message.success("文件下载中...")
+      _this.$message.success("文件下载中...");
       x.onload = function (e) {
         loading.close();
         // const url = window.URL.createObjectURL(x.response);
@@ -13023,10 +13343,10 @@ export default {
 
 .navBox {
   background: #fff;
-    height: calc(100% - 40px);
-    padding: 5px 1px 0;
-    overflow-y: auto;
-    overflow-x: hidden;
+  height: calc(100% - 40px);
+  padding: 5px 1px 0;
+  overflow-y: auto;
+  overflow-x: hidden;
 }
 
 .worksBox {