export_task_list.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <section style="margin-top: 0px;">
  3. <el-form
  4. :model="formSearch"
  5. :inline="true"
  6. style="border-bottom: 1px solid rgb(221, 221, 221);margin-bottom: 10px;"
  7. >
  8. <el-form-item label="考试名称">
  9. <el-select
  10. v-model="formSearch.examId"
  11. :remote-method="getExams"
  12. @clear="getExams"
  13. placeholder="请选择"
  14. remote
  15. filterable
  16. clearable
  17. size="small"
  18. class="w180"
  19. >
  20. <el-option
  21. v-for="item in examList"
  22. :key="item.id"
  23. :label="item.name"
  24. :value="item.id"
  25. ></el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item label="类型">
  29. <el-select v-model="formSearch.type" size="small" class="w180">
  30. <el-option label="未选择" value=""></el-option>
  31. <el-option label="考试明细" value="EXAM_DETAIL"></el-option>
  32. <el-option label="成绩统计" value="SCORE_STATISTIC"></el-option>
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item label="状态">
  36. <el-select v-model="formSearch.status" size="small" class="w180">
  37. <el-option label="未选择" value=""></el-option>
  38. <el-option label="未开始" value="NONE"></el-option>
  39. <el-option label="导出中" value="EXPORTING"></el-option>
  40. <el-option label="成功" value="SUCCESS"></el-option>
  41. <el-option label="失败" value="ERROR"></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item>
  45. <el-button
  46. size="small"
  47. type="primary"
  48. icon="el-icon-search"
  49. @click="doSearch(1)"
  50. >查询
  51. </el-button>
  52. <el-button size="small" icon="el-icon-refresh" @click="resetSearchForm">
  53. 重置
  54. </el-button>
  55. </el-form-item>
  56. </el-form>
  57. <el-table
  58. v-loading="loading"
  59. :data="tableData"
  60. element-loading-text="数据加载中"
  61. style="width:100%;"
  62. border
  63. stripe
  64. >
  65. </el-table>
  66. <div class="page pull-right">
  67. <el-pagination
  68. @current-change="handlePagerNo"
  69. :current-page="formSearch.pageNo"
  70. @size-change="handlePagerSize"
  71. :page-size="formSearch.pageSize"
  72. :page-sizes="[10, 20, 50, 100, 200, 300]"
  73. :total="totalElements"
  74. layout="total, sizes, prev, pager, next, jumper"
  75. ></el-pagination>
  76. </div>
  77. </section>
  78. </template>
  79. <script>
  80. import { mapState } from "vuex";
  81. export default {
  82. data() {
  83. return {
  84. formSearch: {
  85. examId: "",
  86. type: "",
  87. status: "",
  88. pageNo: 1,
  89. pageSize: 10
  90. },
  91. loading: false,
  92. tableData: [],
  93. totalElements: 0,
  94. examList: []
  95. };
  96. },
  97. methods: {
  98. getExams(examName) {
  99. if (!examName) {
  100. examName = "";
  101. }
  102. this.$http
  103. .get("/api/ecs_exam_work/exam/queryByNameLike", {
  104. params: {
  105. name: examName,
  106. examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK"
  107. }
  108. })
  109. .then(response => {
  110. this.examList = response.data;
  111. });
  112. },
  113. doSearch(pageNo) {
  114. console.log(pageNo);
  115. },
  116. handlePagerNo(pageNo) {
  117. this.doSearch(pageNo);
  118. },
  119. handlePagerSize(pageSize) {
  120. this.formSearch.pageSize = pageSize;
  121. this.doSearch(1);
  122. },
  123. resetSearchForm() {
  124. this.formSearch.examId = "";
  125. this.formSearch.type = "";
  126. this.formSearch.status = "";
  127. this.doSearch(1);
  128. }
  129. },
  130. computed: {
  131. ...mapState({ user: state => state.user })
  132. },
  133. created() {}
  134. };
  135. </script>
  136. <style scoped>
  137. .page {
  138. margin-top: 10px;
  139. }
  140. .pull-right {
  141. float: right;
  142. }
  143. .pull-left {
  144. float: left;
  145. }
  146. .w180 {
  147. width: 180px;
  148. }
  149. </style>