diff --git a/src/components/gird/main.js b/src/components/gird/main.js index 0f05b4ef..072ee9b1 100644 --- a/src/components/gird/main.js +++ b/src/components/gird/main.js @@ -161,13 +161,40 @@ export default class menu extends React.Component { } - + scrollFunc = function (e) { + e = e || window.event; + if (e.wheelDelta) { //判断浏览器IE,谷歌滑轮事件 + if (e.wheelDelta > 0) { //当滑轮向上滚动时 + + } + if (e.wheelDelta < 0) { //当滑轮向下滚动时 + + } + } else if (e.detail) { //Firefox滑轮事件 + if (e.detail> 0) { //当滑轮向下滚动时 + + } + if (e.detail< 0) { //当滑轮向上滚动时 + + } + } + } componentDidMount() { - + const dom = ReactDom.findDOMNode(this); + if(dom.attachEvent){ + dom.attachEvent('onmousewheel',this.scrollFunc); + + } + //Firefox使用addEventListener添加滚轮事件 + if (dom.addEventListener) {//firefox + dom.addEventListener('DOMMouseScroll', this.scrollFunc, false); + } + //Safari与Chrome属于同一类型 + dom.onmousewheel = this.scrollFunc; } //多选 diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index a860aaa5..8ae646fb 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -515,7 +515,7 @@ componentDidUpdate(prevProps,prevState){

- this.optiononChange(e)} options={options} clearable placeholder="请输入关键字查询" /> {/* */} { this.state.option?this.state.option.key=='1'? {this.setState({key_word:''})}} wordSearch={this.sureFn.bind(this)} onChange={(e)=>this.setState({key_word:e})} value={this.state.key_word} icon="search" placeholder={"请输入key进行搜索"} countShow={false} height={'36px'} width={'260px'} alignment={'left'}/>: