WaitTaskAnalysis.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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
  12. prop="semesterName"
  13. label="学期"
  14. min-width="210"
  15. ></el-table-column>
  16. <el-table-column prop="examName" label="考试" min-width="160">
  17. </el-table-column>
  18. <el-table-column prop="courseCode" label="课程(代码)" min-width="200">
  19. <span slot-scope="scope">
  20. {{ scope.row.courseName }}({{ scope.row.courseCode }})
  21. </span>
  22. </el-table-column>
  23. <el-table-column
  24. class-name="action-column"
  25. label="操作"
  26. width="100"
  27. fixed="right"
  28. >
  29. <template slot-scope="scope">
  30. <el-button class="btn-primary" type="text" @click="toDo(scope.row)"
  31. >立即处理</el-button
  32. >
  33. </template>
  34. </el-table-column>
  35. </el-table>
  36. <div class="part-page">
  37. <el-pagination
  38. background
  39. layout="total, sizes, prev, pager, next, jumper"
  40. :pager-count="5"
  41. :current-page="current"
  42. :total="total"
  43. :page-size="size"
  44. @current-change="toPage"
  45. @size-change="pageSizeChange"
  46. >
  47. </el-pagination>
  48. </div>
  49. </div>
  50. <!-- ModifyBaseConfig -->
  51. <modify-base-config
  52. ref="ModifyBaseConfig"
  53. :instance="curTask"
  54. @closed="taskModified"
  55. ></modify-base-config>
  56. </div>
  57. </template>
  58. <script>
  59. import { mapMutations, mapActions } from "vuex";
  60. import { analysisTaskListPage } from "../api";
  61. import ModifyBaseConfig from "../../analysis/components/ModifyBaseConfig.vue";
  62. export default {
  63. name: "wait-task-analysis",
  64. components: { ModifyBaseConfig },
  65. data() {
  66. return {
  67. current: 1,
  68. size: this.GLOBAL.pageSize,
  69. total: 0,
  70. dataList: [],
  71. curTask: {},
  72. };
  73. },
  74. mounted() {
  75. this.initData();
  76. },
  77. methods: {
  78. ...mapMutations("exam", ["updateWaitTask"]),
  79. ...mapActions("exam", ["updateWaitTaskCount"]),
  80. async initData() {
  81. await this.getList();
  82. const presetTask = this.$ls.get("wait_task_analysis");
  83. if (presetTask) {
  84. this.$nextTick(() => {
  85. this.toDo(presetTask);
  86. });
  87. this.$ls.remove("wait_task_analysis");
  88. }
  89. },
  90. async getList() {
  91. const datas = {
  92. pageNumber: this.current,
  93. pageSize: this.size,
  94. };
  95. const data = await analysisTaskListPage(datas);
  96. this.dataList = data.records;
  97. this.total = data.total;
  98. this.updateWaitTask({ analysis: this.total });
  99. },
  100. toPage(page) {
  101. this.current = page;
  102. this.getList();
  103. },
  104. toDo(task) {
  105. this.curTask = { ...task };
  106. this.$refs.ModifyBaseConfig.open();
  107. },
  108. taskModified() {
  109. this.getList();
  110. this.updateWaitTaskCount();
  111. },
  112. },
  113. };
  114. </script>