Browse Source

ADD:初始时没有报告显示暂无记录

wjj 4 years ago
parent
commit
3d8016ab72

+ 8 - 3
src/pages/bugs/components/BugDetailModal/index.jsx

@@ -12,7 +12,7 @@ import { recurrent, severity, bug_categories } from '@/pages/edit/components/Ste
 const BugItemDetail = (props) => {
   const {
     bugItemDetail, dispatch, reportCommonInfo, commonId,
-    getReportReview,
+    getReportReview,status,bugSingleList,bugTreeList
   } = props;
   const [detail, setDetail] = useState({});
   const [operator, setOperator] = useState(-1);
@@ -110,7 +110,10 @@ const BugItemDetail = (props) => {
   }, [bugItemDetail]);
 
   return (
-    detail && detail.id ?
+    ((status === 'tree' && bugTreeList?.TreeRoot?.length === 0) ||
+      (status === 'single' && bugSingleList?.TreeRoot?.length === 0)) ?
+      <div>暂无缺陷提交记录</div> :
+      ( detail && detail.id ?
       <div className={styles.bugItemDetail}>
         <div className={styles.detailItem}>
           <Tooltip title={detail.id}>
@@ -170,12 +173,14 @@ const BugItemDetail = (props) => {
             <DislikeOutlined className={`${styles.operatorIcon} ${operator === 0 ? styles.operatorIconActive : ''}`}
                              onClick={() => handleOperateIcon(0)} /> : null}
         </div>
-      </div> : <Spin />
+      </div> : <Spin />)
   );
 };
 
 export default connect(({ allBugs, editReport }) => ({
   bugItemDetail: allBugs.bugItemDetail,
+  bugTreeList: allBugs.bugTreeList,
+  bugSingleList: allBugs.bugSingleList,
   reportCommonInfo: editReport.reportCommonInfo,
   commonId: editReport.commonId,
 }))(BugItemDetail);

+ 2 - 1
src/pages/bugs/components/BugSingleList/index.jsx

@@ -23,7 +23,8 @@ const BugSingleList = (props) => {
   }, [bugSingleList]);
 
   useEffect(() => {
-    if (JSON.stringify(currentItem) !== '[]') {
+    // console.log(JSON.stringify(currentItem));
+    if (currentItem && JSON.stringify(currentItem) !== '[]') {
       //获取bug详情信息用于展示
       dispatch({
         type: 'editReport/getBugDetail',

+ 0 - 2
src/pages/bugs/components/BugTreeList/index.jsx

@@ -24,7 +24,6 @@ const BugTreeList = (props) => {
 
   useEffect(() => {
     if (currentTreeItem&&JSON.stringify(currentTreeItem) !== '[]') {
-      console.log(currentTreeItem)
       //获取bug详情信息用于展示
       dispatch({
         type: 'editReport/getBugDetail',
@@ -32,7 +31,6 @@ const BugTreeList = (props) => {
           id: currentTreeItem[0],
         },
       }).then(res => {
-        console.log(res)
         //这里是根据list 的 item获取的,需要刷新bug tree,还需要更新detail modal
         dispatch({
           type: 'allBugs/saveBugTreeNode',

+ 1 - 1
src/pages/bugs/index.jsx

@@ -173,7 +173,7 @@ const AllBugs = (props) => {
           </Col>
           <Col span={status === 'tree' ? 8 : 11}>
             <div className={styles.bugDetail}>
-              <BugDetailModal getReportReview={getReportReview}/>
+              <BugDetailModal getReportReview={getReportReview} status={status}/>
             </div>
           </Col>
         </Row>

+ 3 - 3
src/pages/edit/model.js

@@ -48,12 +48,12 @@ const Model = {
     commonId:{
       result:"success",
       roleId:1,
-      caseId:"1718",
-      examId:"1718",
+      caseId:"3702",
+      examId:"3702",
       beginTime:"1621945823000",
       endTime:"1624291200000",
       userId:"99222",
-      case_take_id:"1718_1718",
+      case_take_id:"3702_3702",
     },
   },
   effects: {