浏览代码

Merge remote-tracking branch 'origin/dev/otherHis' into dev/new

# Conflicts:
#	src/utils/config.js
zhouna 6 年之前
父节点
当前提交
d50ffe0c27

+ 8 - 1
src/common/components/EditableSpan/index.jsx

@@ -1,8 +1,10 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import config from "@config/index";
-import {filterArr,handleEnter} from '@utils/tools.js';
+import {filterArr,handleEnter,isIE} from '@utils/tools.js';
 import Notify from '../Notify/index.js';
+
+import $ from 'jquery';
 /*****
  * author:zn@2018-12-10
  * 自由文本输入组件
@@ -147,6 +149,11 @@ class EditableSpan extends Component{
     if(value){
       this.$span.current.innerText = value||'';
     }
+    if(isIE()){
+      $(this.$span.current).onIe8Input(function(e){
+        this.onChange(e)
+      },this);
+    }
   }
 
   render() {

+ 7 - 0
src/common/components/Textarea/index.jsx

@@ -3,6 +3,8 @@ import style from "./index.less";
 import Notify from '../Notify';
 import config from '@config/index';
 import {setLastPosition} from '@common/js/util';
+import {isIE} from '@utils/tools.js';
+import $ from "jquery";
 
 class Textarea extends Component {
   constructor(props) {
@@ -69,6 +71,11 @@ class Textarea extends Component {
     if(value){
       this.$dom.current.innerText = value||'';
     }
+    if(isIE()){
+      $(this.$dom.current).onIe8Input(function(e){
+        this.handleInput(e)
+      },this);
+    }
   }
   render() {
     const { title } = this.props;

+ 3 - 1
src/components/SearchDrop/index.jsx

@@ -52,10 +52,12 @@ class SearchDrop extends Component{
     // onShow&&onShow(e,false);
   }
   render(){
+    let litext = '';
     return <div className={this.getClass()} contenteditable="false" id="searchBox" style={this.getStyle()}>
       <ul>
         {this.props.data&&this.props.data.map((it)=>{
-          return <li onClick={(e)=>this.handleSelect(e,it)}>{it.showType==1?it.name:it.name+'('+it.retrievalName+')'}</li>
+          litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
+          return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
         })}
       </ul>
     </div>

+ 2 - 0
src/components/SearchDrop/index.less

@@ -9,6 +9,8 @@
     border:1px #fff solid;
     padding: 0 20px 0 30px;
     white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
     cursor: pointer;
   }
   li:hover{

+ 13 - 0
src/main.js

@@ -15,6 +15,19 @@ const render = (Component) => {
       = c.clear = c.exception = c.trace = c.assert = function () { };
     return c;
   })();
+  //ie8 onInput替代函数
+  $.fn.onIe8Input = function (fn,thisVal) {
+    return this.each(function () {
+      var $this = $(this);
+      var htmlold = $this.html();
+      $this.bind('blur keyup paste cut mouseup', function (e) {
+        var htmlnew = $this.html();
+        if (htmlold !== htmlnew) {
+          fn.call(thisVal,e);
+        }
+      })
+    })
+  };
     ReactDOM.render(
         <AppContainer>
             <Provider store={store}>