index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <template>
  2. <div class="cur-exam h-full">
  3. <div class="operate-box flex items-center justify-between">
  4. <div class="lf h-full flex items-center" v-if="curExam">
  5. <span class="no">No.{{ curExam?.id }}</span>
  6. <qm-button type="primary" ghost size="small"
  7. >{{ curExam?.mode }}模式</qm-button
  8. >
  9. <div class="exam-name">{{ curExam?.name }}</div>
  10. </div>
  11. <div v-else></div>
  12. <div class="rt h-full flex items-center">
  13. <qm-button :icon="h(SwapOutlined)" @click="showExamListModal = true"
  14. >切换考试</qm-button
  15. >
  16. <qm-button
  17. class="ml-10px"
  18. :icon="h(EditOutlined)"
  19. @click="editExam"
  20. :disabled="!curExam"
  21. >编辑</qm-button
  22. >
  23. <qm-button
  24. class="ml-10px"
  25. :icon="h(PlusCircleOutlined)"
  26. type="primary"
  27. @click="addExam"
  28. >新建</qm-button
  29. >
  30. </div>
  31. </div>
  32. <div class="page-main">
  33. <div v-if="!curExam" class="flex justify-center items-center h-full">
  34. <div class="none-center text-center">
  35. <img src="../../assets/imgs/none_data.png" />
  36. <p>当前没有考试,请新建考试</p>
  37. <qm-button
  38. :icon="h(PlusCircleOutlined)"
  39. type="primary"
  40. @click="addExam"
  41. >新建</qm-button
  42. >
  43. </div>
  44. </div>
  45. <div v-else class="cur-exam-box h-full">
  46. <div class="row row1">
  47. <div class="module">
  48. <div class="head">
  49. <div class="flex items-center">
  50. <div class="tag" :style="{ color: token.colorPrimary }">
  51. 步骤一
  52. </div>
  53. <div class="title">基础数据配置</div>
  54. </div>
  55. <div
  56. class="flex items-center cursor-pointer"
  57. :style="{ color: token.colorPrimary }"
  58. @click="toPage('BaseDataConfig')"
  59. >
  60. <span>进入</span>
  61. <RightOutlined />
  62. </div>
  63. </div>
  64. <div class="body">
  65. <div class="option">
  66. 科目数量:{{ allData.basic?.subjectCount }}
  67. </div>
  68. <div class="option">卡格式:{{ allData.basic?.cardCount }}</div>
  69. <div class="option">
  70. 考生人数:{{ allData.basic?.studentCount }}
  71. </div>
  72. </div>
  73. </div>
  74. <div class="module">
  75. <div class="head">
  76. <div class="flex items-center">
  77. <div class="tag" :style="{ color: token.colorPrimary }">
  78. 步骤二
  79. </div>
  80. <div class="title">扫描管理</div>
  81. </div>
  82. <div
  83. class="flex items-center cursor-pointer"
  84. :style="{ color: token.colorPrimary }"
  85. @click="toPage('ScanManage')"
  86. >
  87. <span>进入</span>
  88. <RightOutlined />
  89. </div>
  90. </div>
  91. <div class="body">
  92. <div class="option">
  93. 扫描进度:
  94. <p>
  95. 已扫描:{{ allData.scan?.scannedCount }},未扫描:{{
  96. allData.scan?.unexistCount
  97. }},完成比:{{ allData.scan?.scannedRate }}%
  98. </p>
  99. </div>
  100. <div class="option">
  101. 图片抽查:
  102. <p>
  103. 已完成:{{ allData.scan?.imageCheckCount }},未完成:{{
  104. allData.scan?.imageCheckTodoCount
  105. }},完成比:{{ allData.scan?.imageCheckRate }}%
  106. </p>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="module">
  111. <div class="head">
  112. <div class="flex items-center">
  113. <div class="tag" :style="{ color: token.colorPrimary }">
  114. 步骤三
  115. </div>
  116. <div class="title">复核校验</div>
  117. </div>
  118. <div
  119. class="flex items-center cursor-pointer"
  120. :style="{ color: token.colorPrimary }"
  121. @click="toPage('Review')"
  122. >
  123. <span>进入</span>
  124. <RightOutlined />
  125. </div>
  126. </div>
  127. <div class="body">
  128. <div class="option">
  129. 审核员<span style="font-weight: normal">(第一遍审核)</span>
  130. <p>
  131. 已完成:{{
  132. allData.assignedCheck?.auditorFinishCount
  133. }},待完成:{{
  134. allData.assignedCheck?.auditorTodoCount
  135. }},完成比:{{ allData.assignedCheck?.auditorFinishRate }}%
  136. </p>
  137. </div>
  138. <div class="option">
  139. 管理员<span style="font-weight: normal">(第二遍审核)</span>
  140. <p>
  141. 已完成:{{
  142. allData.assignedCheck?.adminFinishCount
  143. }},待完成:{{
  144. allData.assignedCheck?.adminTodoCount
  145. }},完成比:{{ allData.assignedCheck?.adminFinishRate }}%
  146. </p>
  147. </div>
  148. </div>
  149. </div>
  150. <div class="module">
  151. <div class="head">
  152. <div class="flex items-center">
  153. <div class="tag" :style="{ color: token.colorPrimary }">
  154. 步骤四
  155. </div>
  156. <div class="title">识别对照</div>
  157. </div>
  158. <div
  159. class="flex items-center cursor-pointer"
  160. :style="{ color: token.colorPrimary }"
  161. @click="toPage('RecognizeCheck')"
  162. >
  163. <span>进入</span>
  164. <RightOutlined />
  165. </div>
  166. </div>
  167. <div class="body">
  168. <div class="option">
  169. 识别嫌疑
  170. <p>
  171. 待处理:{{ allData.omr?.suspectTodoCount }},已处理:{{
  172. allData.omr?.suspectFinishCount
  173. }},完成比:{{ allData.omr?.suspectFinishRate }}%
  174. </p>
  175. </div>
  176. <div class="option">
  177. 自定义
  178. <p>
  179. 待处理:{{ allData.omr?.customizeTodoCount }},已处理:{{
  180. allData.omr?.customizeFinishCount
  181. }},完成比:{{ allData.omr?.customizeFinishRate }}%
  182. </p>
  183. <p>待生成:</p>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="row row2">
  189. <div class="module">
  190. <div class="head">
  191. <div class="flex items-center">
  192. <div class="tag" :style="{ color: token.colorPrimary }">
  193. 步骤五
  194. </div>
  195. <div class="title">缺考校验</div>
  196. </div>
  197. <div
  198. class="flex items-center cursor-pointer"
  199. :style="{ color: token.colorPrimary }"
  200. @click="toPage('AbsentCheck')"
  201. >
  202. <span>进入</span>
  203. <RightOutlined />
  204. </div>
  205. </div>
  206. <div class="body">
  207. <div class="option">
  208. 正常数量:{{ allData.absentCheck?.okCount }}
  209. </div>
  210. <div class="option">
  211. 缺考:{{ allData.absentCheck?.absentCount }}
  212. </div>
  213. <div class="option">
  214. 缺考待确认数量:{{ allData.absentCheck?.todoCount }}
  215. </div>
  216. </div>
  217. </div>
  218. <div class="module">
  219. <div class="head">
  220. <div class="flex items-center">
  221. <div class="tag" :style="{ color: token.colorPrimary }">
  222. 步骤六
  223. </div>
  224. <div class="title">数据检查</div>
  225. </div>
  226. <div
  227. class="flex items-center cursor-pointer"
  228. :style="{ color: token.colorPrimary }"
  229. @click="toPage('DataCheck')"
  230. >
  231. <span>进入</span>
  232. <RightOutlined />
  233. </div>
  234. </div>
  235. </div>
  236. <div class="module">
  237. <div class="head">
  238. <div class="flex items-center">
  239. <div class="tag" :style="{ color: token.colorPrimary }">
  240. 步骤七
  241. </div>
  242. <div class="title">图片检查</div>
  243. </div>
  244. <div
  245. class="flex items-center cursor-pointer"
  246. :style="{ color: token.colorPrimary }"
  247. @click="toPage('ImageCheck')"
  248. >
  249. <span>进入</span>
  250. <RightOutlined />
  251. </div>
  252. </div>
  253. </div>
  254. <div class="module">
  255. <div class="head">
  256. <div class="flex items-center">
  257. <div class="tag" :style="{ color: token.colorPrimary }">
  258. 步骤八
  259. </div>
  260. <div class="title">结果导出</div>
  261. </div>
  262. <div
  263. class="flex items-center cursor-pointer"
  264. :style="{ color: token.colorPrimary }"
  265. @click="toPage('ResultExport')"
  266. >
  267. <span>进入</span>
  268. <RightOutlined />
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. <my-modal
  276. v-model:open="showExamListModal"
  277. v-if="showExamListModal"
  278. title="切换考试"
  279. @ok="chooseExamHandler"
  280. :width="450"
  281. >
  282. <a-radio-group v-model:value="choosedExamId" class="exam-modal-body">
  283. <a-radio
  284. :style="radioStyle"
  285. v-for="item in examList"
  286. :key="item.id"
  287. :value="item.id"
  288. >
  289. <div class="flex-1 flex items-center justify-between">
  290. <span class="sub1">No.{{ item?.id }}</span>
  291. <span class="sub2">{{ item?.name }}</span>
  292. <span class="sub3">{{ item?.mode }}模式</span>
  293. </div>
  294. </a-radio>
  295. </a-radio-group>
  296. </my-modal>
  297. <AddExamDialog
  298. v-model="showAddDialog"
  299. v-if="showAddDialog"
  300. :curRow="curRow"
  301. @addSuccess="addSuccess"
  302. ></AddExamDialog>
  303. </div>
  304. </template>
  305. <script name="CurExam" lang="ts" setup>
  306. import { onMounted, ref, computed, h, watch, reactive } from "vue";
  307. import { getExamList } from "@/ap/exam";
  308. import { useUserStore } from "@/store";
  309. import AddExamDialog from "./AddExamDialog.vue";
  310. import { useRouter } from "vue-router";
  311. import {
  312. SwapOutlined,
  313. EditOutlined,
  314. PlusCircleOutlined,
  315. RightOutlined,
  316. } from "@ant-design/icons-vue";
  317. import { getExamOverview } from "@/ap/exam";
  318. import useToken from "@/hooks/useToken";
  319. const { token } = useToken();
  320. const router = useRouter();
  321. const toPage = (name: string) => {
  322. router.push({ name });
  323. };
  324. const showAddDialog = ref(false);
  325. const radioStyle = reactive({
  326. display: "flex",
  327. alignItems: "center",
  328. justifyContent: "between",
  329. marginBottom: "8px",
  330. });
  331. const userStore = useUserStore();
  332. const curExam = computed(() => {
  333. return userStore.curExam;
  334. });
  335. const choosedExamId = ref();
  336. const allData = ref<any>({});
  337. const getAllCardData = () => {
  338. getExamOverview({ examId: curExam.value.id }).then((res: any) => {
  339. allData.value = res || {};
  340. });
  341. };
  342. if (curExam.value?.id) {
  343. choosedExamId.value = curExam.value.id;
  344. getAllCardData();
  345. }
  346. watch(curExam, (exam: Exam | null) => {
  347. choosedExamId.value = exam?.id;
  348. getAllCardData();
  349. });
  350. const examList = ref<Exam[]>([]);
  351. const showExamListModal = ref(false);
  352. const _getExamList = () => {
  353. getExamList({ enable: true, pageNumber: 1, pageSize: 10000 }).then(
  354. (res: any) => {
  355. if (res?.result?.length) {
  356. examList.value = res.result || [];
  357. } else {
  358. examList.value = [];
  359. userStore.setCurExam(null);
  360. }
  361. if (!userStore.curExam && examList.value.length === 1) {
  362. userStore.setCurExam(examList.value[0]);
  363. }
  364. }
  365. );
  366. };
  367. const addSuccess = () => {
  368. getExamList({ enable: true, pageNumber: 1, pageSize: 10000 }).then(
  369. (res: any) => {
  370. if (res?.result?.length) {
  371. userStore.setCurExam(res.result[res.result.length - 1]);
  372. }
  373. }
  374. );
  375. };
  376. const chooseExamHandler = () => {
  377. let exam = examList.value.find((item: any) => item.id == choosedExamId.value);
  378. !!exam && userStore.setCurExam(exam);
  379. showExamListModal.value = false;
  380. };
  381. const curRow = ref();
  382. const addExam = () => {
  383. curRow.value = null;
  384. showAddDialog.value = true;
  385. };
  386. const editExam = () => {
  387. curRow.value = curExam.value;
  388. showAddDialog.value = true;
  389. };
  390. onMounted(() => {
  391. _getExamList();
  392. });
  393. watch(showExamListModal, (val: boolean) => {
  394. if (val) {
  395. _getExamList();
  396. if (curExam.value?.id) {
  397. choosedExamId.value = curExam.value.id;
  398. }
  399. }
  400. });
  401. </script>
  402. <style lang="less" scoped>
  403. .cur-exam {
  404. background-color: #fff;
  405. .none-center {
  406. & > img {
  407. height: 70px;
  408. margin-bottom: 6px;
  409. }
  410. & > p {
  411. color: @text-color3;
  412. margin-bottom: 16px;
  413. }
  414. }
  415. .exam-modal-body {
  416. width: 100%;
  417. :deep(.ant-radio-wrapper > span:last-child) {
  418. width: 100%;
  419. display: flex;
  420. }
  421. .sub1,
  422. .sub2 {
  423. color: @text-color1;
  424. }
  425. .sub3 {
  426. color: @text-color3;
  427. }
  428. }
  429. .page-main {
  430. height: calc(100% - 54px);
  431. .cur-exam-box {
  432. background: url(../../assets/imgs/cur_exam_bg.png) 0 0 no-repeat;
  433. background-size: 100% 100%;
  434. padding: 100px 34px 20px 34px;
  435. overflow: auto;
  436. .row {
  437. &:after {
  438. content: "";
  439. display: block;
  440. clear: both;
  441. }
  442. .module {
  443. float: left;
  444. width: calc((100% - 60px) / 4);
  445. background: linear-gradient(to top, #ffffff 0%, #f1f6ff 100%);
  446. border-radius: 8px;
  447. border: 1px solid #e5e6eb;
  448. padding: 15px;
  449. .body {
  450. padding: 20px 4px;
  451. height: 170px;
  452. .option {
  453. position: relative;
  454. color: @text-color1;
  455. font-weight: bold;
  456. padding-left: 14px;
  457. font-size: 14px;
  458. line-height: 24px;
  459. & > p {
  460. color: @text-color2;
  461. font-weight: normal;
  462. }
  463. &:not(:first-child) {
  464. margin-top: 10px;
  465. }
  466. &:after {
  467. content: "";
  468. position: absolute;
  469. z-index: 1;
  470. width: 6px;
  471. height: 6px;
  472. border-radius: 3px;
  473. top: 8px;
  474. left: 0;
  475. background: #4080ff;
  476. }
  477. }
  478. }
  479. &:not(:first-child) {
  480. margin-left: 20px;
  481. }
  482. .head {
  483. display: flex;
  484. justify-content: space-between;
  485. align-items: center;
  486. .tag {
  487. width: 52px;
  488. height: 24px;
  489. background: #ffffff;
  490. border-radius: 4px;
  491. border: 1px solid #bedaff;
  492. font-size: 12px;
  493. line-height: 22px;
  494. text-align: center;
  495. color: var(--primary-color);
  496. }
  497. .title {
  498. font-size: 16px;
  499. color: @text-color1;
  500. margin-left: 5px;
  501. font-weight: bold;
  502. }
  503. }
  504. }
  505. }
  506. .row2 {
  507. margin-top: 55px;
  508. }
  509. }
  510. }
  511. .operate-box {
  512. height: 54px;
  513. padding: 0 16px;
  514. border-bottom: 1px solid #e5e6eb;
  515. .lf {
  516. .no {
  517. min-width: 70px;
  518. padding: 0 5px;
  519. height: 24px;
  520. background: linear-gradient(135deg, #fdd62d 0%, #faad14 100%);
  521. border-radius: 4px;
  522. border: 1px solid #ffc53d;
  523. color: #fff;
  524. margin-right: 6px;
  525. text-align: center;
  526. line-height: 22px;
  527. }
  528. .exam-name {
  529. color: @text-color1;
  530. font-size: 16px;
  531. font-weight: bold;
  532. margin-left: 6px;
  533. }
  534. }
  535. .rt {
  536. }
  537. }
  538. }
  539. </style>