iCourseInfo.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <el-row class="p20 waphide">
  3. <el-col :lg="6" :md="6" :span="6">
  4. <el-progress class="mprocess" type="circle" :width="150" :format="formatFinish" :stroke-width="18"
  5. :percentage="info.percent">
  6. </el-progress>
  7. </el-col>
  8. <el-col :lg="6" :md="6" :span="6">
  9. <el-progress v-if="tpl.testGroupId>0" class="mprocess" type="circle" :width="150" :format="formatTest"
  10. :stroke-width="18" :percentage="finishCount">
  11. </el-progress>
  12. <el-progress v-else-if="tpl.examGroupId>0" class="mprocess" type="circle" :width="150" :format="formatExam"
  13. :stroke-width="18" :percentage="info.score">
  14. </el-progress>
  15. <el-progress v-else class="mprocess" type="circle" :width="150" :format="formatString('--')" :stroke-width="18"
  16. :percentage="0">
  17. </el-progress>
  18. </el-col>
  19. <el-col :lg="6" :md="6" :span="6">
  20. <img src="../../../../assets/wxapp.jpg" width="150px" />
  21. </el-col>
  22. <el-col :lg="6" :md="6" :span="6">
  23. <div>
  24. <p style="font-size: 24px;"> 说明 </p>
  25. <p class="mt10">岗位名称:{{tpl.name}}<strong style="color: red;">{{tpl.nd}}</strong></p>
  26. <p class="mt10">
  27. 学习截至时间:
  28. <strong style="color: red;">
  29. {{info.canStudyDate}}
  30. </strong>
  31. </p>
  32. <p class="mt10" v-if="tpl.testGroupId>0">
  33. 参与练习<strong style="color: red;"> {{finishCount}}</strong>题,满100题可得
  34. <strong style="color: red;">{{tpl.testXs/10}}</strong>学时
  35. </p>
  36. <p class="mt10" style="color: red;" v-if="tpl.examGroupId>0">报名成功,80天内完成学习与考试</p>
  37. <p class="mt10" v-if="tpl.examGroupId==0">完成所有视频,即可打印学时证明</p>
  38. <div>
  39. <el-button type="primary" class="mt10" style="font-size: 14px;" @click="startExam" v-if="tpl.examGroupId>0"
  40. :disabled="info.score>=60">
  41. 参加考试
  42. </el-button>
  43. <el-button type="primary" class="mt10" style="font-size: 14px;" @click="startExamTest"
  44. v-if="tpl.testGroupId>0" :disabled="info.score>=60">
  45. 在线练习
  46. </el-button>
  47. <el-button type="primary" class="mt10" style="font-size: 14px;" @click="printCert" v-if="tpl.tplId>0">
  48. 学时证明
  49. </el-button>
  50. </div>
  51. </div>
  52. </el-col>
  53. </el-row>
  54. </template>
  55. <script>
  56. import {
  57. toDate
  58. } from "@/utils/date";
  59. export default {
  60. name: "Index",
  61. data() {
  62. return {
  63. finishCount:0
  64. }
  65. },
  66. filters: {
  67. add80Date(date) {
  68. let val = new Date(date).getTime() + 80 * 86400 * 1000;
  69. return toDate(val)
  70. },
  71. testCount(val) {
  72. let finish= (+val.index1) + (+val.index2) + (+val.index3) + (+val.index4) || 0
  73. return finish;
  74. }
  75. },
  76. props: ['tpl', 'info', 'extraXs'],
  77. mounted(){
  78. this.finishCount = (this.extraXs.index1) + (+this.extraXs.index2) + (+this.extraXs.index3) + (+this.extraXs.index4)||0
  79. },
  80. methods: {
  81. startExam() {
  82. if (this.tpl.isClosed == 1) {
  83. this.$message.errorMsg("课程已经关闭", 2)
  84. return;
  85. }
  86. this.$emit("startExam", 0)
  87. },
  88. startExamTest() {
  89. this.$emit("startExamTest")
  90. },
  91. printCert() {
  92. this.$emit("printCert")
  93. },
  94. formatFinish() {
  95. let {
  96. gxs,
  97. axs
  98. } = this.info;
  99. let {testXs}= this.tpl
  100. let attrch = this.finishCount>=100?testXs/10:0;
  101. if (!axs) axs = 1;
  102. return `获得${gxs+attrch}学时, 总共${axs+testXs/10}学时`;
  103. },
  104. formatExam() {
  105. let {
  106. score
  107. } = this.info
  108. if (score == -1) return `已答0次,未通过`;
  109. return `最高${score<1?0:score}分, ${score>=60?'通过':'未通过'}`;
  110. },
  111. formatTest() {
  112. let finishCount = this.finishCount
  113. return `练习${finishCount}题, ${finishCount>=100?'完成':'未完成'}`;
  114. },
  115. formatString(val) {
  116. return () => val;
  117. }
  118. }
  119. }
  120. </script>