MarkerDetail.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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="70px"
  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="search"
  33. >查询</el-button
  34. >
  35. <el-button
  36. size="small"
  37. type="primary"
  38. icon="el-icon-download"
  39. @click="this.export"
  40. >导出</el-button
  41. >
  42. <el-button
  43. size="small"
  44. type="primary"
  45. icon="el-icon-arrow-left"
  46. @click="back"
  47. >返回</el-button
  48. >
  49. </el-form-item>
  50. </el-form>
  51. <div class="block-seperator"></div>
  52. <!-- 页面列表 -->
  53. <el-table
  54. stripe
  55. v-loading="loading"
  56. element-loading-text="拼命加载中"
  57. :data="tableData"
  58. border
  59. style="width: 100%"
  60. >
  61. <el-table-column label="课程名称" width="200" prop="name" />
  62. <el-table-column label="课程代码" min-width="100" prop="code" />
  63. <el-table-column
  64. label="已评数量"
  65. min-width="200"
  66. prop="markedCount"
  67. sortable
  68. />
  69. <el-table-column
  70. label="打回数量"
  71. min-width="100"
  72. prop="rejectCount"
  73. sortable
  74. />
  75. <el-table-column label="完成状态" min-width="100">
  76. <template slot-scope="scope">
  77. <div>
  78. <span v-if="scope.row.leftCount == 0">完成</span>
  79. <span v-if="scope.row.leftCount != 0">未完成</span>
  80. </div>
  81. </template>
  82. </el-table-column>
  83. </el-table>
  84. <div class="page pull-right">
  85. <el-pagination
  86. background
  87. @current-change="handleSettingCurrentChange"
  88. @size-change="handleSizeChange"
  89. :current-page="currentPage"
  90. :page-size="pageSize"
  91. :page-sizes="[10, 20, 50, 100, 200, 300]"
  92. layout="total, sizes, prev, pager, next, jumper"
  93. :total="total"
  94. ></el-pagination>
  95. </div>
  96. </div>
  97. </div>
  98. </section>
  99. </div>
  100. </template>
  101. <script>
  102. import { MARKING_API } from "@/constants/constants";
  103. import { mapState } from "vuex";
  104. import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
  105. export default {
  106. data() {
  107. return {
  108. formSearch: {
  109. courseCode: "",
  110. courseName: ""
  111. },
  112. tableData: [],
  113. oldData: [],
  114. currentPage: 1,
  115. pageSize: 10,
  116. total: 10,
  117. loading: true,
  118. workId: "",
  119. courseCode: ""
  120. };
  121. },
  122. components: {
  123. LinkTitlesCustom
  124. },
  125. methods: {
  126. export() {
  127. var key = this.user.key;
  128. var token = this.user.token;
  129. let url =
  130. MARKING_API +
  131. "/markCourses/progress/export?workId=" +
  132. this.workId +
  133. "&$key=" +
  134. key +
  135. "&$token=" +
  136. token;
  137. let userId = this.userId;
  138. if (userId) {
  139. url = url + "&userId=" + userId;
  140. }
  141. let courseCode = this.formSearch.courseCode;
  142. if (courseCode) {
  143. url = url + "&courseCode=" + courseCode;
  144. }
  145. let courseName = this.formSearch.courseName;
  146. if (courseName) {
  147. url = url + "&courseName=" + courseName;
  148. }
  149. window.location.href = url;
  150. },
  151. handleSettingCurrentChange(val) {
  152. this.currentPage = val;
  153. this.searchSetting();
  154. },
  155. handleSizeChange(val) {
  156. this.pageSize = val;
  157. this.searchSetting();
  158. },
  159. pagingSetting() {
  160. var start = (this.currentPage - 1) * this.pageSize;
  161. var end =
  162. this.currentPage * this.pageSize < this.total
  163. ? this.currentPage * this.pageSize
  164. : this.total;
  165. var tempData = [];
  166. console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
  167. for (let i = start; i < end; i++) {
  168. tempData.push(this.tableData[i]);
  169. }
  170. this.tableData = tempData;
  171. },
  172. initSetting() {
  173. this.loading = true;
  174. this.$http
  175. .get(
  176. MARKING_API +
  177. "/markCourses/all/marker/0/" +
  178. this.pageSize +
  179. "?workId=" +
  180. this.workId +
  181. "&userId=" +
  182. this.userId
  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. search() {
  192. this.currentPage = 1;
  193. this.searchSetting();
  194. },
  195. searchSetting() {
  196. this.loading = true;
  197. this.$http
  198. .get(
  199. MARKING_API +
  200. "/markCourses/all/marker/" +
  201. (this.currentPage - 1) +
  202. "/" +
  203. this.pageSize +
  204. "?workId=" +
  205. this.workId +
  206. "&userId=" +
  207. this.userId,
  208. { params: this.formSearch }
  209. )
  210. .then(response => {
  211. console.log(response);
  212. this.tableData = response.data.content;
  213. this.total = response.data.totalElements;
  214. this.loading = false;
  215. });
  216. },
  217. back() {
  218. this.$router.back();
  219. }
  220. },
  221. computed: {
  222. ...mapState({ user: state => state.user })
  223. },
  224. created() {
  225. this.workId = this.$route.params.workId;
  226. this.userName = this.$route.params.userName;
  227. this.userId = this.$route.params.markerId;
  228. this.initSetting();
  229. }
  230. };
  231. </script>
  232. <style lang="css" scoped>
  233. li {
  234. list-style-type: none;
  235. }
  236. .searchFrame {
  237. margin-right: 10px;
  238. margin-bottom: 10px;
  239. }
  240. .page{
  241. margin-top: 10px;
  242. }
  243. .f_button{
  244. display:block;
  245. width:57px;
  246. height:20px;
  247. border:1px solid #CCC;
  248. background:#FFF;
  249. font-size: small;
  250. }
  251. </style>