|
@@ -22,6 +22,7 @@ const formItemLayout = {
|
|
|
|
|
|
const Step2 = (props) => {
|
|
const Step2 = (props) => {
|
|
const [form] = Form.useForm();
|
|
const [form] = Form.useForm();
|
|
|
|
+ const [addCaseForm] = Form.useForm();
|
|
const { data, dispatch, submitting, reportCommonInfo, testCaseList } = props;
|
|
const { data, dispatch, submitting, reportCommonInfo, testCaseList } = props;
|
|
// console.log(reportCommonInfo,props)
|
|
// console.log(reportCommonInfo,props)
|
|
const [showTaskRecommendModal, setTaskRecommendModal] = useState(false);
|
|
const [showTaskRecommendModal, setTaskRecommendModal] = useState(false);
|
|
@@ -35,10 +36,10 @@ const Step2 = (props) => {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- const { validateFields, getFieldsValue } = form;
|
|
|
|
|
|
+ const { validateFields, getFieldsValue } = addCaseForm;
|
|
|
|
|
|
const handleAddTestCase = () => {
|
|
const handleAddTestCase = () => {
|
|
- form.validateFields().then((res) => {
|
|
|
|
|
|
+ addCaseForm.validateFields().then((res) => {
|
|
let formData = new FormData();
|
|
let formData = new FormData();
|
|
// formData.append("id", values.reportName);
|
|
// formData.append("id", values.reportName);
|
|
formData.append('report_id', reportCommonInfo.id);
|
|
formData.append('report_id', reportCommonInfo.id);
|
|
@@ -62,17 +63,14 @@ const Step2 = (props) => {
|
|
};
|
|
};
|
|
|
|
|
|
const handleEditTestCase = (item) => {
|
|
const handleEditTestCase = (item) => {
|
|
- //setCurrTestCase(item);
|
|
|
|
currentTestCaseRef.current = item;
|
|
currentTestCaseRef.current = item;
|
|
- //console.log(currTestCase)
|
|
|
|
|
|
+ addCaseForm.setFieldsValue(currentTestCaseRef.current)
|
|
setAddTestCaseModal(true);
|
|
setAddTestCaseModal(true);
|
|
};
|
|
};
|
|
|
|
|
|
const handleClickAddCase = ()=>{
|
|
const handleClickAddCase = ()=>{
|
|
- // setCurrTestCase({});
|
|
|
|
currentTestCaseRef.current = {};
|
|
currentTestCaseRef.current = {};
|
|
- addCaseform.resetFields();
|
|
|
|
- //console.log(currTestCase)
|
|
|
|
|
|
+ addCaseForm.resetFields();
|
|
setAddTestCaseModal(true);
|
|
setAddTestCaseModal(true);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -226,8 +224,8 @@ const Step2 = (props) => {
|
|
</div>
|
|
</div>
|
|
</Card>
|
|
</Card>
|
|
<Modal title="添加测试用例" width={720}
|
|
<Modal title="添加测试用例" width={720}
|
|
- forceRender={ true }
|
|
|
|
visible={showAddTestCaseModal}
|
|
visible={showAddTestCaseModal}
|
|
|
|
+ forceRender={true}
|
|
className="addModal"
|
|
className="addModal"
|
|
footer={[
|
|
footer={[
|
|
<Button key='submit' type="primary" htmlType="submit" onClick={handleAddTestCase}>添加</Button>,
|
|
<Button key='submit' type="primary" htmlType="submit" onClick={handleAddTestCase}>添加</Button>,
|
|
@@ -240,8 +238,7 @@ const Step2 = (props) => {
|
|
<ExclamationCircleFilled className={styles.addModalInfo} />为了评分准确,请勿提交重复测试用例
|
|
<ExclamationCircleFilled className={styles.addModalInfo} />为了评分准确,请勿提交重复测试用例
|
|
<Form
|
|
<Form
|
|
{...formItemLayout}
|
|
{...formItemLayout}
|
|
- addCaseform={form}
|
|
|
|
- initialValues={currentTestCaseRef.current}
|
|
|
|
|
|
+ form={addCaseForm}
|
|
layout="horizontal"
|
|
layout="horizontal"
|
|
className={styles.stepForm}
|
|
className={styles.stepForm}
|
|
>
|
|
>
|
|
@@ -267,7 +264,7 @@ const Step2 = (props) => {
|
|
},
|
|
},
|
|
]}
|
|
]}
|
|
>
|
|
>
|
|
- <Input.TextArea autoSize={{ minRows: 3, maxRows: Infinity }}/>
|
|
|
|
|
|
+ <Input.TextArea autoSize={{ minRows: 3, maxRows: 999 }}/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item
|
|
<Form.Item
|
|
label="测试步骤"
|
|
label="测试步骤"
|
|
@@ -279,7 +276,7 @@ const Step2 = (props) => {
|
|
},
|
|
},
|
|
]}
|
|
]}
|
|
>
|
|
>
|
|
- <Input.TextArea autoSize={{ minRows: 3, maxRows: Infinity }}/>
|
|
|
|
|
|
+ <Input.TextArea autoSize={{ minRows: 3, maxRows: 999 }}/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item
|
|
<Form.Item
|
|
label="预期结果"
|
|
label="预期结果"
|
|
@@ -291,7 +288,7 @@ const Step2 = (props) => {
|
|
},
|
|
},
|
|
]}
|
|
]}
|
|
>
|
|
>
|
|
- <Input.TextArea autoSize={{ minRows: 3, maxRows: Infinity }}/>
|
|
|
|
|
|
+ <Input.TextArea autoSize={{ minRows: 3, maxRows: 999 }}/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Form>
|
|
</Form>
|
|
</Modal>
|
|
</Modal>
|