WaitTaskAnalysis.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div class="wait-task-analysis">
  3. <div class="part-box part-box-pad">
  4. <el-table ref="TableList" :data="dataList">
  5. <el-table-column
  6. type="index"
  7. label="序号"
  8. width="50"
  9. :index="indexMethod"
  10. ></el-table-column>
  11. <el-table-column prop="semesterName" label="学期"></el-table-column>
  12. <el-table-column prop="examName" label="考试"> </el-table-column>
  13. <el-table-column prop="courseCode" label="课程(代码)" min-width="120">
  14. <span slot-scope="scope">
  15. {{ scope.row.courseName }}({{ scope.row.courseCode }})
  16. </span>
  17. </el-table-column>
  18. <el-table-column class-name="action-column" label="操作" width="100">
  19. <template slot-scope="scope">
  20. <el-button class="btn-primary" type="text" @click="toDo(scope.row)"
  21. >立即处理</el-button
  22. >
  23. </template>
  24. </el-table-column>
  25. </el-table>
  26. <div class="part-page">
  27. <el-pagination
  28. background
  29. layout="total,prev, pager, next"
  30. :current-page="current"
  31. :total="total"
  32. :page-size="size"
  33. @current-change="toPage"
  34. >
  35. </el-pagination>
  36. </div>
  37. </div>
  38. <!-- ModifyBaseConfig -->
  39. <modify-base-config
  40. ref="ModifyBaseConfig"
  41. :instance="curTask"
  42. @closed="taskModified"
  43. ></modify-base-config>
  44. </div>
  45. </template>
  46. <script>
  47. import { mapMutations, mapActions } from "vuex";
  48. import { analysisTaskListPage } from "../api";
  49. import ModifyBaseConfig from "../../analysis/components/ModifyBaseConfig.vue";
  50. export default {
  51. name: "wait-task-analysis",
  52. components: { ModifyBaseConfig },
  53. data() {
  54. return {
  55. current: 1,
  56. size: this.GLOBAL.pageSize,
  57. total: 0,
  58. dataList: [],
  59. curTask: {}
  60. };
  61. },
  62. mounted() {
  63. this.getList();
  64. },
  65. methods: {
  66. ...mapMutations("exam", ["updateWaitTask"]),
  67. ...mapActions("exam", ["updateWaitTaskCount"]),
  68. async getList() {
  69. const datas = {
  70. pageNumber: this.current,
  71. pageSize: this.size
  72. };
  73. const data = await analysisTaskListPage(datas);
  74. this.dataList = data.records;
  75. this.total = data.total;
  76. this.updateWaitTask({ analysis: this.total });
  77. },
  78. toPage(page) {
  79. this.current = page;
  80. this.getList();
  81. },
  82. toDo(task) {
  83. this.curTask = { ...task };
  84. this.$refs.ModifyBaseConfig.open();
  85. },
  86. taskModified() {
  87. this.getList();
  88. this.updateWaitTaskCount();
  89. }
  90. }
  91. };
  92. </script>