|
@@ -15,7 +15,6 @@ import { recurrent, severity, bug_categories } from './const';
|
|
|
import { timeToString,getBase64 } from '../../utils';
|
|
|
|
|
|
import BugGuideTree from '../BugGuideTree';
|
|
|
-import { instanceOf } from 'prop-types';
|
|
|
|
|
|
const formItemLayout = {
|
|
|
labelCol: {
|
|
@@ -117,9 +116,14 @@ const Step2 = (props) => {
|
|
|
formData,
|
|
|
report_id: reportCommonInfo.id,
|
|
|
},
|
|
|
- }).then((res) => {
|
|
|
+ }).then(({ res, testCaseList}) => {
|
|
|
if (res && res.id) {
|
|
|
message.success('添加成功!');
|
|
|
+ //添加成功后要把currCase指向新的
|
|
|
+ const currCase = testCaseList.filter(item=>
|
|
|
+ item.id === res.id
|
|
|
+ )
|
|
|
+ handleClickTestCase(currCase[0]);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -127,6 +131,15 @@ const Step2 = (props) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ // useEffect(()=>{
|
|
|
+ // const
|
|
|
+ // const currCase = testCaseList.filter(item=>
|
|
|
+ // item.id === res.id
|
|
|
+ // )
|
|
|
+ // console.log(currCase);
|
|
|
+ // currentTestCaseRef.current = currCase;
|
|
|
+ // },[testCaseList])
|
|
|
+
|
|
|
const handleAddBug = () => {
|
|
|
addBugForm.validateFields().then((res) => {
|
|
|
let formData = new FormData();
|
|
@@ -158,7 +171,6 @@ const Step2 = (props) => {
|
|
|
useCase: currentTestCaseRef.current.id,
|
|
|
},
|
|
|
}).then(res => {
|
|
|
-
|
|
|
setAddTestBugModal(false);
|
|
|
});
|
|
|
});
|
|
@@ -396,8 +408,8 @@ const Step2 = (props) => {
|
|
|
<div className={styles.testBugItemTitleBlock}>
|
|
|
<span className={styles.testBugItemTitle}>标题:</span>
|
|
|
<span className={styles.testBugItemTitleDetail}>{item.detail.title}</span>
|
|
|
- <Tag color="cyan">{recurrent[item.detail.recurrent]}</Tag>
|
|
|
- <Tag color="red">{severity[item.detail.severity]}</Tag>
|
|
|
+ <Tag color="cyan">{recurrent[item.detail.recurrent -1]}</Tag>
|
|
|
+ <Tag color="red">{severity[item.detail.severity -1]}</Tag>
|
|
|
<Tag color="geekblue">{item.detail.bug_category}</Tag>
|
|
|
</div>
|
|
|
<div className={styles.testBugItemTitleBlock}>
|
|
@@ -410,11 +422,12 @@ const Step2 = (props) => {
|
|
|
</div>
|
|
|
</div>
|
|
|
</Col>
|
|
|
- <Col span={12} className={styles.bugImgList}>
|
|
|
- <img src={require('../../assets/report1.jpeg')} alt='bug_img' />
|
|
|
- <img src={require('../../assets/report2.jpeg')} alt='bug_img' />
|
|
|
- <img src={require('../../assets/report3.jpeg')} alt='bug_img' />
|
|
|
- </Col>
|
|
|
+ {item.detail.img_url ?
|
|
|
+ <Col span={12} className={styles.bugImgList}>
|
|
|
+ {item.detail.img_url.split(',').map(img=>{
|
|
|
+ return <img src={img} alt='bug_img' key={img}/>
|
|
|
+ })}
|
|
|
+ </Col> : null}
|
|
|
</Row>
|
|
|
|
|
|
</div>
|