MarkDetailProgress.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <template>
  2. <div class="mark-detail-progress">
  3. <div class="box-justify part-box part-box-pad">
  4. <el-breadcrumb separator="|">
  5. <el-breadcrumb-item
  6. >考生人数:{{ summary.studentCount }}</el-breadcrumb-item
  7. >
  8. <el-breadcrumb-item
  9. >已扫描人数:{{ summary.uploadCount }}</el-breadcrumb-item
  10. >
  11. <el-breadcrumb-item
  12. >缺考人数:{{ summary.absentCount }}</el-breadcrumb-item
  13. >
  14. <el-breadcrumb-item
  15. >评卷进度:{{ summary.percent || 0 }}%</el-breadcrumb-item
  16. >
  17. </el-breadcrumb>
  18. <div>
  19. <el-button type="primary" @click="initData">查询</el-button>
  20. <el-button
  21. type="primary"
  22. :loading="downloading"
  23. icon="el-icon-download"
  24. @click="toExport"
  25. >导出评卷员工作量</el-button
  26. >
  27. </div>
  28. </div>
  29. <div v-if="openClassMark" class="part-box part-box-pad">
  30. <div class="part-box-head">
  31. <h3>班级评卷进度</h3>
  32. </div>
  33. <el-form label-position="left" label-width="0" inline>
  34. <el-form-item>
  35. <el-input
  36. v-model.trim="filter.className"
  37. placeholder="班级"
  38. clearable
  39. >
  40. </el-input>
  41. </el-form-item>
  42. <el-form-item>
  43. <el-button type="primary" @click="getList(1)">查询</el-button>
  44. </el-form-item>
  45. </el-form>
  46. <el-table ref="TableList" :data="classList">
  47. <el-table-column
  48. prop="className"
  49. label="班级"
  50. min-width="200"
  51. ></el-table-column>
  52. <el-table-column
  53. class-name="action-column"
  54. label="评卷员"
  55. align="center"
  56. min-width="100"
  57. >
  58. <template slot-scope="scope">
  59. <el-button
  60. class="btn-primary"
  61. type="text"
  62. @click="toMarker(scope.row)"
  63. >{{ scope.row.markerCount }}</el-button
  64. >
  65. </template>
  66. </el-table-column>
  67. <el-table-column
  68. prop="taskCount"
  69. label="任务总数"
  70. min-width="100"
  71. ></el-table-column>
  72. <el-table-column
  73. prop="markedCount"
  74. label="完成总数"
  75. min-width="100"
  76. ></el-table-column>
  77. <el-table-column
  78. prop="leftCount"
  79. label="剩余总数"
  80. min-width="100"
  81. ></el-table-column>
  82. <el-table-column prop="percent" label="评卷进度" min-width="100">
  83. <span slot-scope="scope">{{ scope.row.percent || 0 }}%</span>
  84. </el-table-column>
  85. <el-table-column
  86. class-name="action-column"
  87. label="待仲裁数"
  88. width="100"
  89. align="center"
  90. fixed="right"
  91. >
  92. <template slot-scope="scope">
  93. <el-button
  94. class="btn-primary"
  95. type="text"
  96. @click="toArbitrate(scope.row)"
  97. >{{ scope.row.arbitrateCount }}</el-button
  98. >
  99. </template>
  100. </el-table-column>
  101. <el-table-column
  102. class-name="action-column"
  103. label="操作"
  104. width="100"
  105. align="center"
  106. fixed="right"
  107. >
  108. <template slot-scope="scope">
  109. <el-button
  110. class="btn-primary"
  111. type="text"
  112. @click="toDetail(scope.row)"
  113. >查看详情</el-button
  114. >
  115. </template>
  116. </el-table-column>
  117. </el-table>
  118. <div class="part-page">
  119. <el-pagination
  120. background
  121. layout="total, sizes, prev, pager, next, jumper"
  122. :pager-count="5"
  123. :current-page="current"
  124. :total="total"
  125. :page-size="size"
  126. @current-change="toPage"
  127. @size-change="pageSizeChange"
  128. >
  129. </el-pagination>
  130. </div>
  131. </div>
  132. <div class="part-box part-box-pad">
  133. <div class="part-box-head">
  134. <h3>题目评卷进度</h3>
  135. </div>
  136. <el-table ref="TableList" :data="questionList">
  137. <el-table-column prop="questionNumber" label="评阅题目" width="120">
  138. <template slot-scope="scope">
  139. <span>{{ scope.row.questionNumber }}</span>
  140. <el-tag
  141. v-if="scope.row.aiMark"
  142. class="tag-spin tag-wrap"
  143. size="medium"
  144. >AI智能评卷</el-tag
  145. >
  146. </template>
  147. </el-table-column>
  148. <el-table-column
  149. class-name="action-column"
  150. label="评卷员"
  151. align="center"
  152. min-width="100"
  153. >
  154. <template slot-scope="scope">
  155. <el-button
  156. class="btn-primary"
  157. type="text"
  158. @click="toMarker(scope.row)"
  159. >{{ scope.row.markerCount }}</el-button
  160. >
  161. </template>
  162. </el-table-column>
  163. <el-table-column
  164. prop="taskCount"
  165. label="任务总数"
  166. width="100"
  167. ></el-table-column>
  168. <el-table-column
  169. prop="markedCount"
  170. label="完成总数"
  171. width="100"
  172. ></el-table-column>
  173. <el-table-column
  174. prop="leftCount"
  175. label="剩余总数"
  176. width="100"
  177. ></el-table-column>
  178. <el-table-column
  179. prop="currentCount"
  180. label="正在评卷"
  181. width="100"
  182. ></el-table-column>
  183. <el-table-column prop="percent" label="评卷进度" width="100">
  184. <span slot-scope="scope">{{ scope.row.percent || 0 }}%</span>
  185. </el-table-column>
  186. <el-table-column
  187. class-name="action-column"
  188. label="待仲裁数"
  189. width="100"
  190. align="center"
  191. fixed="right"
  192. >
  193. <template slot-scope="scope">
  194. <el-button
  195. class="btn-primary"
  196. type="text"
  197. @click="toArbitrate(scope.row)"
  198. >{{ scope.row.arbitrateCount }}</el-button
  199. >
  200. </template>
  201. </el-table-column>
  202. <el-table-column
  203. class-name="action-column"
  204. label="操作"
  205. width="200"
  206. align="center"
  207. fixed="right"
  208. >
  209. <template slot-scope="scope">
  210. <template v-if="scope.row.aiMark">
  211. <el-button
  212. v-if="checkPrivilege('link', 'EnableAiMark', 'MarkManage')"
  213. class="btn-primary"
  214. type="text"
  215. @click="handleAiStatusUpdate(scope.row)"
  216. >{{ scope.row.enableAi ? "终止" : "开启" }}智能评卷</el-button
  217. >
  218. <el-button
  219. v-if="checkPrivilege('link', 'ResetAiMarkTask', 'MarkManage')"
  220. class="btn-primary"
  221. type="text"
  222. @click="handleAiReset(scope.row)"
  223. >重置AI智能评卷任务</el-button
  224. >
  225. </template>
  226. </template>
  227. </el-table-column>
  228. </el-table>
  229. </div>
  230. <class-mark-progress-dialog
  231. ref="ClassMarkProgressDialog"
  232. :data="curClass"
  233. />
  234. </div>
  235. </template>
  236. <script>
  237. import {
  238. markProgressSummary,
  239. markProgressClassListPage,
  240. markProgressMarkerExport,
  241. markProgressQuestionAiStatusUpdate,
  242. markProgressQuestionAiReset,
  243. } from "../../api";
  244. import { downloadByApi } from "@/plugins/download";
  245. import ClassMarkProgressDialog from "./ClassMarkProgressDialog.vue";
  246. export default {
  247. name: "mark-detail-progress",
  248. components: {
  249. ClassMarkProgressDialog,
  250. },
  251. props: {
  252. baseInfo: {
  253. type: Object,
  254. default() {
  255. return {};
  256. },
  257. },
  258. },
  259. data() {
  260. return {
  261. filter: {
  262. className: "",
  263. },
  264. size: this.GLOBAL.pageSize,
  265. current: 1,
  266. total: 0,
  267. classList: [],
  268. curClass: {},
  269. summary: {},
  270. questionList: [],
  271. curRow: {},
  272. openClassMark: false,
  273. downloading: false,
  274. };
  275. },
  276. mounted() {
  277. this.initData();
  278. },
  279. methods: {
  280. async initData() {
  281. await this.getSummary();
  282. if (this.openClassMark) this.toPage(1);
  283. },
  284. async getSummary() {
  285. const res = await markProgressSummary({
  286. examId: this.baseInfo.examId,
  287. paperNumber: this.baseInfo.paperNumber,
  288. });
  289. this.summary = res.totalInfo || {
  290. studentCount: "",
  291. uploadCount: "",
  292. absentCount: "",
  293. percent: "",
  294. };
  295. this.questionList = res.groupInfo || [];
  296. this.openClassMark = res.classMark;
  297. },
  298. async handleAiStatusUpdate(row) {
  299. const actionName = row.enableAi ? "终止" : "开启";
  300. const confirm = await this.$confirm(
  301. `确定要${actionName}AI智能评卷任务?`,
  302. "提示",
  303. {
  304. type: "warning",
  305. }
  306. ).catch(() => {});
  307. if (confirm !== "confirm") return;
  308. await markProgressQuestionAiStatusUpdate({
  309. questionId: row.questionId,
  310. enableAi: !row.enableAi,
  311. });
  312. this.$message.success("操作成功");
  313. this.initData();
  314. },
  315. async handleAiReset(row) {
  316. const confirm = await this.$confirm(
  317. "确定要重置AI智能评卷任务?",
  318. "提示",
  319. {
  320. type: "warning",
  321. }
  322. ).catch(() => {});
  323. if (confirm !== "confirm") return;
  324. await markProgressQuestionAiReset(row.questionId);
  325. this.$message.success("重置成功");
  326. this.initData();
  327. },
  328. async getList() {
  329. const datas = {
  330. examId: this.baseInfo.examId,
  331. paperNumber: this.baseInfo.paperNumber,
  332. ...this.filter,
  333. pageNumber: this.current,
  334. pageSize: this.size,
  335. };
  336. const data = await markProgressClassListPage(datas);
  337. if (!data) return;
  338. this.classList = data.records;
  339. this.total = data.total;
  340. },
  341. toPage(page) {
  342. this.current = page;
  343. this.getList();
  344. },
  345. toArbitrate(row) {
  346. if (row.className) this.$ls.set("preset-className", row.className);
  347. this.$ls.set("preset-questionId", row.questionId);
  348. this.$emit("to-menu", "arbitration");
  349. },
  350. toMarker(row) {
  351. if (row.className) this.$ls.set("preset-className", row.className);
  352. this.$ls.set("preset-questionId", row.questionId);
  353. this.$emit("to-menu", "marker");
  354. },
  355. async toExport() {
  356. if (this.downloading) return;
  357. this.downloading = true;
  358. const res = await downloadByApi(() => {
  359. return markProgressMarkerExport({
  360. examId: this.baseInfo.examId,
  361. courseId: this.baseInfo.courseId,
  362. paperNumber: this.baseInfo.paperNumber,
  363. });
  364. }).catch((e) => {
  365. this.$message.error(e || "下载失败,请重新尝试!");
  366. });
  367. this.downloading = false;
  368. if (!res) return;
  369. this.$message.success("下载成功!");
  370. },
  371. toDetail(row) {
  372. this.curClass = {
  373. ...row,
  374. examId: this.baseInfo.examId,
  375. paperNumber: this.baseInfo.paperNumber,
  376. };
  377. this.$refs.ClassMarkProgressDialog.open();
  378. },
  379. },
  380. };
  381. </script>