|
@@ -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 ,Badge} 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 {
|
|
@@ -38,30 +38,39 @@ const Step2 = (props) => {
|
|
const [reportForm] = Form.useForm();
|
|
const [reportForm] = Form.useForm();
|
|
const [addCaseForm] = Form.useForm();
|
|
const [addCaseForm] = Form.useForm();
|
|
const [addBugForm] = Form.useForm();
|
|
const [addBugForm] = Form.useForm();
|
|
|
|
+ const [editReportForm] = Form.useForm();
|
|
|
|
|
|
const {
|
|
const {
|
|
- data, dispatch, reportCommonInfo,
|
|
|
|
|
|
+ dispatch, reportCommonInfo, osType,
|
|
testCaseList, caseBugList, categories, pathInfo,
|
|
testCaseList, caseBugList, categories, pathInfo,
|
|
} = props;
|
|
} = props;
|
|
|
|
|
|
const [showTaskRecommendModal, setTaskRecommendModal] = useState(false);
|
|
const [showTaskRecommendModal, setTaskRecommendModal] = useState(false);
|
|
const [showAddTestCaseModal, setAddTestCaseModal] = useState(false);
|
|
const [showAddTestCaseModal, setAddTestCaseModal] = useState(false);
|
|
const [showAddBugModal, setAddTestBugModal] = useState(false);
|
|
const [showAddBugModal, setAddTestBugModal] = useState(false);
|
|
|
|
+ const [showEditReportModal, setEditReportModal] = useState(false);
|
|
const currentTestCaseRef = useRef({});
|
|
const currentTestCaseRef = useRef({});
|
|
const [isAddCaseStatus, setIsAddCaseStatus] = useState(true);
|
|
const [isAddCaseStatus, setIsAddCaseStatus] = useState(true);
|
|
// const [currActiveTestCase, setCurrActiveTestCase] = useState({});
|
|
// const [currActiveTestCase, setCurrActiveTestCase] = useState({});
|
|
const [page2List, setPage2List] = useState([]);
|
|
const [page2List, setPage2List] = useState([]);
|
|
const [page3List, setPage3List] = useState([]);
|
|
const [page3List, setPage3List] = useState([]);
|
|
|
|
|
|
- const chartRef = useRef();
|
|
|
|
-
|
|
|
|
- if (!data) {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
const handleEditReportInfo = () => {
|
|
const handleEditReportInfo = () => {
|
|
- console.log('sss');
|
|
|
|
-
|
|
|
|
|
|
+ editReportForm.validateFields().then((res)=> {
|
|
|
|
+ let formData = new FormData();
|
|
|
|
+ formData.append('name', res.name);
|
|
|
|
+ formData.append('report_id', reportCommonInfo.id);
|
|
|
|
+ formData.append('worker_id', '2');
|
|
|
|
+ formData.append('case_take_id', '1718-1718');
|
|
|
|
+ formData.append('device_model', res.device_model);
|
|
|
|
+ formData.append('device_brand', res.device_brand);
|
|
|
|
+ formData.append('device_os', res.device_os);
|
|
|
|
+ dispatch({
|
|
|
|
+ type: 'editReport/updateReportCommonDetail',
|
|
|
|
+ payload: { formData }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ setEditReportModal(false)
|
|
};
|
|
};
|
|
|
|
|
|
const handleAddOrEditTestCase = () => {
|
|
const handleAddOrEditTestCase = () => {
|
|
@@ -72,7 +81,7 @@ const Step2 = (props) => {
|
|
formData.append('name', res.name);
|
|
formData.append('name', res.name);
|
|
formData.append('front', res.front);
|
|
formData.append('front', res.front);
|
|
formData.append('behind', res.behind);
|
|
formData.append('behind', res.behind);
|
|
- formData.append('description', res.result);
|
|
|
|
|
|
+ formData.append('description', res.description);
|
|
if (!isAddCaseStatus) {
|
|
if (!isAddCaseStatus) {
|
|
//处理编辑用例
|
|
//处理编辑用例
|
|
formData.append('id', currentTestCaseRef.current.id);
|
|
formData.append('id', currentTestCaseRef.current.id);
|
|
@@ -118,7 +127,7 @@ const Step2 = (props) => {
|
|
formData.append('useCase', currentTestCaseRef.current.id);
|
|
formData.append('useCase', currentTestCaseRef.current.id);
|
|
formData.append('case_id', '1718');
|
|
formData.append('case_id', '1718');
|
|
formData.append('case_take_id', '1718-1718');
|
|
formData.append('case_take_id', '1718-1718');
|
|
- formData.append('worker_id', '1');
|
|
|
|
|
|
+ formData.append('worker_id', '2');
|
|
formData.append('page', `${res.page1}-${res.page2}-${res.page3}`);
|
|
formData.append('page', `${res.page1}-${res.page2}-${res.page3}`);
|
|
//新建bug
|
|
//新建bug
|
|
dispatch({
|
|
dispatch({
|
|
@@ -186,12 +195,6 @@ const Step2 = (props) => {
|
|
setTaskRecommendModal(true);
|
|
setTaskRecommendModal(true);
|
|
};
|
|
};
|
|
|
|
|
|
- // 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);
|
|
@@ -208,7 +211,7 @@ const Step2 = (props) => {
|
|
type: 'editReport/getReportInfo',
|
|
type: 'editReport/getReportInfo',
|
|
payload: {
|
|
payload: {
|
|
case_take_id: '1718-1718',
|
|
case_take_id: '1718-1718',
|
|
- worker_id: 1,
|
|
|
|
|
|
+ worker_id: '2',
|
|
},
|
|
},
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
// console.log(res)
|
|
// console.log(res)
|
|
@@ -218,7 +221,7 @@ const Step2 = (props) => {
|
|
type: 'editReport/getTestCaseList',
|
|
type: 'editReport/getTestCaseList',
|
|
payload: { report_id: reportCommonInfo.id },
|
|
payload: { report_id: reportCommonInfo.id },
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
- if(res&&res.length){
|
|
|
|
|
|
+ if (res && res.length) {
|
|
currentTestCaseRef.current = res[0];
|
|
currentTestCaseRef.current = res[0];
|
|
dispatch({
|
|
dispatch({
|
|
type: 'editReport/getCaseBugList',
|
|
type: 'editReport/getCaseBugList',
|
|
@@ -242,7 +245,6 @@ const Step2 = (props) => {
|
|
form={reportForm}
|
|
form={reportForm}
|
|
className={styles.stepForm}
|
|
className={styles.stepForm}
|
|
hideRequiredMark
|
|
hideRequiredMark
|
|
- initialValues={data}
|
|
|
|
>
|
|
>
|
|
<Row gutter={10}>
|
|
<Row gutter={10}>
|
|
<Col span={5}>
|
|
<Col span={5}>
|
|
@@ -275,7 +277,7 @@ const Step2 = (props) => {
|
|
</Col>
|
|
</Col>
|
|
<Col span={1}>
|
|
<Col span={1}>
|
|
<EditOutlined className={styles.editReportInfoIcon}
|
|
<EditOutlined className={styles.editReportInfoIcon}
|
|
- onClick={() => handleEditReportInfo()}
|
|
|
|
|
|
+ onClick={() => setEditReportModal(true)}
|
|
/>
|
|
/>
|
|
</Col>
|
|
</Col>
|
|
</Row>
|
|
</Row>
|
|
@@ -299,7 +301,7 @@ const Step2 = (props) => {
|
|
|
|
|
|
|
|
|
|
<div className={styles.testCaseList}>
|
|
<div className={styles.testCaseList}>
|
|
- { testCaseList&&testCaseList.length ? 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 : ''}`}
|
|
@@ -309,12 +311,13 @@ const Step2 = (props) => {
|
|
}}>
|
|
}}>
|
|
<Row gutter={10}>
|
|
<Row gutter={10}>
|
|
<Col span={6}>
|
|
<Col span={6}>
|
|
- {<span className={styles.testCaseItemNo}>{`NO.${((item.id).substring((item.id.length) - 6)).toUpperCase()}`}</span>}
|
|
|
|
|
|
+ {<span
|
|
|
|
+ className={styles.testCaseItemNo}>{`NO.${((item.id).substring((item.id.length) - 6)).toUpperCase()}`}</span>}
|
|
{/*<Badge color="#2db7f5"*/}
|
|
{/*<Badge color="#2db7f5"*/}
|
|
{/* text={} />*/}
|
|
{/* text={} />*/}
|
|
</Col>
|
|
</Col>
|
|
<Col span={15}>
|
|
<Col span={15}>
|
|
- <span >{item.name}</span>
|
|
|
|
|
|
+ <span>{item.name}</span>
|
|
</Col>
|
|
</Col>
|
|
<Col span={3}>
|
|
<Col span={3}>
|
|
<EditOutlined className={styles.editTestBug}
|
|
<EditOutlined className={styles.editTestBug}
|
|
@@ -326,12 +329,12 @@ const Step2 = (props) => {
|
|
</div>
|
|
</div>
|
|
</Col>
|
|
</Col>
|
|
|
|
|
|
- <Col span={16} >
|
|
|
|
|
|
+ <Col span={16}>
|
|
<div gutter={10} className={styles.testBugTitle}>
|
|
<div gutter={10} className={styles.testBugTitle}>
|
|
<h3>缺陷列表</h3>
|
|
<h3>缺陷列表</h3>
|
|
<div>
|
|
<div>
|
|
<Button size="small" type="primary"
|
|
<Button size="small" type="primary"
|
|
- disabled={JSON.stringify(currentTestCaseRef.current) === "{}"}
|
|
|
|
|
|
+ disabled={JSON.stringify(currentTestCaseRef.current) === '{}'}
|
|
onClick={() => handleClickAddBug()}>
|
|
onClick={() => handleClickAddBug()}>
|
|
<PlusOutlined className={styles.addIcon} />
|
|
<PlusOutlined className={styles.addIcon} />
|
|
缺陷
|
|
缺陷
|
|
@@ -339,7 +342,7 @@ const Step2 = (props) => {
|
|
|
|
|
|
<Button size="small"
|
|
<Button size="small"
|
|
className={styles.recommendBtn}
|
|
className={styles.recommendBtn}
|
|
- disabled={JSON.stringify(currentTestCaseRef.current) === "{}"}
|
|
|
|
|
|
+ disabled={JSON.stringify(currentTestCaseRef.current) === '{}'}
|
|
onClick={() => handleClickRecommendBtn()}>
|
|
onClick={() => handleClickRecommendBtn()}>
|
|
<ForkOutlined className={styles.addIcon} />
|
|
<ForkOutlined className={styles.addIcon} />
|
|
推荐
|
|
推荐
|
|
@@ -348,7 +351,7 @@ const Step2 = (props) => {
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div className={styles.testBugList}>
|
|
<div className={styles.testBugList}>
|
|
- {caseBugList&&caseBugList.length ? caseBugList.map((item) => {
|
|
|
|
|
|
+ {caseBugList && caseBugList.length ? caseBugList.map((item) => {
|
|
return (
|
|
return (
|
|
<div className={styles.testBugItem} key={item.detail.id}>
|
|
<div className={styles.testBugItem} key={item.detail.id}>
|
|
<Row gutter={10}>
|
|
<Row gutter={10}>
|
|
@@ -372,9 +375,9 @@ const Step2 = (props) => {
|
|
</div>
|
|
</div>
|
|
</Col>
|
|
</Col>
|
|
<Col span={12} className={styles.bugImgList}>
|
|
<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'/>
|
|
|
|
|
|
+ <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>
|
|
</Col>
|
|
</Row>
|
|
</Row>
|
|
|
|
|
|
@@ -627,16 +630,49 @@ const Step2 = (props) => {
|
|
{/*</Form.Item>*/}
|
|
{/*</Form.Item>*/}
|
|
</Form>
|
|
</Form>
|
|
</Modal>
|
|
</Modal>
|
|
- {/*<Modal title="修改报告信息" visible={showTaskRecommendModal} onOk={() => setTaskRecommendModal(false)}*/}
|
|
|
|
- {/* onCancel={() => setTaskRecommendModal(false)} className="addModal">*/}
|
|
|
|
- {/* <div>*/}
|
|
|
|
- {/* <div id="forceChart"></div>*/}
|
|
|
|
- {/* </div>*/}
|
|
|
|
- {/*</Modal>*/}
|
|
|
|
|
|
+ <Modal title="修改报告基础信息" visible={showEditReportModal}
|
|
|
|
+ footer={[
|
|
|
|
+ <Button key='submit' type="primary" htmlType="submit"
|
|
|
|
+ onClick={handleEditReportInfo}>确定</Button>,
|
|
|
|
+ <Button key='cancel' htmlType="button" style={{ marginLeft: '10px' }}
|
|
|
|
+ onClick={() => {
|
|
|
|
+ setEditReportModal(false);
|
|
|
|
+ }}>取消</Button>]}
|
|
|
|
+ onCancel={() => {
|
|
|
|
+ setEditReportModal(false);
|
|
|
|
+ }}>
|
|
|
|
+ <div>
|
|
|
|
+ <Form
|
|
|
|
+ {...modalFormItemLayout}
|
|
|
|
+ form={editReportForm}
|
|
|
|
+ layout="horizontal"
|
|
|
|
+ initialValues={reportCommonInfo}
|
|
|
|
+ >
|
|
|
|
+ <Form.Item label="报告名称" name="name" rules={[{ required: true, message: '请输入报告名称' }]}>
|
|
|
|
+ <Input placeholder="请输入报告名称" />
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <Form.Item label="设备名称" name="device_model" rules={[{ required: true, message: '请输入设备品牌' }]}>
|
|
|
|
+ <Input placeholder="请输入设备名称" />
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <Form.Item label="设备品牌" name="device_brand" rules={[{ required: true, message: '请输入设备品牌' }]}>
|
|
|
|
+ <Input placeholder="请输入设备品牌" />
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <Form.Item label="操作系统" name="device_os" rules={[{ required: true, message: '请输入操作系统' }]}>
|
|
|
|
+ <Select placeholder="请选择操作系统">
|
|
|
|
+ {osType.map((option) => {
|
|
|
|
+ return <Select.Option value={option} key={option}>{option}</Select.Option>;
|
|
|
|
+ })}
|
|
|
|
+ </Select>
|
|
|
|
+ </Form.Item>
|
|
|
|
+ </Form>
|
|
|
|
+ </div>
|
|
|
|
+ </Modal>
|
|
<Modal title="任务推荐" visible={showTaskRecommendModal}
|
|
<Modal title="任务推荐" visible={showTaskRecommendModal}
|
|
destroyOnClose width={1000}
|
|
destroyOnClose width={1000}
|
|
onOk={() => setTaskRecommendModal(false)}
|
|
onOk={() => setTaskRecommendModal(false)}
|
|
- onCancel={() => {setTaskRecommendModal(false);}
|
|
|
|
|
|
+ onCancel={() => {
|
|
|
|
+ setTaskRecommendModal(false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
className="addModal">
|
|
className="addModal">
|
|
<div>
|
|
<div>
|
|
@@ -649,10 +685,10 @@ const Step2 = (props) => {
|
|
|
|
|
|
export default connect(({ editReport, loading }) => ({
|
|
export default connect(({ editReport, loading }) => ({
|
|
submitting: loading.effects['editReport/submitStepForm'],
|
|
submitting: loading.effects['editReport/submitStepForm'],
|
|
- data: editReport.step,
|
|
|
|
reportCommonInfo: editReport.reportCommonInfo,
|
|
reportCommonInfo: editReport.reportCommonInfo,
|
|
testCaseList: editReport.testCaseList,
|
|
testCaseList: editReport.testCaseList,
|
|
caseBugList: editReport.caseBugList,
|
|
caseBugList: editReport.caseBugList,
|
|
categories: editReport.categories,
|
|
categories: editReport.categories,
|
|
pathInfo: editReport.pathInfo,
|
|
pathInfo: editReport.pathInfo,
|
|
|
|
+ osType: editReport.osType,
|
|
}))(Step2);
|
|
}))(Step2);
|