Forráskód Böngészése

Merge remote-tracking branch 'origin/dev5.3.3' into dev/new1

zhouna 5 éve
szülő
commit
59afc19e3d

+ 6 - 1
src/common/components/NumberPan/index.jsx

@@ -22,7 +22,7 @@ class NumberPan extends Component{
     onSelect&&onSelect(value+text);
   }
   handleClear(e){
-    e.stopPropagation();
+    e&&e.stopPropagation();
     const onSelect = this.props.handleSelect;
     this.setState({
       value: ''
@@ -57,6 +57,11 @@ class NumberPan extends Component{
       display:show?'table':'none'        //table onBlur阻止冒泡是为了修复multSpread中数字键盘点击触发最外层数字组件onBlur事件
     }
   }
+  componentWillReceiveProps(next){
+    if(next.toClear&&!this.props.toClear){
+      this.handleClear();
+    }
+  }
   render(){
     const select = this.handleSelect;
     const noString=this.props.noString;

+ 10 - 0
src/components/Multiple/SlideItem/index.jsx

@@ -76,6 +76,16 @@ class SlideItem extends react.Component{
     const params = this.state;
     handleConfirm&&handleConfirm(params);
   }
+  componentWillReceiveProps(next){
+    if(this.props.show!==next.show){
+      const seleData = deepClone(this.props.seleData||[]);
+      const seleId = deepClone(this.props.seleId||[]);
+      this.setState({
+        seleData:seleData||"",
+        seleId:seleId||[]
+      });
+    }
+  }
   render(){
     const {data} = this.props;
     const {seleId} = this.state;

+ 6 - 2
src/components/Multiple/index.jsx

@@ -40,13 +40,14 @@ class Multiple extends react.Component{
     const {show,value,hideTag,isImports,isExtBlue} = this.props;
     const orgBorder = isImports&&!value?style['orange-border']:'';
     const ext = isExtBlue?style['ext']:'';
+    const editBorder = this.state.editable?style['blue-border']:'';
     if(show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
       $(this.$div.current).removeClass(style['borderd']);
     }
     if(value){
-      return hideTag?classNames(style['hide-tag'],orgBorder):classNames(style['selected-tag'],orgBorder);
+      return hideTag?classNames(style['hide-tag'],orgBorder):classNames(style['selected-tag'],orgBorder,editBorder);
     }
     return hideTag?'':classNames(style['tag'],orgBorder,ext);
   }
@@ -84,6 +85,7 @@ class Multiple extends react.Component{
   changeToEdit(e){//双击
     const {value,id,placeholder,handleDbclick,handleHide} = this.props;
     let text = e.target.innerText || e.target.innerHTML;
+    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
     handleHide&&handleHide();       //展开情况下双击收起
     // clearTimeout(this.state.timer);//取消延时的单击事件
     e.stopPropagation();
@@ -92,7 +94,9 @@ class Multiple extends react.Component{
         labelVal:text,
         editable:true
       });
-      e.target.focus();
+      /*setTimeout(()=>{
+        e.target.focus();
+      })*/
       handleDbclick && handleDbclick({value,id,placeholder});
     }
   }

+ 2 - 1
src/components/RadioDrop/index.jsx

@@ -37,6 +37,7 @@ class RadioDrop extends Component{
     const {value,hideTag,show,isImports,isExtBlue} = this.props;
     const ext = isExtBlue?style['ext']:'';
     const orgBorder = isImports?style['orange-border']:'';      //橙色框高亮
+    const editBorder = this.state.editable?style['blue-border']:'';
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
@@ -46,7 +47,7 @@ class RadioDrop extends Component{
       return classNames(style['no-tag'],ext);
     }
     if(value){
-      return style['selected-tag'];
+      return classNames(style['selected-tag'],editBorder);
     }
     return classNames(style['tag'],orgBorder,ext);
   }

+ 7 - 2
src/components/SpreadDrop/index.jsx

@@ -73,9 +73,14 @@ class SpreadDrop extends Component{
       }
     });
     const listWidth = 30+$(this.$list.current).width();
-    if(num >= 4 && windowWidth-getPageCoordinate(e).boxLeft < listWidth){
+    const wleft = getPageCoordinate(e).boxLeft;
+    if(num >= 4 && windowWidth-wleft < listWidth){
       this.setState({
-        left:windowWidth-listWidth-150
+        left:windowWidth-wleft-listWidth-50
+      })
+    }else{
+      this.setState({
+        left:'auto'
       })
     }
     //高度超出时,增加左侧大容器padding

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

@@ -1,7 +1,7 @@
 @import "~@less/mixin.less";
 
 .container{
-  /*position: relative;*/
+  position: relative;
   display: inline-block;
   .selected-tag{
     cursor: pointer;