|
@@ -1,5 +1,5 @@
|
|
|
import React, { useEffect, useRef, useState } from 'react';
|
|
|
-import { Form, Row, Col, Card, Modal, Input, Select, Upload, Button, message, Tag, Badge, Image } from 'antd';
|
|
|
+import { Form, Row, Col, Card, Modal, Input, Select, Upload, Button, message, Tag, Tooltip, Image } from 'antd';
|
|
|
import { connect } from 'umi';
|
|
|
import styles from './index.less';
|
|
|
import {
|
|
@@ -72,6 +72,10 @@ const Step2 = (props) => {
|
|
|
const [page3List, setPage3List] = useState([]);
|
|
|
const [bugList, setBugList] = useState([]);
|
|
|
|
|
|
+ const forkStatus = useRef(false);
|
|
|
+ const currForkId = useRef('');
|
|
|
+ const forkInput = useRef('');
|
|
|
+
|
|
|
const handleEditReportInfo = () => {
|
|
|
editReportForm.validateFields().then((res) => {
|
|
|
let formData = new FormData();
|
|
@@ -145,7 +149,7 @@ const Step2 = (props) => {
|
|
|
formData.append('bug_category', res.bug_category);
|
|
|
formData.append('severity', res.severity);
|
|
|
formData.append('recurrent', res.recurrent);
|
|
|
- formData.append('parent', null);
|
|
|
+ formData.append('parent', forkStatus.current?currForkId.current+'-2':null);
|
|
|
formData.append('useCase', currentTestCaseRef.current.id);
|
|
|
formData.append('case_id', commonId.caseId);
|
|
|
formData.append('case_take_id', commonId.case_take_id);
|
|
@@ -196,6 +200,7 @@ const Step2 = (props) => {
|
|
|
const handleClickAddBug = () => {
|
|
|
//current目前只在点击edit cease的时候会有用
|
|
|
addBugForm.resetFields();
|
|
|
+ forkInput.current.state.value = '';
|
|
|
setAddTestBugModal(true);
|
|
|
};
|
|
|
|
|
@@ -225,15 +230,26 @@ const Step2 = (props) => {
|
|
|
};
|
|
|
|
|
|
const handleSelectPage1 = (val) => {
|
|
|
- let item = categories.find(x => x.item === val);
|
|
|
- setPage2List(item.children);
|
|
|
+ if (val !== page1) {
|
|
|
+ addBugForm.setFieldsValue({page1:val,page2:'',page3:''})
|
|
|
+ let item = categories.find(x => x.item === val);
|
|
|
+ setPage2List(item.children);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const handleSelectPage2 = (val) => {
|
|
|
- let item = page2List.find(x => x.item === val);
|
|
|
- setPage3List(item.children);
|
|
|
+ if (val !== page2) {
|
|
|
+ addBugForm.setFieldsValue({page2:val,page3:''})
|
|
|
+ let item = page2List.find(x => x.item === val);
|
|
|
+ setPage3List(item.children);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
+ // const handlePage3Change = val => {
|
|
|
+ // // setPage3(val);
|
|
|
+ // };
|
|
|
+
|
|
|
+
|
|
|
const handlePreview = async file => {
|
|
|
if (!file.url && !file.preview) {
|
|
|
file.preview = await getBase64(file.originFileObj);
|
|
@@ -269,7 +285,9 @@ const Step2 = (props) => {
|
|
|
setBugList(newList);
|
|
|
};
|
|
|
|
|
|
- const searchBugToFork = value=>{
|
|
|
+ const searchBugToFork = value =>{
|
|
|
+ forkStatus.current = true;
|
|
|
+ currForkId.current = value;
|
|
|
dispatch({
|
|
|
type: 'editReport/getBugDetail',
|
|
|
payload: { id: value},
|
|
@@ -428,11 +446,13 @@ const Step2 = (props) => {
|
|
|
<Row gutter={10}>
|
|
|
<Col span={6}>
|
|
|
{<span
|
|
|
- className={styles.testCaseItemNo}>{`编号.${((item.id).substring((item.id.length) - 6)).toUpperCase()}`}</span>}
|
|
|
- </Col>
|
|
|
- <Col span={15}>
|
|
|
- <span>{item.name}</span>
|
|
|
+ className={`${styles.testCaseItemNo} ${styles.testCaseItemTitle}`}>{`编号.${((item.id).substring((item.id.length) - 6)).toUpperCase()}`}</span>}
|
|
|
</Col>
|
|
|
+ <Col span={15} className={styles.testCaseItemTitle}>
|
|
|
+ <Tooltip title={item.name}>
|
|
|
+ {item.name}
|
|
|
+ </Tooltip>
|
|
|
+ </Col>
|
|
|
<Col span={3}>
|
|
|
<EditOutlined className={styles.editTestBug}
|
|
|
onClick={() => handleEditTestCase(item)} />
|
|
@@ -475,8 +495,9 @@ const Step2 = (props) => {
|
|
|
<Col span={12}>
|
|
|
<div>
|
|
|
<div className={styles.testBugItemTitleBlock}>
|
|
|
- <span className={styles.testBugItemTitle}>标题:</span>
|
|
|
- <span className={styles.testBugItemTitleDetail}>{item.title}</span>
|
|
|
+ <Tooltip title={item.title}>
|
|
|
+ <span className={styles.testBugItemTitleDetail}>标题:{item.title}</span>
|
|
|
+ </Tooltip>
|
|
|
</div>
|
|
|
<div className={styles.testBugItemTitleBlock}>
|
|
|
<span className={styles.testBugItemTitle}>特征:</span>
|
|
@@ -493,8 +514,9 @@ const Step2 = (props) => {
|
|
|
{item.bug_page}
|
|
|
</div>
|
|
|
<div className={styles.testBugItemTitleBlock}>
|
|
|
- <span className={styles.testBugItemTitle}>描述:</span>
|
|
|
- {item.description}
|
|
|
+ <Tooltip title={item.description}>
|
|
|
+ <span className={styles.testBugItemDesc}>描述:{item.description}</span>
|
|
|
+ </Tooltip>
|
|
|
</div>
|
|
|
</div>
|
|
|
</Col>
|
|
@@ -609,6 +631,7 @@ const Step2 = (props) => {
|
|
|
onSearch={searchBugToFork}
|
|
|
className={styles.forkBtn}
|
|
|
key="search"
|
|
|
+ ref={forkInput}
|
|
|
/>
|
|
|
]}
|
|
|
footer={[
|
|
@@ -616,13 +639,14 @@ const Step2 = (props) => {
|
|
|
<Button key='cancel' htmlType="button" style={{ marginLeft: '10px' }}
|
|
|
onClick={() => {
|
|
|
setAddTestBugModal(false);
|
|
|
- }}>取消</Button>]}
|
|
|
+ forkInput.current.state.value = '';
|
|
|
+ }}>取消</Button>]}s
|
|
|
onCancel={() => {
|
|
|
setAddTestBugModal(false);
|
|
|
}}
|
|
|
className={styles.bugForm}
|
|
|
>
|
|
|
- <ExclamationCircleFilled className={styles.addModalInfo} />为了评分准确,请勿提交重复Bug
|
|
|
+ <ExclamationCircleFilled className={styles.addModalInfo} />为了评分准确,请勿提交重复缺陷Bug
|
|
|
<Form
|
|
|
form={addBugForm}
|
|
|
{...modalFormItemLayout}
|
|
@@ -630,7 +654,7 @@ const Step2 = (props) => {
|
|
|
className={styles.stepForm}
|
|
|
>
|
|
|
<Form.Item
|
|
|
- label="测试标题"
|
|
|
+ label="缺陷标题"
|
|
|
name="title"
|
|
|
rules={[
|
|
|
{
|
|
@@ -642,7 +666,7 @@ const Step2 = (props) => {
|
|
|
<Input.TextArea autoSize={{ minRows: 1, maxRows: 999 }} />
|
|
|
</Form.Item>
|
|
|
<Form.Item
|
|
|
- label="题目描述"
|
|
|
+ label="缺陷描述"
|
|
|
name="description"
|
|
|
rules={[
|
|
|
{
|
|
@@ -668,7 +692,7 @@ const Step2 = (props) => {
|
|
|
},
|
|
|
]}
|
|
|
>
|
|
|
- <Select onSelect={(val) => {
|
|
|
+ <Select value={addBugForm.getFieldValue('page1')} onSelect={(val) => {
|
|
|
handleSelectPage1(val);
|
|
|
}}>
|
|
|
{categories.map((item) => {
|
|
@@ -688,7 +712,7 @@ const Step2 = (props) => {
|
|
|
},
|
|
|
]}
|
|
|
>
|
|
|
- <Select
|
|
|
+ <Select value={addBugForm.getFieldValue('page2')}
|
|
|
disabled={!page2List.length&& !addBugForm.getFieldValue('page2')}
|
|
|
onSelect={(val) => {
|
|
|
handleSelectPage2(val);
|
|
@@ -709,7 +733,7 @@ const Step2 = (props) => {
|
|
|
},
|
|
|
]}
|
|
|
>
|
|
|
- <Select disabled={!page3List.length&& !addBugForm.getFieldValue('page3')}>
|
|
|
+ <Select value={addBugForm.getFieldValue('page3')} disabled={!page3List.length&& !addBugForm.getFieldValue('page3')}>
|
|
|
{page3List.map((item) => {
|
|
|
return <Select.Option value={item.item} key={item.item}>{item.item}</Select.Option>;
|
|
|
})}
|