DataInitManage.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="data-init-manage">
  3. <div class="part-box part-box-filter part-box-flex">
  4. <el-form ref="FilterForm" label-position="left" label-width="55px" inline>
  5. <template v-if="checkPrivilege('condition', 'condition')">
  6. <el-form-item label="学期:">
  7. <semester-select
  8. v-model="filter.semesterId"
  9. placeholder="学期"
  10. ></semester-select>
  11. </el-form-item>
  12. <el-form-item label="考试:">
  13. <exam-select
  14. v-model="filter.examId"
  15. :semester-id="filter.semesterId"
  16. placeholder="考试"
  17. ></exam-select>
  18. </el-form-item>
  19. <el-form-item label="课程:">
  20. <course-select
  21. v-model="filter.courseCode"
  22. placeholder="课程"
  23. :semester-id="filter.semesterId"
  24. :exam-id="filter.examId"
  25. ></course-select>
  26. </el-form-item>
  27. </template>
  28. <el-form-item>
  29. <el-button
  30. v-if="checkPrivilege('button', 'select')"
  31. type="primary"
  32. @click="toPage(1)"
  33. >查询</el-button
  34. >
  35. </el-form-item>
  36. </el-form>
  37. <div class="part-box-action"></div>
  38. </div>
  39. <div class="part-box part-box-pad">
  40. <el-table ref="TableList" :data="dataList">
  41. <el-table-column
  42. type="index"
  43. label="序号"
  44. width="50"
  45. :index="indexMethod"
  46. ></el-table-column>
  47. <el-table-column
  48. prop="semesterName"
  49. label="学期"
  50. min-width="160"
  51. ></el-table-column>
  52. <el-table-column prop="examName" label="考试" min-width="160">
  53. </el-table-column>
  54. <el-table-column prop="courseCode" label="课程(代码)" min-width="200">
  55. <span slot-scope="scope">
  56. {{ scope.row.courseName }}({{ scope.row.courseCode }})
  57. </span>
  58. </el-table-column>
  59. <el-table-column
  60. prop="paperNumber"
  61. label="试卷编码"
  62. min-width="160"
  63. ></el-table-column>
  64. <el-table-column
  65. prop="paperType"
  66. label="试卷类型"
  67. width="100"
  68. ></el-table-column>
  69. <el-table-column prop="status" label="状态" width="100">
  70. </el-table-column>
  71. <el-table-column
  72. class-name="action-column"
  73. label="操作"
  74. width="160px"
  75. fixed="right"
  76. >
  77. <template slot-scope="scope">
  78. <el-button
  79. v-if="
  80. checkPrivilege('link', 'window') && !scope.row.publishStatus
  81. "
  82. class="btn-primary"
  83. type="text"
  84. @click="toConfig(scope.row)"
  85. >基础配置</el-button
  86. >
  87. </template>
  88. </el-table-column>
  89. </el-table>
  90. <div class="part-page">
  91. <el-pagination
  92. background
  93. layout="total, sizes, prev, pager, next, jumper"
  94. :pager-count="5"
  95. :current-page="current"
  96. :total="total"
  97. :page-size="size"
  98. @current-change="toPage"
  99. @size-change="pageSizeChange"
  100. >
  101. </el-pagination>
  102. </div>
  103. </div>
  104. <!-- ModifyBaseConfig -->
  105. <modify-base-config
  106. ref="ModifyBaseConfig"
  107. :instance="curRow"
  108. ></modify-base-config>
  109. </div>
  110. </template>
  111. <script>
  112. import { dataInitList } from "../api";
  113. import ModifyBaseConfig from "../components/ModifyBaseConfig.vue";
  114. export default {
  115. name: "data-init-manage",
  116. components: { ModifyBaseConfig },
  117. data() {
  118. return {
  119. filter: {
  120. semesterId: "",
  121. examId: "",
  122. courseCode: ""
  123. },
  124. current: 1,
  125. size: this.GLOBAL.pageSize,
  126. total: 0,
  127. dataList: [],
  128. curRow: {},
  129. loading: false
  130. };
  131. },
  132. mounted() {
  133. this.toPage(1);
  134. },
  135. methods: {
  136. async getList() {
  137. if (!this.checkPrivilege("list", "list")) return;
  138. const datas = {
  139. ...this.filter,
  140. pageNumber: this.current,
  141. pageSize: this.size
  142. };
  143. const data = await dataInitList(datas);
  144. this.dataList = data.records;
  145. this.total = data.total;
  146. },
  147. toPage(page) {
  148. this.current = page;
  149. this.getList();
  150. },
  151. toConfig(row) {
  152. console.log(row);
  153. this.curRow = row;
  154. this.$refs.ModifyBaseConfig.open();
  155. }
  156. }
  157. };
  158. </script>