MarkDetailProgress.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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="评阅题目" min-width="140">
  138. <template slot-scope="scope">
  139. <span class="mr-1">{{ 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. min-width="100"
  152. >
  153. <template slot-scope="scope">
  154. <el-button
  155. class="btn-primary"
  156. type="text"
  157. @click="toMarker(scope.row)"
  158. >{{ scope.row.markerCount }}</el-button
  159. >
  160. </template>
  161. </el-table-column>
  162. <el-table-column
  163. prop="taskCount"
  164. label="任务总数"
  165. min-width="80"
  166. ></el-table-column>
  167. <el-table-column
  168. prop="markedCount"
  169. label="完成总数"
  170. min-width="80"
  171. ></el-table-column>
  172. <el-table-column
  173. prop="leftCount"
  174. label="剩余总数"
  175. min-width="80"
  176. ></el-table-column>
  177. <el-table-column
  178. prop="currentCount"
  179. label="正在评卷"
  180. min-width="80"
  181. ></el-table-column>
  182. <el-table-column prop="percent" label="评卷进度" min-width="80">
  183. <span slot-scope="scope">{{ scope.row.percent || 0 }}%</span>
  184. </el-table-column>
  185. <el-table-column
  186. class-name="action-column"
  187. label="待仲裁数"
  188. width="100"
  189. fixed="right"
  190. >
  191. <template slot-scope="scope">
  192. <el-button
  193. class="btn-primary"
  194. type="text"
  195. @click="toArbitrate(scope.row)"
  196. >{{ scope.row.arbitrateCount }}</el-button
  197. >
  198. </template>
  199. </el-table-column>
  200. <el-table-column
  201. class-name="action-column"
  202. label="操作"
  203. width="250"
  204. fixed="right"
  205. >
  206. <template slot-scope="scope">
  207. <template v-if="scope.row.aiMark">
  208. <el-button
  209. v-if="checkPrivilege('link', 'EnableAiMark', 'MarkManage')"
  210. class="btn-primary"
  211. type="text"
  212. @click="handleAiStatusUpdate(scope.row)"
  213. >{{ scope.row.enableAi ? "终止" : "开启" }}智能评卷</el-button
  214. >
  215. <el-button
  216. v-if="checkPrivilege('link', 'ResetAiMarkTask', 'MarkManage')"
  217. class="btn-primary"
  218. type="text"
  219. @click="handleAiReset(scope.row)"
  220. >重置AI智能评卷任务</el-button
  221. >
  222. </template>
  223. </template>
  224. </el-table-column>
  225. </el-table>
  226. </div>
  227. <class-mark-progress-dialog
  228. ref="ClassMarkProgressDialog"
  229. :data="curClass"
  230. />
  231. </div>
  232. </template>
  233. <script>
  234. import {
  235. markProgressSummary,
  236. markProgressClassListPage,
  237. markProgressMarkerExport,
  238. markProgressQuestionAiStatusUpdate,
  239. markProgressQuestionAiReset,
  240. } from "../../api";
  241. import { downloadByApi } from "@/plugins/download";
  242. import ClassMarkProgressDialog from "./ClassMarkProgressDialog.vue";
  243. export default {
  244. name: "mark-detail-progress",
  245. components: {
  246. ClassMarkProgressDialog,
  247. },
  248. props: {
  249. baseInfo: {
  250. type: Object,
  251. default() {
  252. return {};
  253. },
  254. },
  255. },
  256. data() {
  257. return {
  258. filter: {
  259. className: "",
  260. },
  261. size: this.GLOBAL.pageSize,
  262. current: 1,
  263. total: 0,
  264. classList: [],
  265. curClass: {},
  266. summary: {},
  267. questionList: [],
  268. curRow: {},
  269. openClassMark: false,
  270. downloading: false,
  271. };
  272. },
  273. mounted() {
  274. this.initData();
  275. },
  276. methods: {
  277. async initData() {
  278. await this.getSummary();
  279. if (this.openClassMark) this.toPage(1);
  280. },
  281. async getSummary() {
  282. const res = await markProgressSummary({
  283. examId: this.baseInfo.examId,
  284. paperNumber: this.baseInfo.paperNumber,
  285. });
  286. this.summary = res.totalInfo || {
  287. studentCount: "",
  288. uploadCount: "",
  289. absentCount: "",
  290. percent: "",
  291. };
  292. this.questionList = res.groupInfo || [];
  293. this.openClassMark = res.classMark;
  294. },
  295. async handleAiStatusUpdate(row) {
  296. const actionName = row.enableAi ? "终止" : "开启";
  297. const confirm = await this.$confirm(
  298. `确定要${actionName}AI智能评卷任务?`,
  299. "提示",
  300. {
  301. type: "warning",
  302. }
  303. ).catch(() => {});
  304. if (confirm !== "confirm") return;
  305. await markProgressQuestionAiStatusUpdate({
  306. questionId: row.questionId,
  307. enableAi: !row.enableAi,
  308. });
  309. this.$message.success("操作成功");
  310. this.initData();
  311. },
  312. async handleAiReset(row) {
  313. const confirm = await this.$confirm(
  314. "确定要重置AI智能评卷任务?",
  315. "提示",
  316. {
  317. type: "warning",
  318. }
  319. ).catch(() => {});
  320. if (confirm !== "confirm") return;
  321. await markProgressQuestionAiReset(row.questionId);
  322. this.$message.success("重置成功");
  323. this.initData();
  324. },
  325. async getList() {
  326. const datas = {
  327. examId: this.baseInfo.examId,
  328. paperNumber: this.baseInfo.paperNumber,
  329. ...this.filter,
  330. pageNumber: this.current,
  331. pageSize: this.size,
  332. };
  333. const data = await markProgressClassListPage(datas);
  334. if (!data) return;
  335. this.classList = data.records;
  336. this.total = data.total;
  337. },
  338. toPage(page) {
  339. this.current = page;
  340. this.getList();
  341. },
  342. toArbitrate(row) {
  343. if (row.className) this.$ls.set("preset-className", row.className);
  344. this.$ls.set("preset-questionId", row.questionId);
  345. this.$emit("to-menu", "arbitration");
  346. },
  347. toMarker(row) {
  348. if (row.className) this.$ls.set("preset-className", row.className);
  349. this.$ls.set("preset-questionId", row.questionId);
  350. this.$emit("to-menu", "marker");
  351. },
  352. async toExport() {
  353. if (this.downloading) return;
  354. this.downloading = true;
  355. const res = await downloadByApi(() => {
  356. return markProgressMarkerExport({
  357. examId: this.baseInfo.examId,
  358. courseId: this.baseInfo.courseId,
  359. paperNumber: this.baseInfo.paperNumber,
  360. });
  361. }).catch((e) => {
  362. this.$message.error(e || "下载失败,请重新尝试!");
  363. });
  364. this.downloading = false;
  365. if (!res) return;
  366. this.$message.success("下载成功!");
  367. },
  368. toDetail(row) {
  369. this.curClass = {
  370. ...row,
  371. examId: this.baseInfo.examId,
  372. paperNumber: this.baseInfo.paperNumber,
  373. };
  374. this.$refs.ClassMarkProgressDialog.open();
  375. },
  376. },
  377. };
  378. </script>