MarkerDetail.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <div>
  3. <section class="content">
  4. <div class="box box-info">
  5. <div class="box-header with-border">
  6. <h3 class="box-title">
  7. <span>评卷员详情</span> <span>({{ $route.params.userName }})</span>
  8. </h3>
  9. <div class="box-tools pull-right"></div>
  10. </div>
  11. <div class="box-body">
  12. <el-form
  13. :inline="true"
  14. :model="formSearch"
  15. label-position="right"
  16. label-width="80px"
  17. >
  18. <el-form-item label="课程代码" class="pull-left">
  19. <el-input
  20. placeholder="课程代码"
  21. v-model="formSearch.courseCode"
  22. ></el-input>
  23. </el-form-item>
  24. <el-form-item label="课程名称" class="pull-left">
  25. <el-input
  26. placeholder="课程名称"
  27. v-model="formSearch.courseName"
  28. ></el-input>
  29. </el-form-item>
  30. <el-form-item class="pull-right">
  31. <el-button
  32. size="small"
  33. type="primary"
  34. icon="search"
  35. @click="searchSetting"
  36. >查询</el-button
  37. >
  38. <!--
  39. <el-button size="small" type="primary" icon="info" @click="exportMarker">导出</el-button>
  40. -->
  41. <el-button
  42. size="small"
  43. type="primary"
  44. icon="caret-left"
  45. @click="back"
  46. >返回</el-button
  47. >
  48. </el-form-item>
  49. </el-form>
  50. <!-- 页面列表 -->
  51. <el-table
  52. v-loading="loading"
  53. element-loading-text="拼命加载中"
  54. :data="tableData"
  55. border
  56. style="width: 100%"
  57. >
  58. <el-table-column label="课程名称" width="200" prop="name" />
  59. <el-table-column label="课程代码" min-width="100" prop="code" />
  60. <el-table-column
  61. label="已评数量"
  62. min-width="200"
  63. prop="markedCount"
  64. />
  65. <el-table-column
  66. label="打回数量"
  67. min-width="100"
  68. prop="rejectCount"
  69. />
  70. <el-table-column label="完成状态" min-width="100">
  71. <template slot-scope="scope">
  72. <div>
  73. <span v-if="scope.row.leftCount == 0">完成</span>
  74. <span v-if="scope.row.leftCount != 0">未完成</span>
  75. </div>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <div class="page pull-right">
  80. <el-pagination
  81. background
  82. @current-change="handleSettingCurrentChange"
  83. :current-page="currentPage"
  84. :page-size="10"
  85. layout="total, prev, pager, next, jumper"
  86. :total="total"
  87. >
  88. </el-pagination>
  89. </div>
  90. </div>
  91. </div>
  92. </section>
  93. </div>
  94. </template>
  95. <script>
  96. import { MARKING_API } from "../constants/constants";
  97. import { mapState } from "vuex";
  98. export default {
  99. data() {
  100. return {
  101. formSearch: {
  102. courseCode: "",
  103. courseName: ""
  104. },
  105. tableData: [],
  106. oldData: [],
  107. currentPage: 1,
  108. pageSize: 10,
  109. total: 10,
  110. loading: true,
  111. workId: "",
  112. examId: "",
  113. courseCode: "",
  114. examName: ""
  115. };
  116. },
  117. methods: {
  118. handleSettingCurrentChange(val) {
  119. this.currentPage = val;
  120. this.searchSetting();
  121. },
  122. pagingSetting() {
  123. var start = (this.currentPage - 1) * this.pageSize;
  124. var end =
  125. this.currentPage * this.pageSize < this.total
  126. ? this.currentPage * this.pageSize
  127. : this.total;
  128. var tempData = [];
  129. console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
  130. for (let i = start; i < end; i++) {
  131. tempData.push(this.tableData[i]);
  132. }
  133. this.tableData = tempData;
  134. },
  135. initSetting() {
  136. this.loading = true;
  137. this.$http
  138. .get(
  139. MARKING_API +
  140. "/markCourses/all/marker/0/" +
  141. this.pageSize +
  142. "?workId=" +
  143. this.workId +
  144. "&userId=" +
  145. this.userId
  146. )
  147. .then(response => {
  148. console.log(response);
  149. this.tableData = response.data.content;
  150. this.total = response.data.totalElements;
  151. this.loading = false;
  152. });
  153. },
  154. searchSetting() {
  155. this.loading = true;
  156. this.$http
  157. .get(
  158. MARKING_API +
  159. "/markCourses/all/marker/" +
  160. (this.currentPage - 1) +
  161. "/" +
  162. this.pageSize +
  163. "?workId=" +
  164. this.workId +
  165. "&userId=" +
  166. this.userId,
  167. { params: this.formSearch }
  168. )
  169. .then(response => {
  170. console.log(response);
  171. this.tableData = response.data.content;
  172. this.total = response.data.totalElements;
  173. this.loading = false;
  174. });
  175. },
  176. back() {
  177. this.$router.push({
  178. path:
  179. "/marking/marker/" +
  180. this.workId +
  181. "/" +
  182. this.examId +
  183. "/" +
  184. this.examName
  185. });
  186. }
  187. },
  188. computed: {
  189. ...mapState({ user: state => state.user })
  190. },
  191. created() {
  192. this.workId = this.$route.params.workId;
  193. this.examId = this.$route.params.examId;
  194. this.examName = this.$route.params.name;
  195. this.userName = this.$route.params.userName;
  196. this.userId = this.$route.params.markerId;
  197. this.initSetting();
  198. }
  199. };
  200. </script>
  201. <style lang="css" scoped>
  202. li {
  203. list-style-type: none;
  204. }
  205. .searchFrame {
  206. margin-right: 10px;
  207. margin-bottom: 10px;
  208. }
  209. .page{
  210. margin-top: 10px;
  211. }
  212. .f_button{
  213. display:block;
  214. width:57px;
  215. height:20px;
  216. border:1px solid #CCC;
  217. background:#FFF;
  218. font-size: small;
  219. }
  220. </style>