index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!--个人成绩查询-->
  2. <template>
  3. <div class="app-container myResultInquiry">
  4. <div class="myResultInquiry-page " v-if="pageType == 1">
  5. <div class="button-max-box">
  6. <p class="button-p" :class="item.value==infoParams.scopeType?'button-color-a':'button-color-b'" v-for="(item,index) in buttonList" :key="index" @click="buttonClick(item)">{{item.name}}</p>
  7. </div>
  8. <el-table v-loading="loading" border :data="myListExam">
  9. <el-table-column label="考试名称" align="left" prop="title" />
  10. <!--<el-table-column label="适用范围" align="left" prop="scopeType" />-->
  11. <el-table-column label="题目类型" align="left" prop="classifyNames" />
  12. <el-table-column label="考试时间" align="left" prop="createTime" />
  13. <el-table-column label="考试得分" align="left" prop="userScore" />
  14. <el-table-column label="是否合格" align="left" prop="passed" >
  15. <template slot-scope="scope">
  16. <span>{{scope.row.userScore >= scope.row.qualifyScore ?'是':'否'}}</span>
  17. </template>
  18. </el-table-column>
  19. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120">
  20. <template slot-scope="scope">
  21. <p class="table-min-button"
  22. style="margin-right:10px;"
  23. @click="getExamPaper(scope.row)"
  24. >详情</p>
  25. </template>
  26. </el-table-column>
  27. </el-table>
  28. <pagination :page-sizes="[20, 30, 40, 50]"
  29. v-show="total>0"
  30. :total="total"
  31. layout="total, prev, pager, next, sizes, jumper"
  32. :page.sync="infoParams.pageNum"
  33. :limit.sync="infoParams.pageSize"
  34. @pagination="getMyListExam"
  35. />
  36. </div>
  37. <info-list v-if="pageType==2" :transferData="transferData"></info-list>
  38. </div>
  39. </template>
  40. <script>
  41. import { listPaperAll,getExamPaper } from "@/api/myPage/myResultInquiry";
  42. import infoList from './infoList.vue'
  43. export default {
  44. name: "index",
  45. components: {
  46. infoList
  47. },
  48. data() {
  49. return {
  50. //页面状态
  51. pageType:1,
  52. buttonList:[
  53. {
  54. name:"模拟考试",
  55. value:"4"
  56. },
  57. {
  58. name:"安全准入考试",
  59. value:"1"
  60. },
  61. {
  62. name:"负面清单考试",
  63. value:"2"
  64. },
  65. {
  66. name:"黑名单考试",
  67. value:"3"
  68. },
  69. ],
  70. total:0,
  71. myListExam:[],
  72. infoParams: {
  73. pageNum: 1,
  74. pageSize:20,
  75. scopeType: 4
  76. },
  77. transferData:{}
  78. }
  79. },
  80. created(){
  81. this.getMyListExam();
  82. },
  83. methods:{
  84. //分类按钮点击查询
  85. buttonClick(item){
  86. this.infoParams.scopeType = item.value;
  87. this.infoParams.pageNum = 1;
  88. this.getMyListExam();
  89. },
  90. /** 查询我的考试记录列表 */
  91. getMyListExam() {
  92. this.loading = true;
  93. listPaperAll(this.infoParams).then(response => {
  94. this.myListExam = response.rows;
  95. this.total = response.total;
  96. this.loading = false;
  97. });
  98. },
  99. getExamPaper(row){
  100. getExamPaper(row.id).then(res => {
  101. this.transferData = res.data;
  102. this.pageType = 2;
  103. // console.log("res",res)
  104. });
  105. },
  106. outClick(){
  107. this.pageType = 1;
  108. }
  109. }
  110. }
  111. </script>
  112. <style scoped lang="scss">
  113. .myResultInquiry{
  114. display: flex!important;
  115. flex-direction: column;
  116. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  117. padding:0 20px 20px!important;
  118. .myResultInquiry-page{
  119. flex: 1;
  120. display: flex!important;
  121. flex-direction: column;
  122. .button-max-box{
  123. display: flex;
  124. padding:20px 0;
  125. .button-p{
  126. line-height:35px;
  127. margin-right:10px;
  128. cursor:pointer;
  129. padding:0 20px;
  130. border-radius:4px;
  131. font-size:14px;
  132. }
  133. .button-color-a{
  134. background: #0045af;
  135. color:#fff;
  136. }
  137. .button-color-b{
  138. background: #f5f5f5;
  139. color:#0045af;
  140. }
  141. }
  142. }
  143. }
  144. </style>