Browse Source

更新作业详情

lex 2 years ago
parent
commit
27e1b853b1

+ 14 - 7
src/views/attendanceManager/attendanceList/components/courseWorkeDetail.vue

@@ -4,7 +4,9 @@
       <div class="teacherHeader">
         <el-image
           style="width: 50px; height: 50px"
-          :src="courseDetail.teacherImg ? courseDetail.teacherImg : tetacherIcon"
+          :src="
+            courseDetail.teacherImg ? courseDetail.teacherImg : tetacherIcon
+          "
         ></el-image>
       </div>
       <div class="courseInfo">
@@ -64,7 +66,10 @@
         v-if="permission('/teamCourseListDetailStudnetList')"
       >
         <div v-if="activeName == 'first'">
-          <studentWroks ref="studentWroksRef" :courseScheduleId="courseScheduleId" />
+          <studentWroks
+            ref="studentWroksRef"
+            :courseScheduleId="courseScheduleId"
+          />
         </div>
       </el-tab-pane>
       <el-tab-pane
@@ -74,7 +79,7 @@
       >
         <div v-if="activeName == 'second'">
           <textConment
-            :trainingDetailList="trainingDetailList"
+            :trainingDetailList="trainingGroupList"
             :courseScheduleId="courseScheduleId"
           />
         </div>
@@ -109,9 +114,10 @@ export default {
         teacherImg: "",
         courseScheduleId: "",
         finishNum: "",
-        studentNum: "",
+        studentNum: ""
       },
       trainingDetailList: [],
+      trainingGroupList: []
     };
   },
   mounted() {
@@ -121,18 +127,19 @@ export default {
     async getWorkerDetail() {
       try {
         const res = await findCourseHomeworkDetail({
-          courseScheduleId: this.courseScheduleId,
+          courseScheduleId: this.courseScheduleId
         });
         this.courseDetail = { ...res.data };
         this.trainingDetailList = res.data.trainingDetailList;
+        this.trainingGroupList = res.data.trainingGroupList || [];
       } catch (e) {
         console.log(e);
       }
     },
     permission(str, parent) {
       return permission(str, parent);
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 43 - 27
src/views/attendanceManager/attendanceList/components/textConment.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!--   -->
-    <el-checkbox-group
+    <!-- <el-checkbox-group
       v-if="subjectList.length > 1"
       @change="checkSubject"
       v-model="subjectId"
@@ -15,26 +15,31 @@
         :label="item.id"
         >{{ item.name }}</el-checkbox-button
       >
-    </el-checkbox-group>
-    <el-row :gutter="20" v-for="(item, index) in fitterTraining" :key="index">
-      <el-col :span="12"
-        ><div class="rowFirst">{{ item.musicScoreName }}</div></el-col
-      >
-      <el-col :span="6"
-        ><div class="rowSecond">
-          <span>{{ item.trainingSpeed }}</span> 速度
-        </div></el-col
-      >
-      <el-col :span="6"
-        ><div class="rowlast">
-          <!-- <span :class="item.trainingTimes >= item.times ? '' : 'red'">{{
-            item.trainingTimes
-          }}</span>  /-->
-          <span> {{ item.times }}</span>
-          次
-        </div></el-col
+    </el-checkbox-group> -->
+    <div v-for="(item, index) in fitterTraining" :key="index">
+      <el-alert :title="'练习组' + (index + 1)" :closable="false">
+        {{ item.subjectName }}
+      </el-alert>
+
+      <el-table
+        :data="item.trainingDetailList"
+        :show-header="false"
+        style="width: 100%;margin-bottom: 12px;"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
       >
-    </el-row>
+        <el-table-column prop="musicScoreName"></el-table-column>
+        <el-table-column prop="trainingSpeed">
+          <template slot-scope="scope"
+            >{{ scope.row.trainingSpeed }}速度</template
+          >
+        </el-table-column>
+        <el-table-column prop="times">
+          <template slot-scope="scope"
+            >{{ scope.row.times }}次</template
+          >
+        </el-table-column>
+      </el-table>
+    </div>
   </div>
 </template>
 <script>
@@ -46,12 +51,12 @@ export default {
       subjectId: [],
       list: [],
       subjectList: [],
-      fitterTraining: [],
+      fitterTraining: []
     };
   },
   mounted() {
     console.log(this.trainingDetailList);
-    this.fitterTraining = this.trainingDetailList.map((item) => item);
+    this.fitterTraining = this.trainingDetailList.map(item => item);
     this.getPublicSubject();
   },
 
@@ -60,7 +65,7 @@ export default {
       try {
         const res = await getHomeworkSubjectPublic({
           courseScheduleId: this.courseScheduleId,
-          type: "HOMEWORK",
+          type: "HOMEWORK"
         });
         this.subjectList = res.data;
       } catch (e) {
@@ -73,14 +78,14 @@ export default {
         this.subjectId.shift();
       }
       if (this.subjectId) {
-        this.fitterTraining = this.trainingDetailList.filter((item) => {
+        this.fitterTraining = this.trainingDetailList.filter(item => {
           return item.subjectId == this.subjectId[0];
         });
       } else {
-        this.fitterTraining = this.trainingDetailList.map((item) => item);
+        this.fitterTraining = this.trainingDetailList.map(item => item);
       }
-    },
-  },
+    }
+  }
 };
 </script>
 
@@ -88,6 +93,17 @@ export default {
 ::v-deep .el-row {
   line-height: 40px !important;
 }
+::v-deep .el-alert__content {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  width: 100%;
+  padding: 0;
+
+  .el-alert__description {
+    margin-top: 0;
+  }
+}
 .rowFirst {
   // padding-left: 58px;
   color: #101010;