|
|
|
@ -1,9 +1,10 @@ |
|
|
|
|
import React, { Component } from "react"; |
|
|
|
|
import { Form, Input, Button, Radio, Checkbox, Select, message } from "antd"; |
|
|
|
|
import {Form, Input, Button, Radio, Checkbox, Select, message, Modal} from "antd"; |
|
|
|
|
import { dictionary } from "api/dict/index"; |
|
|
|
|
import { addQuestion, findIndustry } from "api/question"; |
|
|
|
|
import { CloseCircleOutlined } from '@ant-design/icons'; |
|
|
|
|
import * as XLSX from "xlsx"; |
|
|
|
|
import {addExamPaper} from "../../api/examPaper"; |
|
|
|
|
|
|
|
|
|
const { Option } = Select; |
|
|
|
|
|
|
|
|
@ -136,7 +137,10 @@ class QuestionAdd extends Component<any, States> { |
|
|
|
|
this.formRef.current.validateFields().then((values: any) => { |
|
|
|
|
const questions: any = []; |
|
|
|
|
const { formIds } = this.state; |
|
|
|
|
|
|
|
|
|
Modal.confirm({ |
|
|
|
|
title: `确认保存`, |
|
|
|
|
content: `是否保存试题?`, |
|
|
|
|
onOk: async () => { |
|
|
|
|
formIds.forEach((formId) => { |
|
|
|
|
let answer = values[`answer_${formId}`]; |
|
|
|
|
if (Array.isArray(answer)) { |
|
|
|
@ -168,6 +172,10 @@ class QuestionAdd extends Component<any, States> { |
|
|
|
|
}).catch(() => { |
|
|
|
|
message.error("新增试题时发生错误,请检查"); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
onCancel: () => { |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|