MarkerDetail.vue 6.1 KB

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