studentWork.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div>
  3. <el-form :inline="true">
  4. <el-form-item label="应到学生数">
  5. <!-- <el-input disabled
  6. :value="studentNum"></el-input> -->
  7. <div class="inputStyle">{{ studentNum}}</div>
  8. </el-form-item>
  9. <el-form-item label="已交学生数">
  10. <!-- <el-input disabled
  11. :value="homeworkNum"></el-input> -->
  12. <div class="inputStyle">{{ homeworkNum}}</div>
  13. </el-form-item>
  14. <el-form-item label="已回复数">
  15. <!-- <el-input disabled
  16. :value="repliedNum"></el-input> -->
  17. <div class="inputStyle">{{ repliedNum}}</div>
  18. </el-form-item>
  19. </el-form>
  20. <div class="tableWrap">
  21. <el-table :data='tableList'
  22. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  23. <el-table-column align='center'
  24. prop="username"
  25. label="学生姓名">
  26. </el-table-column>
  27. <el-table-column align='center'
  28. prop="phone"
  29. label="手机号">
  30. </el-table-column>
  31. <el-table-column align='center'
  32. prop="subjectName"
  33. label="声部名称">
  34. </el-table-column>
  35. <el-table-column align='center'
  36. prop="createTime"
  37. label="交作业时间">
  38. </el-table-column>
  39. <el-table-column align='center'
  40. prop="isView"
  41. label="是否查看">
  42. <template slot-scope="scope">
  43. <div>
  44. {{ scope.row.isView ? '是' : '否' }}
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column align='center'
  49. prop="isReplied"
  50. label="是否回复">
  51. <template slot-scope="scope">
  52. <div>
  53. {{ scope.row.isReplied ? '是' : '否' }}
  54. </div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column align='center'
  58. label="操作">
  59. <template slot-scope="scope">
  60. <div>
  61. <!-- -->
  62. <el-button type="text"
  63. v-if="scope.row.url"
  64. @click="lookWork(scope.row.url)">查看</el-button>
  65. </div>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <pagination :total="rules.total"
  70. :page.sync="rules.page"
  71. :limit.sync="rules.limit"
  72. @pagination="getList" />
  73. </div>
  74. <el-dialog title="查看作业"
  75. @close="closeWorkVisible"
  76. width="680px"
  77. append-to-body
  78. :visible.sync="workVisible">
  79. <!-- activeUrl -->
  80. <video style="width:640px;"
  81. :src='activeUrl'
  82. ref="dialogVideo"
  83. controls="controls">
  84. 您的浏览器不支持视频播放
  85. </video>
  86. </el-dialog>
  87. </div>
  88. </template>
  89. <script>
  90. import pagination from '@/components/Pagination/index'
  91. import { findStudentCourseHomeworks, sumStudentAttendance } from '@/api/buildTeam'
  92. export default {
  93. props: ['courseScheduleId'],
  94. components: { pagination },
  95. data () {
  96. return {
  97. tableList: [],
  98. rules: {
  99. // 分页规则
  100. limit: 10, // 限制显示条数
  101. page: 1, // 当前页
  102. total: 0, // 总条数
  103. },
  104. workVisible: false,
  105. studentNum: null,
  106. homeworkNum: null,
  107. repliedNum: null,
  108. activeUrl: null
  109. }
  110. },
  111. mounted () {
  112. this.init()
  113. },
  114. activated () {
  115. this.init()
  116. },
  117. methods: {
  118. init () {
  119. sumStudentAttendance({ courseScheduleId: this.courseScheduleId }).then(res => {
  120. if (res.code == 200) {
  121. this.studentNum = res.data.studentNum;
  122. this.homeworkNum = res.data.homeworkNum;
  123. this.repliedNum = res.data.repliedNum
  124. }
  125. })
  126. this.getList()
  127. },
  128. getList () {
  129. findStudentCourseHomeworks({ search: this.courseScheduleId }).then(res => {
  130. if (res.code == 200) {
  131. this.rules.total = res.data.total
  132. this.tableList = res.data.rows
  133. }
  134. })
  135. },
  136. lookWork (url) {
  137. this.workVisible = true;
  138. this.activeUrl = url;
  139. },
  140. closeWorkVisible () {
  141. this.activeUrl = '';
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. .inputStyle {
  148. width: 100px;
  149. text-align: center;
  150. }
  151. </style>