Marker.vue 6.5 KB

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