|
@@ -164,20 +164,39 @@ const Step2 = (props) => {
|
|
|
formData.append('img_url', str);
|
|
|
}
|
|
|
//新建bug
|
|
|
+ //提交bug之前要做相似度判断,超过80%就不让提交了
|
|
|
dispatch({
|
|
|
- type: 'editReport/createCaseBug',
|
|
|
+ type: 'editReport/bugSimilarity',
|
|
|
payload: {
|
|
|
- formData,
|
|
|
- useCase: currentTestCaseRef.current.id,
|
|
|
+ case_take_id:commonId.case_take_id,
|
|
|
+ type:res.title,
|
|
|
+ content:res.description
|
|
|
},
|
|
|
- }).then(res => {
|
|
|
- addBugForm.resetFields();
|
|
|
- setPage2List([]);
|
|
|
- setPage3List([]);
|
|
|
- setFileList([]);
|
|
|
- forkStatus.current=false;
|
|
|
- setAddTestBugModal(false);
|
|
|
- });
|
|
|
+ }).then(res=>{
|
|
|
+ if(res){
|
|
|
+ const { scores } = res;
|
|
|
+ const s = scores.some(item=>item>=80);
|
|
|
+ if(!s){
|
|
|
+ dispatch({
|
|
|
+ type: 'editReport/createCaseBug',
|
|
|
+ payload: {
|
|
|
+ formData,
|
|
|
+ useCase: currentTestCaseRef.current.id,
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ addBugForm.resetFields();
|
|
|
+ setPage2List([]);
|
|
|
+ setPage3List([]);
|
|
|
+ setFileList([]);
|
|
|
+ forkStatus.current=false;
|
|
|
+ setAddTestBugModal(false);
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ message.error('当前缺陷与已有缺陷相似度超过80%,请修改标题和内容后重试');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -550,7 +569,6 @@ const Step2 = (props) => {
|
|
|
|
|
|
{item.imgArr.map(img => {
|
|
|
return <Image src={img} key={img} />;})}
|
|
|
- {item.originArr.length}{item.right}
|
|
|
{item.right < item.originArr.length ? <RightOutlined onClick={() => {
|
|
|
handleChangeImgToRight(item);
|
|
|
}} /> : <div className={styles.switchImgBtn}></div>}
|