Ver código fonte

fix:第二次测试提出的问题

wjj 4 anos atrás
pai
commit
ea639e3c83

+ 25 - 25
src/components/GlobalHeader/RightContent.jsx

@@ -31,31 +31,31 @@ const GlobalHeaderRight = (props) => {
     className = `${styles.right}  ${styles.dark}`;
   }
 
-  useEffect(()=>{
-    let token = window.location.search.split('token=') && window.location.search.split('token=')[1];
-    dispatch({
-      type: 'editReport/getIdByToken',
-      payload: {
-        token
-      }
-    }).then(res=>{
-      //{result: "fail", cause: "身份验证失败,请重新点击按钮进入答题页面"}
-      if(res.result === 'success'){
-        let idInfo = {
-          roleId:res.roleId,
-          caseId:res.caseId,
-          examId:res.examId,
-          userId:res.userId,
-          case_take_id:res.caseId + '-' + res.examId,
-        }
-        setIdInfo(idInfo);
-      }else{
-        //错误处理
-        message.error(res.cause);
-        console.log(res)
-      }
-    })
-  },[])
+  // useEffect(()=>{
+  //   let token = window.location.search.split('token=') && window.location.search.split('token=')[1];
+  //   dispatch({
+  //     type: 'editReport/getIdByToken',
+  //     payload: {
+  //       token
+  //     }
+  //   }).then(res=>{
+  //     //{result: "fail", cause: "身份验证失败,请重新点击按钮进入答题页面"}
+  //     if(res.result === 'success'){
+  //       let idInfo = {
+  //         roleId:res.roleId,
+  //         caseId:res.caseId,
+  //         examId:res.examId,
+  //         userId:res.userId,
+  //         case_take_id:res.caseId + '-' + res.examId,
+  //       }
+  //       setIdInfo(idInfo);
+  //     }else{
+  //       //错误处理
+  //       message.error(res.cause);
+  //       console.log(res)
+  //     }
+  //   })
+  // },[])
 
 
   useEffect(() => {

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

@@ -130,7 +130,7 @@ const BugItemDetail = (props) => {
         <div className={`${styles.detailItem} ${styles.detailItemDesc}`}>
           <Tooltip title={detail.description}>
             <span className={styles.detailLabel}>Bug描述:</span>
-            {detail && detail.description+detail.description+detail.description}
+            {detail && detail.description}
           </Tooltip>
         </div>
         <div className={styles.detailItem}><span

+ 18 - 10
src/pages/edit/components/BugGuideTree/index.jsx

@@ -6,7 +6,7 @@ import { timeToString } from '../../utils';
 import {
   RollbackOutlined,
   DislikeOutlined,
-  LikeOutlined,
+  LikeOutlined, LeftOutlined, RightOutlined,
 } from '@ant-design/icons';
 import { recurrent, severity, bug_categories } from '../Step2/const';
 import * as echarts from 'echarts';
@@ -488,25 +488,33 @@ const BugGuideTree = (props) => {
                   <span className={styles.detailContent}>{currDetail.title}</span>
                 </Tooltip>
               </div>
-              <div className={styles.detailItem}><span
-                className={styles.detailLabel}>Bug 描述:</span>{currDetail.description}</div>
+              <div className={`${styles.detailItem} ${styles.detailItemDesc}`}>
+                <Tooltip title={currDetail.description}>
+                  <span className={styles.detailLabel}>Bug描述:</span>
+                  {currDetail && currDetail.description}
+                </Tooltip>
+              </div>
               <div className={styles.detailItem}><span
                 className={styles.detailLabel}>创建时间:</span>{timeToString(currDetail.create_time_millis)}</div>
               <div className={styles.detailItem}><span className={styles.detailLabel}>页面路径:</span>{currDetail.bug_page}
               </div>
               <div className={styles.detailItem}><span
-                className={styles.detailLabel}>漏洞分类:</span>{recurrent[currDetail.recurrent]}</div>
+                className={styles.detailLabel}>漏洞分类:</span>{currDetail.bug_category}</div>
               <div className={styles.detailItem}><span
                 className={styles.detailLabel}>严重等级:</span>{severity[currDetail.severity]}</div>
               <div className={styles.detailItem}><span
-                className={styles.detailLabel}>复现程度:</span>{currDetail.bug_category}</div>
+                className={styles.detailLabel}>复现程度:</span>{recurrent[currDetail.recurrent - 1]}</div>
               <div className={`${styles.detailItem} ${styles.detailItemOperator}`}><span
                 className={styles.detailLabel}>具体操作:</span>
-                <Image
-                  width={120}
-                  src={currDetail.img_url}
-                  className={styles.detailItemImg}
-                />
+                {
+                  currDetail && currDetail.img_url ?
+                        <Image
+                          width={120}
+                          src={currDetail.img_url}
+                          className={styles.detailItemImg}
+                        />
+                    : null
+                }
                 {operator !== 0 ?
                   <LikeOutlined className={`${styles.operatorIcon} ${operator===1 ? styles.operatorIconActive : ''}` }
                                 onClick={() => handleOperateIcon(1)} /> : null}

+ 8 - 1
src/pages/edit/components/BugGuideTree/index.less

@@ -17,7 +17,7 @@
     border-bottom: 1px solid #eee;
     font-size: 14px;
     .detailLabel {
-      width: 120px;
+      width: 100px;
       line-height: 30px;
       height: 30px;
       display: inline-block;
@@ -35,6 +35,13 @@
 
     }
   }
+  .detailItemDesc {
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 1; /* 这里是超出几行省略 */
+    overflow: hidden;
+  }
   .detailItemOperator {
     border: none;
     height: auto;

+ 17 - 11
src/pages/edit/components/Step2/index.jsx

@@ -512,17 +512,23 @@ const Step2 = (props) => {
                     <PlusOutlined className={styles.addIcon} />
                     缺陷
                   </Button>
-                  {
-                    collaborative_type === '0' ?
-                      <Button size="small"
-                              className={styles.recommendBtn}
-                              disabled={JSON.stringify(currentTestCaseRef.current) === '{}'}
-                              onClick={() => handleClickRecommendBtn()}>
-                        <ShareAltOutlined className={styles.addIcon}/>
-                        推荐
-                      </Button> : null
-                  }
-
+                  {/*{*/}
+                  {/*  collaborative_type === '0' ?*/}
+                  {/*    <Button size="small"*/}
+                  {/*            className={styles.recommendBtn}*/}
+                  {/*            disabled={JSON.stringify(currentTestCaseRef.current) === '{}'}*/}
+                  {/*            onClick={() => handleClickRecommendBtn()}>*/}
+                  {/*      <ShareAltOutlined className={styles.addIcon}/>*/}
+                  {/*      推荐*/}
+                  {/*    </Button> : null*/}
+                  {/*}*/}
+                  <Button size="small"
+                          className={styles.recommendBtn}
+                          disabled={JSON.stringify(currentTestCaseRef.current) === '{}'}
+                          onClick={() => handleClickRecommendBtn()}>
+                    <ShareAltOutlined className={styles.addIcon}/>
+                    推荐
+                  </Button>
                 </div>
 
               </div>

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

@@ -47,14 +47,14 @@ const Model = {
     recommendPath: [],
     bugRecommendList: [],
     commonId:{
-      // result:"success",
-      // roleId:1,
-      // caseId:"3714",
-      // examId:"3714",
-      // beginTime:"1621945823000",
-      // endTime:"1624291200000",
-      // userId:"99222",
-      // case_take_id:"3714-3714",
+      result:"success",
+      roleId:1,
+      caseId:"3714",
+      examId:"3714",
+      beginTime:"1621945823000",
+      endTime:"1624291200000",
+      userId:"99222",
+      case_take_id:"3714-3714",
     },
   },
   effects: {