Merge remote-tracking branch 'origin/main'

main
liuyiliang 3 months ago
commit dd9198a5fd
  1. 10
      packages/examination/src/views/examPaper/examPaperAdd.tsx
  2. 16
      packages/examination/src/views/question/questionAdd.tsx
  3. 11
      packages/examination/src/views/question/questionEdit.tsx

@ -70,10 +70,12 @@ class ExamPaperAdd extends Component<any, States> {
componentDidMount() {
this.handleFindDict();
const { state } = this.props.location;
const { id, isEdit } = state;
this.setState({ id: id ,isEdit: isEdit});
if(isEdit === 'true'){
this.handleGetDetail(id);
if (state){
const { id, isEdit } = state;
this.setState({ id: id ,isEdit: isEdit});
if(isEdit === 'true'){
this.handleGetDetail(id);
}
}
}

@ -376,13 +376,13 @@ class QuestionAdd extends Component<any, States> {
<Form.Item name={`optionA_${formId}`}
rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
<Input placeholder="请输入答案" maxLength={100} style={{ width: 500 }} />
</Form.Item>
<Radio value="B">B</Radio>
<Form.Item name={`optionB_${formId}`}
rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
<Input placeholder="请输入答案" maxLength={100} style={{ width: 500 }} />
</Form.Item>
</div>
<div style={{ display: "flex", marginTop: 10 }}>
@ -390,13 +390,13 @@ class QuestionAdd extends Component<any, States> {
<Form.Item name={`optionC_${formId}`}
rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
<Input placeholder="请输入答案" maxLength={100} style={{ width: 500 }} />
</Form.Item>
<Radio value="D">D</Radio>
<Form.Item name={`optionD_${formId}`}
rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
<Input placeholder="请输入答案" maxLength={100} style={{ width: 500 }} />
</Form.Item>
</div>
</Radio.Group>
@ -407,13 +407,13 @@ class QuestionAdd extends Component<any, States> {
<Form.Item name={`optionA_${formId}`}
rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
<Input placeholder="请输入答案" maxLength={100} style={{ width: 500 }} />
</Form.Item>
<Checkbox value="B">B</Checkbox>
<Form.Item name={`optionB_${formId}`}
rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
<Input placeholder="请输入答案" maxLength={100} style={{ width: 500 }} />
</Form.Item>
</div>
<div style={{ display: "flex", marginTop: 10 }}>
@ -421,13 +421,13 @@ class QuestionAdd extends Component<any, States> {
<Form.Item name={`optionC_${formId}`}
rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
<Input placeholder="请输入答案" maxLength={100} style={{ width: 500 }} />
</Form.Item>
<Checkbox value="D">D</Checkbox>
<Form.Item name={`optionD_${formId}`}
rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
<Input placeholder="请输入答案" maxLength={100} style={{ width: 500 }} />
</Form.Item>
</div>
</Checkbox.Group>

@ -79,6 +79,9 @@ class QuestionEdit extends Component<any, States> {
questionTypes: value
};
});
const formValues = {};
formValues[`answer`] = '';
this.formRef.current.setFieldsValue(formValues);
};
// 保存修改
@ -201,6 +204,7 @@ class QuestionEdit extends Component<any, States> {
>
<Input
placeholder="请输入答案"
maxLength={100}
style={{ width: 500 }}
/>
</Form.Item>
@ -211,6 +215,7 @@ class QuestionEdit extends Component<any, States> {
>
<Input
placeholder="请输入答案"
maxLength={100}
style={{ width: 500 }}
/>
</Form.Item>
@ -223,6 +228,7 @@ class QuestionEdit extends Component<any, States> {
>
<Input
placeholder="请输入答案"
maxLength={100}
style={{ width: 500 }}
/>
</Form.Item>
@ -233,6 +239,7 @@ class QuestionEdit extends Component<any, States> {
>
<Input
placeholder="请输入答案"
maxLength={100}
style={{ width: 500 }}
/>
</Form.Item>
@ -248,6 +255,7 @@ class QuestionEdit extends Component<any, States> {
>
<Input
placeholder="请输入答案"
maxLength={100}
style={{ width: 500 }}
/>
</Form.Item>
@ -258,6 +266,7 @@ class QuestionEdit extends Component<any, States> {
>
<Input
placeholder="请输入答案"
maxLength={100}
style={{ width: 500 }}
/>
</Form.Item>
@ -270,6 +279,7 @@ class QuestionEdit extends Component<any, States> {
>
<Input
placeholder="请输入答案"
maxLength={100}
style={{ width: 500 }}
/>
</Form.Item>
@ -280,6 +290,7 @@ class QuestionEdit extends Component<any, States> {
>
<Input
placeholder="请输入答案"
maxLength={100}
style={{ width: 500 }}
/>
</Form.Item>

Loading…
Cancel
Save