SchoolSetRecognition.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="school-set-recognition part-box part-box-pad">
  3. <el-form
  4. ref="modalFormComp"
  5. :model="modalForm"
  6. :rules="rules"
  7. label-width="160px"
  8. >
  9. <el-form-item label="扩展算法:" prop="extendAlgorithm">
  10. <el-radio-group v-model="modalForm.extendAlgorithm">
  11. <el-radio
  12. v-for="item in OPEN_STATUS"
  13. :key="item.value"
  14. :label="item.value"
  15. >{{ item.label }}</el-radio
  16. >
  17. </el-radio-group>
  18. <br />
  19. <p class="tips-info">
  20. (开启扩展算法后会对答题卡使用第二套算法进行识别,识别结果仅记录做研发分析,不影响正式算法识别结果)
  21. </p>
  22. <el-radio-group v-model="modalForm.extendAlgorithmType">
  23. <el-radio :key="1" :label="1">仅识别正式算法有嫌疑的题</el-radio>
  24. <el-radio :key="2" :label="2">识别全部答题卡</el-radio>
  25. </el-radio-group>
  26. </el-form-item>
  27. <el-form-item label="客观题检查扩展条件:">
  28. <el-checkbox v-model="modalForm.avoidSingleChoice">
  29. 单选题有且仅有一个识别答案不进客观题检查
  30. </el-checkbox>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button type="primary" :loading="loading" @click="confirm"
  34. >保存</el-button
  35. >
  36. </el-form-item>
  37. </el-form>
  38. </div>
  39. </template>
  40. <script>
  41. import { OPEN_STATUS } from "@/constants/enumerate";
  42. import {
  43. schoolSetRecognitionInfo,
  44. schoolSetRecognitionUpdate,
  45. } from "../../api";
  46. export default {
  47. name: "SchoolSetRecognition",
  48. props: {
  49. school: {
  50. type: Object,
  51. default() {
  52. return {};
  53. },
  54. },
  55. },
  56. data() {
  57. return {
  58. modalForm: {
  59. // 扩展算法
  60. extendAlgorithm: false,
  61. extendAlgorithmType: 1,
  62. avoidSingleChoice: false,
  63. },
  64. OPEN_STATUS,
  65. loading: false,
  66. rules: {
  67. extendAlgorithm: [{ required: true, message: "请选择扩展算法" }],
  68. extendAlgorithmType: [
  69. { required: true, message: "请选择扩展算法类型" },
  70. ],
  71. },
  72. };
  73. },
  74. mounted() {
  75. this.initData();
  76. },
  77. methods: {
  78. async initData() {
  79. const data = await schoolSetRecognitionInfo(this.school.id);
  80. this.modalForm = data.result || {};
  81. },
  82. async confirm() {
  83. const valid = await this.$refs.modalFormComp.validate().catch(() => {});
  84. if (!valid) return;
  85. if (this.loading) return;
  86. this.loading = true;
  87. const datas = {
  88. ...this.modalForm,
  89. schoolId: this.school.id,
  90. };
  91. const res = await schoolSetRecognitionUpdate(datas).catch(() => {});
  92. this.loading = false;
  93. if (!res) return;
  94. this.$message.success("修改成功!");
  95. this.initData();
  96. },
  97. },
  98. };
  99. </script>