wjj 4 éve
szülő
commit
a3dff6cedb

+ 13 - 7
src/pages/bugs/components/BugDetailModal/index.jsx

@@ -114,16 +114,22 @@ const BugItemDetail = (props) => {
       <div className={styles.bugItemDetail}>
         <div className={styles.detailItem}>
           <Tooltip title={detail.id}>
-            <span className={styles.testBugItemTitleDetail}>
-              <span className={styles.detailLabel}>Bug标识:</span>{detail && detail.id || ''}</span>
+            <span className={styles.detailLabel}>Bug标识:</span>
+            {detail && detail.id || ''}
           </Tooltip>
-          {/*<span className={styles.detailLabel}>Bug标识:</span>{detail && detail.id || ''}*/}
         </div>
-        <div className={styles.detailItem}><span
-          className={styles.detailLabel}>Bug题目:</span>{detail && detail.title || ''}
+        <div className={styles.detailItem}>
+          <Tooltip title={detail.title}>
+            <span className={styles.detailLabel}>Bug题目:</span>
+            {detail && detail.title || ''}
+          </Tooltip>
+        </div>
+        <div className={`${styles.detailItem} ${styles.detailItemDesc}`}>
+          <Tooltip title={detail.description}>
+            <span className={styles.detailLabel}>Bug描述:</span>
+            {detail && detail.description+detail.description+detail.description}
+          </Tooltip>
         </div>
-        <div className={styles.detailItem}><span
-          className={styles.detailLabel}>Bug描述:</span>{detail && detail.description}</div>
         <div className={styles.detailItem}><span
           className={styles.detailLabel}>创建时间:</span>{timeToString(detail.create_time_millis)}</div>
         <div className={styles.detailItem}><span className={styles.detailLabel}>页面路径:</span>{detail.bug_page}

+ 12 - 8
src/pages/bugs/components/BugDetailModal/index.less

@@ -8,6 +8,9 @@
     padding: 0 20px;
     border-bottom: 1px solid #eee;
     font-size: 14px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
     .detailLabel {
       width: 80px;
       line-height: 30px;
@@ -17,14 +20,14 @@
     .backIcon {
       float: right;
     }
-    .testBugItemTitleDetail {
-      //display: inline-block;
-      line-height: 22px;
-      margin-right: 30px;
-      overflow: hidden;
-      text-overflow: ellipsis;
-      white-space: nowrap;
-    }
+  }
+
+  .detailItemDesc {
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 2; /* 这里是超出几行省略 */
+    overflow: hidden;
   }
   .detailItemOperator {
     height: auto;
@@ -35,6 +38,7 @@
       height: 80px;
       display: table-cell;
       vertical-align: center;
+      white-space: nowrap;
     }
     .detailItemImg {
       display: inline-block;

+ 47 - 45
src/pages/bugs/components/BugSingleList/index.jsx

@@ -1,83 +1,85 @@
-import { Pagination } from 'antd';
+import { Pagination, Tooltip } from 'antd';
 import React, { useEffect, useState } from 'react';
 import { connect } from 'umi';
 import styles from './index.less';
 import { treeFilter } from 'enzyme/src/RSTTraversal';
 
 const BugSingleList = (props) => {
-  const {dispatch,commonId,bugTreeList,bugSingleList,page} = props;
-  const [currPage,setCurrPage] = useState(1);
-  const [currentItem,setCurrentItem] = useState([]);
+  const { dispatch, commonId, bugTreeList, bugSingleList, page } = props;
+  const [currPage, setCurrPage] = useState(1);
+  const [currentItem, setCurrentItem] = useState([]);
 
-  const onPageChange = (num)=>{
+  const onPageChange = (num) => {
     setCurrPage(num);
-  }
+  };
 
-  const handleSingleItemClick = (item)=>{
-    const currItem = bugSingleList.TreeRoot.filter(i=>i[0]===item[0]);
+  const handleSingleItemClick = (item) => {
+    const currItem = bugSingleList.TreeRoot.filter(i => i[0] === item[0]);
     setCurrentItem(currItem[0]);
-  }
+  };
 
-  useEffect(()=>{
-    bugSingleList.TreeRoot && setCurrentItem(bugSingleList.TreeRoot[0])
-  },[bugSingleList])
+  useEffect(() => {
+    bugSingleList.TreeRoot && setCurrentItem(bugSingleList.TreeRoot[0]);
+  }, [bugSingleList]);
 
-  useEffect(()=>{
-    if(JSON.stringify(currentItem)!=='[]'){
+  useEffect(() => {
+    if (JSON.stringify(currentItem) !== '[]') {
       //获取bug详情信息用于展示
       dispatch({
         type: 'editReport/getBugDetail',
-        payload:{
-          id:currentItem[0]
-        }
+        payload: {
+          id: currentItem[0],
+        },
       }).then(res => {
         dispatch({
           type: 'allBugs/saveBugItemDetail',
-          payload:{
-            ...res
-          }
-        })
-      })
+          payload: {
+            ...res,
+          },
+        });
+      });
     }
-  },[currentItem])
+  }, [currentItem]);
 
-  const getSingleBugList = ()=>{
+  const getSingleBugList = () => {
     dispatch({
-      type:'allBugs/getSingleList',
-      payload:{
-        case_take_id:`${commonId.caseId}-${commonId.examId}`,
-        start:10*(currPage-1),
-        count:"10",
+      type: 'allBugs/getSingleList',
+      payload: {
+        case_take_id: `${commonId.caseId}-${commonId.examId}`,
+        start: 10 * (currPage - 1),
+        count: '10',
         page,
-        condition:null,
-        roleId:commonId.roleId
-      }
-    })
-  }
+        condition: null,
+        roleId: commonId.roleId,
+      },
+    });
+  };
 
-  useEffect(()=>{
+  useEffect(() => {
     getSingleBugList();
-  },[currPage,page])
+  }, [currPage, page]);
 
   return (
     <div>
       <div className={styles.bugSingleList}>
         {
-          bugSingleList&&bugSingleList.TreeRoot&&bugSingleList.TreeRoot.map((item,index)=>{
+          bugSingleList && bugSingleList.TreeRoot && bugSingleList.TreeRoot.map((item, index) => {
             return (
               <div key={item[0]}
-                className={`${styles.bugListItem} ${currentItem[0] === item[0] ? styles.bugListItemActive : ''}`}
-                onClick={()=>{handleSingleItemClick(item)}}>
+                   className={`${styles.bugListItem} ${currentItem[0] === item[0] ? styles.bugListItemActive : ''}`}
+                   onClick={() => {
+                     handleSingleItemClick(item);
+                   }}>
                 <span className={styles.bugListItemNum}>
-                  Bug{index+1}:
+                  Bug{index + 1}:
                 </span>
                 <div className={styles.bugListItemInfo}>
-                  <div className={styles.bugListItemTitle}>
-                    {item[2]}
-                  </div>
+                  <Tooltip title={item[2]}>
+                    {item[2] + item[2] + item[2]}
+                  </Tooltip>
                 </div>
               </div>
-            )
+            );
           })
         }
       </div>
@@ -88,7 +90,7 @@ const BugSingleList = (props) => {
   );
 };
 
-export default connect(({ allBugs , editReport}) => ({
+export default connect(({ allBugs, editReport }) => ({
   data: allBugs.step,
   bugSingleList: allBugs.bugSingleList,
   reportCommonInfo: editReport.reportCommonInfo,

+ 8 - 0
src/pages/bugs/components/BugSingleList/index.less

@@ -10,11 +10,19 @@
     display: flex;
     height: 60px;
     line-height: 40px;
+    white-space: nowrap;
     .bugListItemNum {
       font-weight: bold;
       display: inline-block;
       width: 50px;
     }
+    .bugListItemInfo{
+      flex: 1;
+      display: inline-block;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+    }
   }
   .bugListItem:last-child{
     border-bottom: 1px dashed #1890ff;

+ 6 - 6
src/pages/bugs/components/BugTreeList/index.jsx

@@ -1,4 +1,4 @@
-import { Pagination } from 'antd';
+import { Pagination, Tooltip } from 'antd';
 import React, { useEffect, useState } from 'react';
 import { connect } from 'umi';
 import styles from './index.less';
@@ -74,11 +74,11 @@ const BugTreeList = (props) => {
                   树{index + 1}:
                 </span>
                 <div className={styles.bugListItemInfo}>
-                  <span className={styles.bugListItemSummary}>
-                  高:{item[2]} 宽:{item[1]} 个数:{item[3]}</span>
-                  <div className={styles.bugListItemTitle}>
-                    {item[5]}
-                  </div>
+                  <div className={styles.bugListItemSummary}>
+                  高:{item[2]} 宽:{item[1]} 个数:{item[3]}</div>
+                    <Tooltip title={item[5]}>
+                      {item[5]}
+                    </Tooltip>
                 </div>
               </div>
             );

+ 12 - 1
src/pages/bugs/components/BugTreeList/index.less

@@ -6,13 +6,24 @@
     border: 1px dashed #1890ff;
     border-bottom: none;
     border-radius: 7px;
-    max-width: 80%;
+    max-width: 90%;
     display: flex;
     .bugListItemNum {
       font-weight: bold;
       display: inline-block;
       width: 50px;
     }
+    .bugListItemInfo{
+      display: inline-block;
+      flex: 1;
+      line-height: 22px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      //.bugListItemTitle{
+      //
+      //}
+    }
   }
   .bugListItem:last-child{
     border-bottom: 1px dashed #1890ff;

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

@@ -171,6 +171,7 @@ const Step2 = (props) => {
           useCase: currentTestCaseRef.current.id,
         },
       }).then(res => {
+        setFileList([])
         setAddTestBugModal(false);
       });
     });
@@ -286,6 +287,7 @@ const Step2 = (props) => {
   };
 
   const searchBugToFork = value =>{
+    value = value.trim();
     forkStatus.current = true;
     currForkId.current = value;
     dispatch({
@@ -639,8 +641,9 @@ const Step2 = (props) => {
                <Button key='cancel' htmlType="button" style={{ marginLeft: '10px' }}
                        onClick={() => {
                          setAddTestBugModal(false);
+                         setFileList([]);
                          forkInput.current.state.value = '';
-                       }}>取消</Button>]}s
+                       }}>取消</Button>]}
              onCancel={() => {
                setAddTestBugModal(false);
              }}
@@ -692,8 +695,11 @@ const Step2 = (props) => {
                     },
                   ]}
                 >
-                  <Select value={addBugForm.getFieldValue('page1')} onSelect={(val) => {
+                  <Select value={addBugForm.getFieldValue('page1')}
+                          disabled={forkStatus}
+                          onSelect={(val) => {
                     handleSelectPage1(val);
+
                   }}>
                     {categories.map((item) => {
                       return <Select.Option value={item.item} key={item.item}>{item.item}
@@ -713,7 +719,7 @@ const Step2 = (props) => {
                   ]}
                 >
                     <Select value={addBugForm.getFieldValue('page2')}
-                      disabled={!page2List.length&& !addBugForm.getFieldValue('page2')}
+                      disabled={(!page2List.length&& !addBugForm.getFieldValue('page2'))||forkStatus}
                           onSelect={(val) => {
                             handleSelectPage2(val);
                           }}>
@@ -733,7 +739,8 @@ const Step2 = (props) => {
                     },
                   ]}
                   >
-                  <Select value={addBugForm.getFieldValue('page3')} disabled={!page3List.length&& !addBugForm.getFieldValue('page3')}>
+                  <Select value={addBugForm.getFieldValue('page3')}
+                          disabled={(!page3List.length&& !addBugForm.getFieldValue('page3'))||forkStatus}>
                     {page3List.map((item) => {
                       return <Select.Option value={item.item} key={item.item}>{item.item}</Select.Option>;
                     })}

+ 1 - 1
src/pages/edit/components/Step2/index.less

@@ -152,7 +152,7 @@
         overflow: hidden;
         display: inline-block;
         text-overflow: ellipsis;
-        display: -webkit-box;// 设置为弹性盒?(后续会专门写一篇文章介绍)有兼容性问题
+        display: -webkit-box;// 设置为弹性盒
         -webkit-line-clamp: 2;// 在一个块元素内显示的文本行数
         line-clamp: 2;
         -webkit-box-orient: vertical;