|
@@ -51,7 +51,7 @@ const Step2 = (props) => {
|
|
|
|
|
|
const {
|
|
|
dispatch, reportCommonInfo, osType,
|
|
|
- testCaseList, caseBugList, categories, pathInfo,
|
|
|
+ testCaseList, caseBugList, categories, pathInfo,commonId
|
|
|
} = props;
|
|
|
const [showTaskRecommendModal, setTaskRecommendModal] = useState(false);
|
|
|
const [showAddTestCaseModal, setAddTestCaseModal] = useState(false);
|
|
@@ -76,8 +76,8 @@ const Step2 = (props) => {
|
|
|
let formData = new FormData();
|
|
|
formData.append('name', res.name);
|
|
|
formData.append('report_id', reportCommonInfo.id);
|
|
|
- formData.append('worker_id', idInfo.userId);
|
|
|
- formData.append('case_take_id', idInfo.case_take_id);
|
|
|
+ formData.append('worker_id', commonId.userId);
|
|
|
+ formData.append('case_take_id', commonId.case_take_id);
|
|
|
formData.append('device_model', res.device_model);
|
|
|
formData.append('device_brand', res.device_brand);
|
|
|
formData.append('device_os', res.device_os);
|
|
@@ -146,9 +146,9 @@ const Step2 = (props) => {
|
|
|
formData.append('recurrent', res.recurrent);
|
|
|
formData.append('parent', null);
|
|
|
formData.append('useCase', currentTestCaseRef.current.id);
|
|
|
- formData.append('case_id', idInfo.caseId);
|
|
|
- formData.append('case_take_id', idInfo.case_take_id);
|
|
|
- formData.append('worker_id', idInfo.userId);
|
|
|
+ formData.append('case_id', commonId.caseId);
|
|
|
+ formData.append('case_take_id', commonId.case_take_id);
|
|
|
+ formData.append('worker_id', commonId.userId);
|
|
|
formData.append('page', `${res.page1}-${res.page2}-${res.page3}`);
|
|
|
if (fileList.length) {
|
|
|
let str = '';
|
|
@@ -202,21 +202,21 @@ const Step2 = (props) => {
|
|
|
dispatch({
|
|
|
type: 'editReport/getPathInfo',
|
|
|
payload: {
|
|
|
- case_take_id: idInfo.case_take_id,
|
|
|
+ case_take_id: commonId.case_take_id,
|
|
|
report_id: reportCommonInfo.id,
|
|
|
},
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'editReport/getBugRecommendPath',
|
|
|
payload: {
|
|
|
- case_take_id: idInfo.case_take_id,
|
|
|
+ case_take_id: commonId.case_take_id,
|
|
|
report_id: reportCommonInfo.id,
|
|
|
},
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'editReport/getBugRecommendList',
|
|
|
payload: {
|
|
|
- case_take_id: idInfo.case_take_id,
|
|
|
+ case_take_id: commonId.case_take_id,
|
|
|
report_id: reportCommonInfo.id,
|
|
|
},
|
|
|
});
|
|
@@ -269,13 +269,13 @@ const Step2 = (props) => {
|
|
|
};
|
|
|
|
|
|
useEffect(() => {
|
|
|
- //能到第二步,说明是有报告信息的
|
|
|
+ //能到第二步,说明是有报告信息的
|
|
|
//有报告,获取对应信息。没有就直接转去了第一步
|
|
|
dispatch({
|
|
|
type: 'editReport/getTestCaseList',
|
|
|
payload: { report_id: reportCommonInfo.id },
|
|
|
}).then((res) => {
|
|
|
- if (res && res.length) {
|
|
|
+ if (res && res.length && commonId) {
|
|
|
currentTestCaseRef.current = res[0];
|
|
|
dispatch({
|
|
|
type: 'editReport/getCaseBugList',
|
|
@@ -285,9 +285,9 @@ const Step2 = (props) => {
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'editReport/getCategories',
|
|
|
- payload: { examId: idInfo.examId },
|
|
|
+ payload: { examId: commonId.examId },
|
|
|
});
|
|
|
- }, [dispatch, reportCommonInfo,idInfo.userId,idInfo.examId,idInfo.case_take_id]);
|
|
|
+ }, [reportCommonInfo,commonId.userId,commonId.examId,commonId.case_take_id]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
let bugs = caseBugList.map(item => item.detail);
|