index.vue 4.3 KB

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