소스 검색

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table

zengyicheng 2 년 전
부모
커밋
ce25da9d94
2개의 변경된 파일154개의 추가작업 그리고 172개의 파일을 삭제
  1. 1 1
      src/components/pages/components/data/scoreData.vue
  2. 153 171
      src/components/pages/worksDetail.vue

+ 1 - 1
src/components/pages/components/data/scoreData.vue

@@ -91,7 +91,7 @@ export default {
         { value: 0, name: "意识能力" },
         { value: 0, name: "科学探究能力" },
         { value: 0, name: "实践创新能力" },
-        { value: 0, name: "学习房媳能力" },
+        { value: 0, name: "学习反思能力" },
         { value: 0, name: "工程思维能力" },
       ];
       this.scoreJson.forEach((item) => {

+ 153 - 171
src/components/pages/worksDetail.vue

@@ -16,10 +16,7 @@
       <div class="student_head">
         <div style="padding: 10px 0px 20px 0">
           <el-breadcrumb separator-class="el-icon-arrow-right">
-            <el-breadcrumb-item
-              :to="{ path: '/works?userid=' + userid + '&oid=' + oid }"
-              >评价管理</el-breadcrumb-item
-            >
+            <el-breadcrumb-item :to="{ path: '/works?userid=' + userid + '&oid=' + oid }">评价管理</el-breadcrumb-item>
             <el-breadcrumb-item>作业管理</el-breadcrumb-item>
           </el-breadcrumb>
         </div>
@@ -37,13 +34,9 @@
 							:label="item.name"
 							:value="item.id"
 						></el-option>
-					</el-select> -->
-          <el-select
-            v-model="sClass"
-            placeholder="请选择班级"
-            @change="searchWork"
-          >
-            <el-option label="所有班级" value=""></el-option>
+          </el-select>-->
+          <el-select v-model="sClass" placeholder="请选择班级" @change="searchWork">
+            <el-option label="所有班级" value></el-option>
             <el-option
               v-for="(item, index) in grade"
               :key="index"
@@ -68,45 +61,23 @@
           :row-class-name="tableRowClassName"
           stripe
         >
-          <el-table-column
-            prop="sName"
-            label="姓名"
-            min-width="15"
-            align="center"
-          ></el-table-column>
-          <el-table-column
-            prop="class"
-            label="班级"
-            min-width="20"
-            align="center"
-          ></el-table-column>
-          <el-table-column
-            prop="course"
-            label="项目"
-            min-width="20"
-            align="center"
-          ></el-table-column>
-          <el-table-column
-            prop="time"
-            label="时间"
-            min-width="15"
-            align="center"
-          ></el-table-column>
+          <el-table-column prop="sName" label="姓名" min-width="15" align="center"></el-table-column>
+          <el-table-column prop="class" label="班级" min-width="20" align="center"></el-table-column>
+          <el-table-column prop="course" label="项目" min-width="20" align="center"></el-table-column>
+          <el-table-column prop="time" label="时间" min-width="15" align="center"></el-table-column>
           <el-table-column label="操作" min-width="30">
             <template slot-scope="scope">
               <el-button
                 type="primary"
                 size="small"
                 @click="lookWork(scope.row.id, scope.row.userid)"
-                >查看作业</el-button
-              >
+              >查看作业</el-button>
               <el-button
                 class="de_button"
                 type="primary"
                 size="small"
                 @click="deleteWork(scope.row.id)"
-                >删除</el-button
-              >
+              >删除</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -116,24 +87,20 @@
           :before-close="handleClose"
           class="add_work"
         >
-          <div class="zyBox">
+          <div class="zyBox" v-for="(item,index) in worksDetail" :key="index">
             <div class="left">
               <div class="courseTitle">
                 {{
-                  chapInfo[publicIndex] != null &&
-                  chapInfo[publicIndex].dyName != null &&
-                  chapInfo[publicIndex].dyName != ""
-                    ? chapInfo[publicIndex].dyName
-                    : "暂无内容"
+                '第'+(item.stage+1)+'阶段'+item.chapterTitle
                 }}
               </div>
 
-              <div class="bigImg" v-if="tType == 0">
+              <div class="bigImg" v-if="item.tType == 0">
                 <video-player
                   class="video-player vjs-custom-skin"
                   ref="videoPlayer"
                   :playsinline="true"
-                  :options="playerO"
+                  :options="item.playerO"
                   @play="onPlayerPlay($event)"
                   style="width: 100%; height: 100%"
                 ></video-player>
@@ -141,50 +108,43 @@
               <div class="bigImg" v-else>
                 <img
                   :src="
-                    thumbnail.length > 0 && thumbnail[1].length > 0
-                      ? thumbnail[1][0].url
+                    item.thumbnail.length > 0 ? item.thumbnail[1][0].url
                       : ''
                   "
-                  alt=""
+                  alt
                 />
               </div>
               <div class="thumbnail">
                 <div
                   style="background: #a3d4ff"
-                  :class="tType == 0 ? 'isClick' : ''"
+                  v-if="item.upVedio.length"
+                  :class="item.tType == 0 ? 'isClick' : ''"
                 >
-                  <img
-                    src="../../assets/icon/spIcon.png"
-                    alt=""
-                    @click="tType = 0"
-                  />
+                  <img src="../../assets/icon/spIcon.png" alt @click="item.tType = 0" />
                 </div>
-                <div :class="tType == 1 ? 'isClick' : ''">
+                <div :class="item.tType == 1 ? 'isClick' : ''">
                   <img
                     :src="
-                      thumbnail.length > 0 && thumbnail[1].length > 0
-                        ? thumbnail[1][0].url
-                        : ''
-                    "
-                    alt=""
-                    @click="tType = 1"
+                    item.thumbnail.length > 0 ? item.thumbnail[1][0].url
+                      : ''
+                  "
+                    alt
+                    @click="item.tType = 1"
                   />
                 </div>
               </div>
               <div style="margin: 5px 10px">{{ sInfo.course }}</div>
               <div class="student_Answer">
                 <div class="toux">
-                  <img :src="sInfo.tx != null ? sInfo.tx : tx" alt="" />
+                  <img :src="sInfo.tx != null ? sInfo.tx : tx" alt />
                 </div>
                 <div class="nav">
                   <div class="studentName">{{ sInfo.sName }}</div>
                   <div class="studentAnswer">
                     {{
-                      chapInfo[publicIndex] != null &&
-                      chapInfo[publicIndex].content != null &&
-                      chapInfo[publicIndex].content != ""
-                        ? chapInfo[publicIndex].content
-                        : "暂无内容"
+                    item.content != ""
+                    ? item.content
+                    : "暂无内容"
                     }}
                     <!-- 雨荒深院菊,霜倒半池莲.唐杜甫《宿赞公房》 -->
                   </div>
@@ -194,7 +154,8 @@
             <div class="right">
               <div class="comment">
                 <div class="comment_title">
-                  评论<span>({{ this.commentCount }})</span>
+                  评论
+                  <span>({{ commentCount }})</span>
                 </div>
                 <div class="other_Answer">暂无学生评论</div>
                 <!-- <div class="other_Answer">
@@ -208,7 +169,7 @@
 										</div>
 										<div class="otherAnswer">{{ this.commentAnswer }}</div>
 									</div>
-								</div> -->
+                </div>-->
               </div>
               <div
                 class="lastTop"
@@ -228,64 +189,33 @@
                     placeholder="还有要说的吗..."
                     :rows="8"
                     resize="none"
-                    v-model="rateList.content"
-                    :readonly="
-                      rateParams[5] != '' && rateParams[5] != undefined
-                    "
+                    v-model="item.rate.content"
                     style="background: #fafafa"
                   ></el-input>
                 </div>
               </div>
             </div>
             <div style="width: 290px">
-              <div
-                class="sd_score"
-                style="box-sizing: border-box; width: 100%; box-shadow: none"
-              >
+              <div class="sd_score" style="box-sizing: border-box; width: 100%; box-shadow: none">
                 <div class="score_box">
-                  <span>意识能力</span
-                  ><el-rate
-                    v-model="rateList.ca"
-                    :disabled="
-                      rateParams[5] != '' && rateParams[5] != undefined
-                    "
-                  ></el-rate>
+                  <span>意识能力</span>
+                  <el-rate v-model="item.rate.ca"></el-rate>
                 </div>
                 <div class="score_box">
-                  <span>科学探究能力</span
-                  ><el-rate
-                    v-model="rateList.sia"
-                    :disabled="
-                      rateParams[5] != '' && rateParams[5] != undefined
-                    "
-                  ></el-rate>
+                  <span>科学探究能力</span>
+                  <el-rate v-model="item.rate.sia"></el-rate>
                 </div>
                 <div class="score_box">
-                  <span>实践创新能力</span
-                  ><el-rate
-                    v-model="rateList.eta"
-                    :disabled="
-                      rateParams[5] != '' && rateParams[5] != undefined
-                    "
-                  ></el-rate>
+                  <span>实践创新能力</span>
+                  <el-rate v-model="item.rate.eta"></el-rate>
                 </div>
                 <div class="score_box">
-                  <span>学习反思能力</span
-                  ><el-rate
-                    v-model="rateList.pia"
-                    :disabled="
-                      rateParams[5] != '' && rateParams[5] != undefined
-                    "
-                  ></el-rate>
+                  <span>学习反思能力</span>
+                  <el-rate v-model="item.rate.pia"></el-rate>
                 </div>
                 <div class="score_box">
-                  <span>工程思维能力</span
-                  ><el-rate
-                    v-model="rateList.lra"
-                    :disabled="
-                      rateParams[5] != '' && rateParams[5] != undefined
-                    "
-                  ></el-rate>
+                  <span>工程思维能力</span>
+                  <el-rate v-model="item.rate.lra"></el-rate>
                 </div>
               </div>
               <div class="data_body">
@@ -295,15 +225,14 @@
                 <div style="width: 100%">
                   <!-- <img src="../../assets/dataimage/1.png" style="width:90%" /> -->
                   <div
-                    id="charts_canvas"
-                    class="echart"
+                    class="echart charts_canvas"
                     style="width: 100%; height: 100%; margin: 0 0 0 1rem"
                   ></div>
                 </div>
               </div>
             </div>
             <!-- <div class="rbButtom" @click="giveScore">评分</div> -->
-            <div class="rbButtom" @click="updateWorks">评分</div>
+            <div class="rbButtom" @click="updateWorks(item.id,item.rate,index)">评分</div>
           </div>
         </el-dialog>
         <el-dialog
@@ -316,13 +245,13 @@
           <div slot="title" class="header-title">
             <!-- <div class="logoImg">
               <img src="../../assets/logo.png" alt="" />
-            </div> -->
+            </div>-->
             <div class="title_add_student">"评分"</div>
           </div>
           <div class="firstTop">
             <div class="score_top">
               <div class="userTou">
-                <img :src="sInfo.tx != null ? sInfo.tx : tx" alt="" />
+                <img :src="sInfo.tx != null ? sInfo.tx : tx" alt />
               </div>
               <div class="score_user_name">{{ sInfo.sName }}</div>
             </div>
@@ -330,9 +259,9 @@
               <div>课程名称</div>
               <div>
                 {{
-                  chapInfo[publicIndex] != null
-                    ? chapInfo[publicIndex].dyName
-                    : "暂无课程"
+                chapInfo[publicIndex] != null
+                ? chapInfo[publicIndex].dyName
+                : "暂无课程"
                 }}
               </div>
             </div>
@@ -340,36 +269,36 @@
 
           <div class="sd_score">
             <div class="score_box">
-              <span>意识能力</span
-              ><el-rate
+              <span>意识能力</span>
+              <el-rate
                 v-model="rateList.ca"
                 :disabled="rateParams[5] != '' && rateParams[5] != undefined"
               ></el-rate>
             </div>
             <div class="score_box">
-              <span>科学探究能力</span
-              ><el-rate
+              <span>科学探究能力</span>
+              <el-rate
                 v-model="rateList.sia"
                 :disabled="rateParams[5] != '' && rateParams[5] != undefined"
               ></el-rate>
             </div>
             <div class="score_box">
-              <span>实践创新能力</span
-              ><el-rate
+              <span>实践创新能力</span>
+              <el-rate
                 v-model="rateList.eta"
                 :disabled="rateParams[5] != '' && rateParams[5] != undefined"
               ></el-rate>
             </div>
             <div class="score_box">
-              <span>学习反思能力</span
-              ><el-rate
+              <span>学习反思能力</span>
+              <el-rate
                 v-model="rateList.pia"
                 :disabled="rateParams[5] != '' && rateParams[5] != undefined"
               ></el-rate>
             </div>
             <div class="score_box">
-              <span>工程思维能力</span
-              ><el-rate
+              <span>工程思维能力</span>
+              <el-rate
                 v-model="rateList.lra"
                 :disabled="rateParams[5] != '' && rateParams[5] != undefined"
               ></el-rate>
@@ -390,9 +319,7 @@
             </div>
           </div>
 
-          <div class="assess_right" @click="updateWorks" v-if="!uploadBoolean">
-            提交
-          </div>
+          <div class="assess_right" @click="updateWorks" v-if="!uploadBoolean">提交</div>
           <div class="assess_right" @click="updateWorks" v-else>提交</div>
         </el-dialog>
       </div>
@@ -404,12 +331,11 @@
           :total="total"
           v-if="page"
           @current-change="handleCurrentChange"
-        >
-        </el-pagination>
+        ></el-pagination>
       </div>
     </div>
     <el-dialog :visible.sync="pictureDialog" size="tiny">
-      <img width="100%" :src="dialogImageUrl" alt="" />
+      <img width="100%" :src="dialogImageUrl" alt />
     </el-dialog>
   </div>
 </template>
@@ -497,12 +423,12 @@ export default {
       vedio: [],
       file: [],
       tType: 0,
-      chartObj: null,
+      chartObj: [],
       ooption: [
         { value: 0, name: "意识能力" },
         { value: 0, name: "科学探究能力" },
         { value: 0, name: "实践创新能力" },
-        { value: 0, name: "学习房媳能力" },
+        { value: 0, name: "学习反思能力" },
         { value: 0, name: "工程思维能力" },
       ],
       option: {
@@ -619,6 +545,34 @@ export default {
             }
           });
 
+          worksDetail.filter((value, index, array) => {
+            var c = JSON.parse(value.content)[0];
+            var d =
+              value.rate != null && value.rate != ""
+                ? JSON.parse(value.rate)
+                : { ca: 0, sia: 0, eta: 0, pia: 0, lra: 0, content: "" };
+            var e = value.rate != null && value.rate != "" ? 0 : 1;
+            value.rateWrong = e;
+            value.chapterTitle = this.chapInfo[value.stage].dyName;
+            value.content = c.content;
+            value.rate = d;
+            value.cover = c.cover;
+            value.upVedio = c.upVedio;
+            value.thumbnail = [c.upVedio, c.cover];
+            if (c.upVedio.length) {
+              value.tType = 0;
+            } else {
+              value.tType = 1;
+            }
+
+            value.playerO = JSON.parse(JSON.stringify(this.playerOptions));
+            value.playerO.sources[0].src =
+              c.upVedio.length > 0
+                ? c.upVedio[0].url
+                : require("../../assets/icon/kc1.png");
+          });
+          this.worksDetail = worksDetail;
+
           this.courseDetail = res.data[0][0];
           this.playerOptions.sources[0].src =
             this.chapInfo[this.publicIndex].upVedio.length > 0
@@ -630,23 +584,43 @@ export default {
           this.rateList = this.chapInfo[this.publicIndex].rate;
           this.dialogVisible3 = true;
 
-          this.ooption[0].value = this.rateList.ca;
-          this.ooption[1].value = this.rateList.sia;
-          this.ooption[2].value = this.rateList.eta;
-          this.ooption[3].value = this.rateList.pia;
-          this.ooption[4].value = this.rateList.lra;
-          if (this.chartObj) {
-            this.option.series[0].data = this.ooption;
-            this.chartObj.setOption(this.option);
-          } else {
-            this.setChart(this.ooption);
-          }
+          // this.ooption[0].value = this.rateList.ca;
+          // this.ooption[1].value = this.rateList.sia;
+          // this.ooption[2].value = this.rateList.eta;
+          // this.ooption[3].value = this.rateList.pia;
+          // this.ooption[4].value = this.rateList.lra;
+          // if (this.chartObj) {
+          //   this.option.series[0].data = this.ooption;
+          //   this.chartObj.setOption(this.option);
+          // } else {
+          //   this.setChart(this.ooption);
+          // }
+
+          setTimeout(() => {
+            worksDetail.filter((value, index, array) => {
+              var _ooption = JSON.parse(JSON.stringify(this.ooption));
+              var _option = JSON.parse(JSON.stringify(this.option));
+
+              _ooption[0].value = value.rate.ca;
+              _ooption[1].value = value.rate.sia;
+              _ooption[2].value = value.rate.eta;
+              _ooption[3].value = value.rate.pia;
+              _ooption[4].value = value.rate.lra;
+              if (this.chartObj[index]) {
+                _option.series[0].data = _ooption;
+                this.chartObj[index].setOption(_option);
+              } else {
+                _option.series[0].data = _ooption;
+                this.setChart(index, _option);
+              }
+            });
+          }, 0);
         })
         .catch((err) => {
           console.error(err);
         });
     },
-    setChart(option) {
+    setChart(index, option) {
       let _this = this;
       // 雷达图显示的标签
       let newPromise = new Promise((resolve) => {
@@ -659,12 +633,11 @@ export default {
         const chartObj = _this.$echarts.init(
           //劳动课程
           // _this.$el.querySelector("#charts_canvas")
-          document.getElementById("charts_canvas")
+          document.getElementsByClassName("charts_canvas")[index]
         );
-        _this.option.series[0].data = option;
         // 初始化雷达图
-        _this.chartObj = chartObj;
-        _this.chartObj.setOption(_this.option);
+        _this.chartObj[index] = chartObj;
+        _this.chartObj[index].setOption(option);
       });
     },
     // doingAssess(index) {
@@ -760,11 +733,11 @@ export default {
       this.dialogImageUrl = url;
       this.pictureDialog = true;
     },
-    updateWorks() {
+    updateWorks(id, rate, index) {
       let params = {
-        rate: this.rateList,
+        rate: rate,
         tuid: this.userid,
-        id: this.scopeId,
+        id: id,
       };
       this.ajax
         .get(this.$store.state.api + "updateWorks", params)
@@ -773,16 +746,19 @@ export default {
             message: "评价成功",
             type: "success",
           });
-          this.ooption[0].value = this.rateList.ca;
-          this.ooption[1].value = this.rateList.sia;
-          this.ooption[2].value = this.rateList.eta;
-          this.ooption[3].value = this.rateList.pia;
-          this.ooption[4].value = this.rateList.lra;
-          if (this.chartObj) {
-            this.option.series[0].data = this.ooption;
-            this.chartObj.setOption(this.option);
+          var _ooption = JSON.parse(JSON.stringify(this.ooption));
+          var _option = JSON.parse(JSON.stringify(this.option));
+
+          _ooption[0].value = rate.ca;
+          _ooption[1].value = rate.sia;
+          _ooption[2].value = rate.eta;
+          _ooption[3].value = rate.pia;
+          _ooption[4].value = rate.lra;
+          if (this.chartObj[index]) {
+            _option.series[0].data = _ooption;
+            this.chartObj[index].setOption(_option);
           } else {
-            this.setChart(this.ooption);
+            this.setChart(index, _ooption);
           }
           // this.uploadBoolean = false;
           // this.dialogVisible2 = false;
@@ -874,6 +850,8 @@ export default {
 }
 .add_work >>> .el-dialog__body {
   background: #ededed;
+  height: 575px;
+  overflow: auto;
 }
 .header-title {
   display: flex;
@@ -961,7 +939,7 @@ export default {
 .student_Answer {
   display: flex;
   margin: 5px 10px;
-  padding-bottom: 25px;
+  /* padding-bottom: 25px; */
 }
 .workName {
   font-size: 18px;
@@ -970,7 +948,7 @@ export default {
 }
 .toux {
   width: 35px;
-  margin: auto 0;
+  /* margin: auto 0; */
   height: 35px;
 }
 .toux > img {
@@ -990,6 +968,8 @@ export default {
 .studentAnswer {
   font-size: 12px;
   margin: 5px 0 0 10px;
+  height: 42px;
+  overflow: auto;
 }
 .comment {
   /* margin: 20px 0 0 10px;
@@ -1233,7 +1213,9 @@ export default {
   min-width: 585px;
   min-height: 425px;
 }
-
+.zyBox + .zyBox {
+  margin-top: 10px;
+}
 .rbButtom {
   position: absolute;
   bottom: 0;