Browse Source

下拉项间距调整,ie8事件兼容

zhouna 6 năm trước cách đây
mục cha
commit
db90e04f23

+ 11 - 7
src/common/components/EditableSpan/index.jsx

@@ -1,7 +1,7 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import config from "@config/index";
-import {filterArr,handleEnter,isIE} from '@utils/tools.js';
+import {filterArr,isIE} from '@utils/tools.js';
 import Notify from '../Notify/index.js';
 
 import $ from 'jquery';
@@ -111,11 +111,13 @@ class EditableSpan extends Component{
   }
 
   handleKeydown(e){
-    let innerVal = e.target.innerText;
+    const ev = e||window.event;
+    const target = ev.target||ev.srcElement;
+    let innerVal = target.innerText;
     //禁止回车事件
-    if(e.keyCode==13){return false;}
+    if(ev.keyCode==13){return false;}
     //backspace事件
-    if(e.keyCode==8){
+    if(ev.keyCode==8){
       //用于对比backspace前后的值
       this.setState({
         preVal:innerVal
@@ -125,9 +127,11 @@ class EditableSpan extends Component{
   }
   handleKeyup(e){
      const {boxMark,handleKeydown,i,value} = this.props;
-     const {preVal,index} = this.state;console.log(22,i,index);
-    let innerVal = e.target.innerText;
-    if(e.keyCode==8){
+     const {preVal,index} = this.state;
+    const ev = e||window.event;
+    const target = ev.target||ev.srcElement;
+    let innerVal = target.innerText;
+    if(ev.keyCode==8){
       if(innerVal !==preVal){return}
       let data = innerVal.trim();
       //判断是否为空、中英文:, 。、;,且不是第一位

+ 5 - 5
src/common/less/variables.less

@@ -62,13 +62,13 @@
 }
 .mult-li{
   // width: 200px;
-  height: 44px;
-  line-height: 44px;
+  height: 32px;
+  line-height: 32px;
   padding-right: 8px;
 }
 .select-li{
-  height: 44px;
-  line-height: 44px;
+  height: 32px;
+  line-height: 32px;
   width: 100%;
   font-size: 14px;
   text-align: left;
@@ -79,7 +79,7 @@
   background: rgba(59,158,208,0.1);
   background-image: url(../images/first.png);
   background-repeat: no-repeat;
-  background-position: 20px 15px;
+  background-position: 20px 10px;
 }
 .clear{
   width: 88px;

+ 1 - 1
src/components/SpreadDrop/index.less

@@ -12,7 +12,7 @@
     // width: 200px;
     vertical-align: top;
     margin-left: 8px;
-    max-height: 220px;
+    max-height: 326px;
     overflow-y: auto;
   }
   .independent{