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() { componentDidMount() {
this.handleFindDict(); this.handleFindDict();
const { state } = this.props.location; const { state } = this.props.location;
const { id, isEdit } = state; if (state){
this.setState({ id: id ,isEdit: isEdit}); const { id, isEdit } = state;
if(isEdit === 'true'){ this.setState({ id: id ,isEdit: isEdit});
this.handleGetDetail(id); if(isEdit === 'true'){
this.handleGetDetail(id);
}
} }
} }

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

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

Loading…
Cancel
Save