|
@@ -1,5 +1,5 @@
|
|
import React, { useEffect, useRef, useState } from 'react';
|
|
import React, { useEffect, useRef, useState } from 'react';
|
|
-import { Form, Row, Col, Card, Modal, Input, Select, Upload, Button, message, Tag } from 'antd';
|
|
|
|
|
|
+import { Form, Row, Col, Card, Modal, Input, Select, Upload, Button, message, Tag ,Badge} from 'antd';
|
|
import { connect } from 'umi';
|
|
import { connect } from 'umi';
|
|
import styles from './index.less';
|
|
import styles from './index.less';
|
|
import {
|
|
import {
|
|
@@ -14,6 +14,8 @@ import * as echarts from 'echarts';
|
|
import { recurrent, severity, bug_categories } from './const';
|
|
import { recurrent, severity, bug_categories } from './const';
|
|
import { timeToString } from '../../utils';
|
|
import { timeToString } from '../../utils';
|
|
|
|
|
|
|
|
+import BugGuideTree from '../BugGuideTree';
|
|
|
|
+
|
|
const formItemLayout = {
|
|
const formItemLayout = {
|
|
labelCol: {
|
|
labelCol: {
|
|
span: 8,
|
|
span: 8,
|
|
@@ -361,9 +363,14 @@ const Step2 = (props) => {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
setTaskRecommendModal(true);
|
|
setTaskRecommendModal(true);
|
|
- initEcharts();
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ // useEffect(() => {
|
|
|
|
+ // if(showTaskRecommendModal){
|
|
|
|
+ // // initEcharts();
|
|
|
|
+ // }
|
|
|
|
+ // }, [showTaskRecommendModal])
|
|
|
|
+
|
|
const handleSelectPage1 = (val) => {
|
|
const handleSelectPage1 = (val) => {
|
|
let item = categories.find(x => x.item === val);
|
|
let item = categories.find(x => x.item === val);
|
|
setPage2List(item.children);
|
|
setPage2List(item.children);
|
|
@@ -390,18 +397,23 @@ const Step2 = (props) => {
|
|
type: 'editReport/getTestCaseList',
|
|
type: 'editReport/getTestCaseList',
|
|
payload: { report_id: reportCommonInfo.id },
|
|
payload: { report_id: reportCommonInfo.id },
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
- currentTestCaseRef.current = res;
|
|
|
|
- // setCurrActiveTestCase(res);
|
|
|
|
|
|
+ if(res&&res.length){
|
|
|
|
+ currentTestCaseRef.current = res[0];
|
|
|
|
+ dispatch({
|
|
|
|
+ type: 'editReport/getCaseBugList',
|
|
|
|
+ payload: currentTestCaseRef.current.id,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
});
|
|
});
|
|
dispatch({
|
|
dispatch({
|
|
type: 'editReport/getCategories',
|
|
type: 'editReport/getCategories',
|
|
- payload: { examId: 1945 },
|
|
|
|
|
|
+ payload: { examId: 1718 },
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}, [dispatch, reportCommonInfo.id]);
|
|
}, [dispatch, reportCommonInfo.id]);
|
|
|
|
|
|
return (
|
|
return (
|
|
- <div>
|
|
|
|
|
|
+ <div id="main">
|
|
<Row gutter={10}>
|
|
<Row gutter={10}>
|
|
<Col span={23}>
|
|
<Col span={23}>
|
|
<Form
|
|
<Form
|
|
@@ -466,7 +478,7 @@ const Step2 = (props) => {
|
|
|
|
|
|
|
|
|
|
<div className={styles.testCaseList}>
|
|
<div className={styles.testCaseList}>
|
|
- {testCaseList && testCaseList.map((item) => {
|
|
|
|
|
|
+ { testCaseList&&testCaseList.length ? testCaseList.map((item) => {
|
|
return (
|
|
return (
|
|
<div
|
|
<div
|
|
className={`${styles.testCaseItem} ${currentTestCaseRef.current.id === item.id ? styles.activeCase : ''}`}
|
|
className={`${styles.testCaseItem} ${currentTestCaseRef.current.id === item.id ? styles.activeCase : ''}`}
|
|
@@ -475,34 +487,43 @@ const Step2 = (props) => {
|
|
handleClickTestCase(item);
|
|
handleClickTestCase(item);
|
|
}}>
|
|
}}>
|
|
<Row gutter={10}>
|
|
<Row gutter={10}>
|
|
- <Col span={21}><p>{item.name}</p></Col>
|
|
|
|
|
|
+ <Col span={6}>
|
|
|
|
+ <Badge color="#2db7f5" text={(item.id).substring((item.id.length) - 6)} />
|
|
|
|
+ </Col>
|
|
|
|
+ <Col span={15}>
|
|
|
|
+ <span >{item.name}</span>
|
|
|
|
+ </Col>
|
|
<Col span={3}>
|
|
<Col span={3}>
|
|
<EditOutlined className={styles.editTestBug}
|
|
<EditOutlined className={styles.editTestBug}
|
|
onClick={() => handleEditTestCase(item)} />
|
|
onClick={() => handleEditTestCase(item)} />
|
|
</Col>
|
|
</Col>
|
|
</Row>
|
|
</Row>
|
|
</div>);
|
|
</div>);
|
|
- })}
|
|
|
|
|
|
+ }) : <div>快来创建你的第一个测试用例吧~</div>}
|
|
</div>
|
|
</div>
|
|
</Col>
|
|
</Col>
|
|
|
|
|
|
- <Col span={16} style={{ paddingLeft: 20 }}>
|
|
|
|
- <Row gutter={10} style={{ marginBottom: 10 }}>
|
|
|
|
- <Col span={20}><h3>缺陷列表</h3></Col>
|
|
|
|
- <Col span={2}>
|
|
|
|
- <Button size="small" type="primary" onClick={() => handleClickAddBug()}>
|
|
|
|
|
|
+ <Col span={16} >
|
|
|
|
+ <div gutter={10} className={styles.testBugTitle}>
|
|
|
|
+ <h3>缺陷列表</h3>
|
|
|
|
+ <div>
|
|
|
|
+ <Button size="small" type="primary"
|
|
|
|
+ disabled={JSON.stringify(currentTestCaseRef.current) === "{}"}
|
|
|
|
+ onClick={() => handleClickAddBug()}>
|
|
<PlusOutlined className={styles.addIcon} />
|
|
<PlusOutlined className={styles.addIcon} />
|
|
缺陷
|
|
缺陷
|
|
</Button>
|
|
</Button>
|
|
- </Col>
|
|
|
|
- <Col span={2}>
|
|
|
|
- <Button size="small" className={styles.recommendBtn}
|
|
|
|
|
|
+
|
|
|
|
+ <Button size="small" type="primary"
|
|
|
|
+ className={styles.recommendBtn}
|
|
|
|
+ disabled={JSON.stringify(currentTestCaseRef.current) === "{}"}
|
|
onClick={() => handleClickRecommendBtn()}>
|
|
onClick={() => handleClickRecommendBtn()}>
|
|
<ForkOutlined className={styles.addIcon} />
|
|
<ForkOutlined className={styles.addIcon} />
|
|
推荐
|
|
推荐
|
|
</Button>
|
|
</Button>
|
|
- </Col>
|
|
|
|
- </Row>
|
|
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
<div className={styles.testBugList}>
|
|
<div className={styles.testBugList}>
|
|
{caseBugList&&caseBugList.length ? caseBugList.map((item) => {
|
|
{caseBugList&&caseBugList.length ? caseBugList.map((item) => {
|
|
return (
|
|
return (
|
|
@@ -539,7 +560,6 @@ const Step2 = (props) => {
|
|
}) : <div>当前用例暂无提交记录,快去创建第一个BUG吧~</div>}
|
|
}) : <div>当前用例暂无提交记录,快去创建第一个BUG吧~</div>}
|
|
</div>
|
|
</div>
|
|
</Col>
|
|
</Col>
|
|
-
|
|
|
|
</Row>
|
|
</Row>
|
|
</div>
|
|
</div>
|
|
</Card>
|
|
</Card>
|
|
@@ -790,10 +810,13 @@ const Step2 = (props) => {
|
|
{/* <div id="forceChart"></div>*/}
|
|
{/* <div id="forceChart"></div>*/}
|
|
{/* </div>*/}
|
|
{/* </div>*/}
|
|
{/*</Modal>*/}
|
|
{/*</Modal>*/}
|
|
- <Modal title="任务推荐" visible={showTaskRecommendModal} onOk={() => setTaskRecommendModal(false)}
|
|
|
|
- onCancel={() => setTaskRecommendModal(false)} className="addModal">
|
|
|
|
|
|
+ <Modal title="任务推荐" visible={showTaskRecommendModal} width={1000}
|
|
|
|
+ onOk={() => setTaskRecommendModal(false)}
|
|
|
|
+ onCancel={() => setTaskRecommendModal(false)}
|
|
|
|
+ className="addModal">
|
|
<div>
|
|
<div>
|
|
- <div id="myChart" ref={chartRef}></div>
|
|
|
|
|
|
+ <BugGuideTree />
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</Modal>
|
|
</Modal>
|
|
</div>
|
|
</div>
|