index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <div v-loading="loading" class="teacher-task-detail">
  3. <task-top :item-info="itemInfo" @viewFile="viewFile" />
  4. <div class="teacher-task-detail-main">
  5. <div class="student-finish-situation">
  6. <div>学员完成情况</div>
  7. <div class="student-list" :style="{ height: student_list_height + 'px' }">
  8. <ul>
  9. <li
  10. v-for="item in student_list"
  11. :key="item.student_id"
  12. :class="['student-item', { active: item.student_id === curStudentId }]"
  13. @click="getTaskStudentExecuteInfo(item.student_id)"
  14. >
  15. <span>{{ item.student_name }}</span>
  16. <svg-icon v-if="item.is_finished === 'true'" icon-class="check-mark" />
  17. </li>
  18. </ul>
  19. </div>
  20. </div>
  21. <div class="finish-detail">
  22. <div class="student-info">
  23. <div>
  24. <el-avatar :src="curFinishDetail.student_image_url" :size="32" icon="el-icon-user-solid" />
  25. <span class="student-info-name">{{ curFinishDetail.student_name }}</span>
  26. </div>
  27. <span class="finish-time">{{ curFinishDetail.finish_time_view_txt }}</span>
  28. </div>
  29. <div ref="situation" class="finish-situation">
  30. <div class="title">课件任务</div>
  31. <div class="courseware-list">
  32. <el-tag
  33. v-for="item in curFinishDetail.courseware_list"
  34. :key="item.courseware_id"
  35. color="#fff"
  36. :title="item.courseware_name"
  37. @click="showCompletionView(item.courseware_id, item.is_finished)"
  38. >
  39. <div class="courseware">
  40. <svg-icon icon-class="courseware" />
  41. <span class="courseware_name">{{ item.courseware_name }}</span>
  42. <svg-icon v-if="item.is_finished === 'true'" class="check-mark" icon-class="check-mark-circle" />
  43. </div>
  44. </el-tag>
  45. </div>
  46. <div class="title">文档列表</div>
  47. <div>
  48. <el-tag v-for="item in accessory_list" :key="item.file_id" :title="item.file_name">
  49. <span @click="viewFile(item.file_name, item.file_id)">{{ item.file_name }}</span>
  50. </el-tag>
  51. </div>
  52. <div class="title">作业列表</div>
  53. <div>
  54. <el-tag
  55. v-for="item in curFinishDetail.homework_list"
  56. :key="item.file_id"
  57. color="#fff"
  58. :title="item.file_name"
  59. >
  60. <span @click="viewFile(item.file_name, item.file_id)">{{ item.file_name }}</span>
  61. </el-tag>
  62. </div>
  63. <div class="title">学生留言</div>
  64. <div>{{ curFinishDetail.student_message }}</div>
  65. <template v-if="teaching_type === 10">
  66. <div class="title">学员课后评价</div>
  67. <div>{{ student_remark }}</div>
  68. <div class="title">
  69. <span>学员课后评分</span>
  70. <el-rate v-model="student_score" disabled />
  71. </div>
  72. </template>
  73. <div class="title">
  74. <span>教师点评</span>
  75. <el-rate v-model="teacher_score" />
  76. </div>
  77. <div>
  78. <el-input v-model="teacher_remark" type="textarea" resize="none" :rows="6" />
  79. </div>
  80. <div class="confirm">
  81. <el-button type="primary" @click="remarkTaskStudentExecuteInfo_Teacher">提交</el-button>
  82. <el-button v-if="student_list.length > 1" @click="next">
  83. {{ buttonName() }} <i class="el-icon-right" />
  84. </el-button>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <completion-view
  90. :task-id="id"
  91. :cur-student-id="curStudentId"
  92. :cur-courseware-id="curCoursewareId"
  93. :dialog-visible="dialogVisible"
  94. @dialogClose="dialogClose"
  95. />
  96. <show-file
  97. ref="file"
  98. :file-name="showCurFileName"
  99. :file-id="showCurFileId"
  100. @dialogShowFileClose="dialogShowFileClose"
  101. />
  102. </div>
  103. </template>
  104. <script>
  105. import CompletionView from '@/components/course/CompletionView.vue';
  106. import ShowFile from '@/common/show_file';
  107. import TaskTop from '../TaskTop.vue';
  108. import { GetTaskInfo, GetTaskStudentExecuteInfo, RemarkTaskStudentExecuteInfo_Teacher } from '@/api/course';
  109. export default {
  110. components: { CompletionView, TaskTop, ShowFile },
  111. data() {
  112. return {
  113. id: this.$route.params.id,
  114. name: '',
  115. teaching_type: '',
  116. itemInfo: {
  117. course_name: '',
  118. cs_item_name: '',
  119. cs_item_learning_material_list: [],
  120. courseware_list: [],
  121. time_space_view_txt: ''
  122. },
  123. time_type: '',
  124. task_mode: '',
  125. time_space_view_txt: '',
  126. courseware_list: [],
  127. accessory_list: [],
  128. file_list: [],
  129. student_list: [],
  130. curStudentId: '',
  131. // 当前学生完成详情
  132. curFinishDetail: {
  133. student_name: '',
  134. student_image_url: '',
  135. courseware_list: [],
  136. homework_list: [],
  137. student_message: '',
  138. finish_time_view_txt: ''
  139. },
  140. teacher_remark: '',
  141. teacher_score: 0,
  142. student_remark: '',
  143. student_score: 0,
  144. dialogVisible: false,
  145. curCoursewareId: '',
  146. loading: false,
  147. student_list_height: 490,
  148. showCurFileName: '',
  149. showCurFileId: ''
  150. };
  151. },
  152. created() {
  153. this.loading = true;
  154. GetTaskInfo({
  155. id: this.id,
  156. is_contain_cs_item_learning_material: true,
  157. is_contain_student: true
  158. })
  159. .then(
  160. ({
  161. name,
  162. teaching_type,
  163. time_type,
  164. course_name,
  165. courseware_list,
  166. cs_item_name,
  167. accessory_list,
  168. cs_item_learning_material_list,
  169. task_mode,
  170. time_space_view_txt,
  171. student_list
  172. }) => {
  173. this.itemInfo = {
  174. time_space_view_txt,
  175. course_name,
  176. cs_item_name,
  177. cs_item_learning_material_list,
  178. courseware_list
  179. };
  180. this.name = name;
  181. this.teaching_type = teaching_type;
  182. this.time_type = time_type;
  183. this.courseware_list = courseware_list;
  184. this.accessory_list = accessory_list;
  185. this.task_mode = task_mode;
  186. this.time_space_view_txt = time_space_view_txt;
  187. this.student_list = student_list;
  188. if (student_list.length > 0) this.getTaskStudentExecuteInfo(student_list[0].student_id);
  189. }
  190. )
  191. .finally(() => {
  192. this.loading = false;
  193. });
  194. },
  195. methods: {
  196. getTaskStudentExecuteInfo(student_id) {
  197. GetTaskStudentExecuteInfo({
  198. task_id: this.id,
  199. student_id
  200. }).then(
  201. ({
  202. courseware_list,
  203. homework_list,
  204. student_message,
  205. student_name,
  206. student_image_url,
  207. finish_time_view_txt,
  208. teacher_remark,
  209. teacher_score,
  210. student_remark,
  211. student_score
  212. }) => {
  213. this.curStudentId = student_id;
  214. this.teacher_remark = teacher_remark;
  215. this.teacher_score = teacher_score;
  216. this.student_remark = student_remark;
  217. this.student_score = student_score;
  218. this.curFinishDetail = {
  219. courseware_list,
  220. homework_list,
  221. student_message,
  222. student_name,
  223. student_image_url,
  224. finish_time_view_txt
  225. };
  226. this.$nextTick(() => {
  227. this.student_list_height = this.$refs.situation.clientHeight;
  228. });
  229. }
  230. );
  231. },
  232. showCompletionView(id, is_finished) {
  233. if (is_finished === 'false') return this.$message.warning('该课件没有被完成');
  234. this.curCoursewareId = id;
  235. this.dialogVisible = true;
  236. },
  237. dialogClose() {
  238. this.curCoursewareId = '';
  239. this.dialogVisible = false;
  240. },
  241. viewFile(fileName, fileId) {
  242. this.showCurFileName = fileName;
  243. this.showCurFileId = fileId;
  244. this.$refs.file.showDialog();
  245. },
  246. dialogShowFileClose() {
  247. this.showCurFileName = '';
  248. this.showCurFileId = '';
  249. },
  250. buttonName() {
  251. let list = this.student_list;
  252. if (list.length <= 0) return '';
  253. return list[list.length - 1].student_id === this.curStudentId ? '上一个' : '下一个';
  254. },
  255. remarkTaskStudentExecuteInfo_Teacher() {
  256. RemarkTaskStudentExecuteInfo_Teacher({
  257. task_id: this.id,
  258. student_id: this.curStudentId,
  259. teacher_score: this.teacher_score,
  260. teacher_remark: this.teacher_remark
  261. }).then(() => {
  262. this.$message.success('点评成功');
  263. });
  264. },
  265. next() {
  266. let list = this.student_list;
  267. if (list.length <= 0) {
  268. return this.$message.warning('当前学生列表为空');
  269. }
  270. let curIndex = list.findIndex(item => item.student_id === this.curStudentId);
  271. let nextList = list.length - 1 === curIndex ? list[curIndex - 1] : list[curIndex + 1];
  272. if (nextList) this.getTaskStudentExecuteInfo(nextList.student_id);
  273. }
  274. }
  275. };
  276. </script>
  277. <style lang="scss">
  278. @import '~@/styles/mixin';
  279. $bor-color: #d9d9d9;
  280. .teacher-task-detail {
  281. @include container;
  282. @include dialog;
  283. min-height: calc(100vh - 130px);
  284. margin-top: 56px;
  285. .el-tag {
  286. @include el-tag;
  287. margin: 0 8px 6px 0;
  288. border-color: $bor-color;
  289. border-radius: 4px;
  290. > span {
  291. cursor: pointer;
  292. }
  293. }
  294. &-main {
  295. display: flex;
  296. min-height: calc(100vh - 390px);
  297. margin-top: 16px;
  298. background-color: #fff;
  299. border-radius: 8px;
  300. .student-finish-situation {
  301. flex: 3;
  302. padding: 24px 0;
  303. > div:first-child {
  304. padding: 0 32px;
  305. margin-bottom: 24px;
  306. font-weight: 700;
  307. }
  308. // 学员列表
  309. .student-list {
  310. overflow: auto;
  311. ul {
  312. cursor: pointer;
  313. .student-item {
  314. display: flex;
  315. justify-content: space-between;
  316. padding: 8px 32px;
  317. &.active {
  318. background-color: #f2f2f2;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. // 完成详情
  325. .finish-detail {
  326. flex: 7;
  327. border-left: 1px solid #dbdbdb;
  328. .student-info {
  329. display: flex;
  330. justify-content: space-between;
  331. height: 89px;
  332. padding: 28px 32px;
  333. line-height: 32px;
  334. border-bottom: 1px solid #dbdbdb;
  335. &-name {
  336. display: inline-block;
  337. height: 32px;
  338. margin-left: 24px;
  339. line-height: 32px;
  340. vertical-align: text-bottom;
  341. }
  342. .finish-time {
  343. color: #999;
  344. }
  345. }
  346. // 完成情况
  347. .finish-situation {
  348. width: 100%;
  349. padding: 24px 32px;
  350. .el-rate {
  351. display: inline-block;
  352. margin-left: 42px;
  353. }
  354. .title {
  355. font-size: 18px;
  356. font-weight: bold;
  357. + div {
  358. padding: 16px 0;
  359. }
  360. }
  361. .courseware-list {
  362. .el-tag {
  363. cursor: pointer;
  364. .courseware {
  365. overflow: hidden;
  366. .svg-icon {
  367. margin-right: 12px;
  368. font-size: 18px;
  369. }
  370. .check-mark {
  371. position: relative;
  372. top: 2px;
  373. margin: 0 0 0 12px;
  374. }
  375. &_name {
  376. display: inline-block;
  377. max-width: 120px;
  378. }
  379. }
  380. }
  381. }
  382. // 学员详情按钮
  383. .confirm {
  384. display: flex;
  385. justify-content: space-between;
  386. .el-button {
  387. width: 110px;
  388. }
  389. }
  390. }
  391. }
  392. }
  393. }
  394. </style>