examinationDetail.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div>
  3. <div>
  4. <el-checkbox-group
  5. v-if="subjectList.length > 1"
  6. @change="checkSubject"
  7. v-model="subjectId"
  8. size="medium"
  9. style="margin-bottom: 20px"
  10. >
  11. <el-checkbox-button
  12. :class="subjectList.length == 1 ? 'one' : ''"
  13. v-for="(item, index) in subjectList"
  14. :key="index"
  15. :label="item.id"
  16. >{{ item.name }}</el-checkbox-button
  17. >
  18. </el-checkbox-group>
  19. <el-table
  20. style="width: 100%"
  21. max-height="300px"
  22. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  23. :data="list"
  24. >
  25. <el-table-column type="expand">
  26. <template slot-scope="props">
  27. <!-- <el-table
  28. style="width: 100%;padding-left: 48px"
  29. :show-header="false"
  30. :data="props.row.detailDtos"
  31. >
  32. <el-table-column
  33. label="名称"
  34. prop="musicScoreName"
  35. ></el-table-column>
  36. <el-table-column label="类型" prop="type"
  37. ><template slot-scope="scope">{{
  38. scope.row.homeworkType === "MUSIC_SCORE" ? "曲目" : "视频"
  39. }}</template>
  40. </el-table-column>
  41. <el-table-column label="速度" prop="trainingSpeed">
  42. <template slot-scope="scope">
  43. <span v-if="scope.row.homeworkType === 'MUSIC_SCORE'">
  44. {{ scope.row.trainingSpeed }}速度
  45. </span>
  46. <span v-else>--</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="times" label="次数/总计">
  50. <template slot-scope="scope"
  51. >{{ scope.row.trainingTimes }}/{{
  52. scope.row.times
  53. }}次</template
  54. >
  55. </el-table-column>
  56. </el-table> -->
  57. <el-row
  58. :gutter="20"
  59. v-for="(item, index) in props.row.detailDtos"
  60. :key="index"
  61. >
  62. <el-col :span="12"
  63. ><div class="rowFirst">{{ item.musicScoreName }}</div></el-col
  64. >
  65. <el-col :span="6"
  66. ><div class="rowSecond">
  67. <span>{{ item.heardLevel | palyLevelFilter }}</span>
  68. </div></el-col
  69. >
  70. <el-col :span="6"
  71. ><div class="rowlast">
  72. <span
  73. :class="
  74. item.trainingScore >= item.standardScore ? '' : 'red'
  75. "
  76. >{{ item.trainingScore }}</span
  77. >
  78. / {{ item.standardScore }} 分
  79. </div></el-col
  80. >
  81. </el-row>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="username" align="left" label="学生姓名">
  85. </el-table-column>
  86. <el-table-column prop="phone" align="left" label="手机号">
  87. </el-table-column>
  88. <el-table-column prop="subjectName" align="left" label="声部名称">
  89. </el-table-column>
  90. <el-table-column prop="trainingTime" align="left" label="完成时间">
  91. <template slot-scope="scope">
  92. <div>{{ scope.row.trainingTime | dateForMinFormat }}</div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column prop="finishFlag" align="right" label="测验分数">
  96. <template slot-scope="scope">
  97. <div>{{ scope.row.trainingScore }}</div>
  98. </template>
  99. </el-table-column>
  100. </el-table>
  101. </div>
  102. </div>
  103. </template>
  104. <script>
  105. import {
  106. getLessonExaminationStudent,
  107. getExaminationSubjectPublic
  108. } from "../api";
  109. export default {
  110. props: ["courseScheduleId", "type"],
  111. data() {
  112. return {
  113. subjectId: [],
  114. list: [],
  115. subjectList: []
  116. };
  117. },
  118. mounted() {
  119. console.log(this.courseScheduleId, "mounted");
  120. if (this.courseScheduleId) {
  121. this.getStudentList(this.courseScheduleId);
  122. this.getPublicSubject();
  123. }
  124. },
  125. methods: {
  126. async getStudentList() {
  127. try {
  128. const res = await getLessonExaminationStudent({
  129. lessonExaminationId: this.courseScheduleId,
  130. subjectId: this.subjectId
  131. });
  132. this.list = res.data;
  133. } catch (e) {
  134. console.log(e);
  135. }
  136. },
  137. async getPublicSubject() {
  138. try {
  139. const res = await getExaminationSubjectPublic({
  140. lessonExaminationId: this.courseScheduleId
  141. });
  142. this.subjectList = res.data;
  143. } catch (e) {
  144. console.log(e);
  145. }
  146. },
  147. checkSubject(val) {
  148. if (this.subjectId.length > 1) {
  149. this.subjectId.shift();
  150. }
  151. this.getStudentList();
  152. }
  153. }
  154. };
  155. </script>
  156. <style lang="scss" scoped>
  157. ::v-deep.one {
  158. .el-checkbox-button__inner {
  159. border-radius: 4px !important;
  160. }
  161. }
  162. ::v-deep.el-row {
  163. line-height: 44px;
  164. }
  165. .rowFirst {
  166. padding-left: 58px;
  167. color: #101010;
  168. }
  169. .rowSecond {
  170. text-align: right;
  171. span {
  172. color: #101010;
  173. }
  174. color: #9a9a9a;
  175. }
  176. .rowlast {
  177. text-align: right;
  178. padding-right: 10px;
  179. color: #101010;
  180. .red {
  181. color: #f44743;
  182. }
  183. }
  184. </style>