CheckDataResult.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <Modal
  3. class="check-data-result"
  4. v-model="modalIsShow"
  5. title="校验详情"
  6. :mask-closable="false"
  7. width="800"
  8. @on-visible-change="visibleChange"
  9. >
  10. <Table
  11. ref="TableList"
  12. :columns="columns"
  13. :data="students"
  14. disabled-hover
  15. border
  16. ></Table>
  17. <div class="part-page">
  18. <Page
  19. :current="current"
  20. :total="total"
  21. :page-size="size"
  22. show-total
  23. show-elevator
  24. @on-change="toPage"
  25. ></Page>
  26. </div>
  27. </Modal>
  28. </template>
  29. <script>
  30. export default {
  31. name: "check-data-result",
  32. props: {
  33. content: {
  34. type: Array,
  35. default() {
  36. return [];
  37. }
  38. }
  39. },
  40. data() {
  41. return {
  42. modalIsShow: false,
  43. students: [],
  44. columns: [
  45. {
  46. type: "index",
  47. title: "序号",
  48. width: 80,
  49. align: "center",
  50. indexMethod: row => {
  51. return (this.current - 1) * this.size + row._index + 1;
  52. }
  53. },
  54. {
  55. title: "姓名",
  56. key: "studentName",
  57. width: 100
  58. },
  59. {
  60. title: "考号",
  61. key: "examNumber",
  62. width: 120
  63. },
  64. {
  65. title: "错误原因",
  66. key: "errorMessage"
  67. },
  68. {
  69. title: "操作",
  70. key: "action",
  71. width: 100,
  72. align: "center",
  73. className: "table-action",
  74. render: (h, param) => {
  75. let actions = [];
  76. actions.push({
  77. icon: "ios-paper",
  78. attrs: {
  79. title: "查看"
  80. },
  81. action: () => {
  82. this.toView(param.row);
  83. }
  84. });
  85. return h("div", this.$tableIconAction(h, actions));
  86. }
  87. }
  88. ],
  89. current: 1,
  90. size: this.GLOBAL.pageSize,
  91. total: 0
  92. };
  93. },
  94. methods: {
  95. visibleChange(visible) {
  96. if (visible) {
  97. this.toPage(1);
  98. } else {
  99. this.$emit("on-close");
  100. }
  101. },
  102. toPage(page) {
  103. this.current = page;
  104. this.students = this.content.slice((page - 1) * this.size, this.size);
  105. },
  106. toView(row) {
  107. window.open(
  108. this.getRouterPath({
  109. name: "StudentScore",
  110. query: {
  111. examNumber: row.examNumber
  112. }
  113. })
  114. );
  115. },
  116. cancel() {
  117. this.modalIsShow = false;
  118. },
  119. open() {
  120. this.modalIsShow = true;
  121. }
  122. }
  123. };
  124. </script>