Procházet zdrojové kódy

处理诊断名称过长时右边推送显示(2504)

zhangxc před 5 roky
rodič
revize
5fb889c331

+ 2 - 2
src/components/DiagnosticItem/index.jsx

@@ -102,13 +102,13 @@ class DiagnosticItem extends Component{
         const { visible,hasEnterItem,hasEnterImg } = this.state
         const { item, title, type } = this.props
         return (<span className={style['diag-item']} >
-                    <span className={`${style['diag-name']} ${type == 'search' ? style['diag-name-search'] : ''}`} 
+                    <span className={`${style['diag-name']}`} 
                           title = {title && item.name + (item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': '')}
                           onMouseEnter={this.handleMouseEnterDrug.bind(this)}
                           onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
                           onClick={() =>{this.chooseDiagodal(item)}}
                           >
-                        {item.name} {item.retrievalName ? '('+ item.retrievalName+')': ''}
+                        <p className={`${style['diag-name-box']} ${type == 'search'?style['diag-name-search']:style['diag-name-disSelect']}`}>{item.name} {item.retrievalName ? '('+ item.retrievalName+')': ''}</p>
                         {type== 'disSelect' &&<img className={style['info-img']}  
                                 title='点击i图标可查看详细说明'
                                 style ={hasEnterItem  ? {display: "inline-block"} : {display: "none"}}

+ 12 - 0
src/components/DiagnosticItem/index.less

@@ -14,6 +14,18 @@
     text-overflow: ellipsis;
     white-space: nowrap;
 }
+.diag-name-box {
+    display: inline-block;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+.diag-name-search {
+    max-width: 250px;
+}
+.diag-name-disSelect {
+    max-width: 340px;
+}
 .diag-name {
     position: relative;
     display: inline-block;

+ 2 - 2
src/components/PushItems/PushDiag/index.jsx

@@ -47,14 +47,14 @@ class PushDiag extends Component {
         let ItemNum = 0;
         return (<div className={style['push-diag-wrapper']}>
             <h1 className={style['push-diag-title']} style={{background:titleBg}}><img className={style['push-diag-icon']} src={icon} />{title}</h1>
-            <div className={`${style['push-diag-box']} ${domH>50&&showSlide?style['push-diag-more-slide-d']:style['push-diag-more-slide-u']}`} ref={this.$ide}>
+            <div className={`${style['push-diag-box']} ${domH>55&&showSlide?style['push-diag-more-slide-d']:style['push-diag-more-slide-u']}`} ref={this.$ide}>
                 {
                     diagList.map((item, index) => {
                         ItemNum = ItemNum + item.name.length + 1;
                         return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>
                     })
                 }
-                {domH>50&&<div onClick={() => this.handleShow()} className={`${style['push-diag-more']} ${showSlide?style['push-diag-more-d']:style['push-diag-more-u']}`}>{showSlide ? ' 更多': '收起'}<img className={style['push-diag-more-icon']} src={showSlide ? showImg : hideImg}/></div>}
+                {domH>55&&<div onClick={() => this.handleShow()} className={`${style['push-diag-more']} ${showSlide?style['push-diag-more-d']:style['push-diag-more-u']}`}>{showSlide ? ' 更多': '收起'}<img className={style['push-diag-more-icon']} src={showSlide ? showImg : hideImg}/></div>}
 
             </div>
         </div>)

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
-const host='http://192.168.2.121:5050';//后端接口访问地址
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-// const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.121:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚