123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <template>
- <div class="school-set-recognition part-box part-box-pad">
- <el-form
- ref="modalFormComp"
- :model="modalForm"
- :rules="rules"
- label-width="160px"
- >
- <el-form-item label="扩展算法:" prop="extendAlgorithm">
- <el-radio-group v-model="modalForm.extendAlgorithm">
- <el-radio
- v-for="item in OPEN_STATUS"
- :key="item.value"
- :label="item.value"
- >{{ item.label }}</el-radio
- >
- </el-radio-group>
- <br />
- <p class="tips-info">
- (开启扩展算法后会对答题卡使用第二套算法进行识别,识别结果仅记录做研发分析,不影响正式算法识别结果)
- </p>
- <el-radio-group v-model="modalForm.extendAlgorithmType">
- <el-radio :key="1" :label="1">仅识别正式算法有嫌疑的题</el-radio>
- <el-radio :key="2" :label="2">识别全部答题卡</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="客观题检查扩展条件:">
- <el-checkbox v-model="modalForm.avoidSingleChoice">
- 单选题有且仅有一个识别答案不进客观题检查
- </el-checkbox>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" :loading="loading" @click="confirm"
- >保存</el-button
- >
- </el-form-item>
- </el-form>
- </div>
- </template>
- <script>
- import { OPEN_STATUS } from "@/constants/enumerate";
- import {
- schoolSetRecognitionInfo,
- schoolSetRecognitionUpdate,
- } from "../../api";
- export default {
- name: "SchoolSetRecognition",
- props: {
- school: {
- type: Object,
- default() {
- return {};
- },
- },
- },
- data() {
- return {
- modalForm: {
- // 扩展算法
- extendAlgorithm: false,
- extendAlgorithmType: 1,
- avoidSingleChoice: false,
- },
- OPEN_STATUS,
- loading: false,
- rules: {
- extendAlgorithm: [{ required: true, message: "请选择扩展算法" }],
- extendAlgorithmType: [
- { required: true, message: "请选择扩展算法类型" },
- ],
- },
- };
- },
- mounted() {
- this.initData();
- },
- methods: {
- async initData() {
- const data = await schoolSetRecognitionInfo(this.school.id);
- this.modalForm = data.result || {};
- },
- async confirm() {
- const valid = await this.$refs.modalFormComp.validate().catch(() => {});
- if (!valid) return;
- if (this.loading) return;
- this.loading = true;
- const datas = {
- ...this.modalForm,
- schoolId: this.school.id,
- };
- const res = await schoolSetRecognitionUpdate(datas).catch(() => {});
- this.loading = false;
- if (!res) return;
- this.$message.success("修改成功!");
- this.initData();
- },
- },
- };
- </script>
|