From a43e84ab656a9265deaa3b7501ee433e65247e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Fri, 10 Dec 2021 13:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/gird/main.js | 31 +++++++++++++++++++++++++++++-- src/pages/order/list/list.js | 2 +- 2 files changed, 30 insertions(+), 3 deletions(-) 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'}/>: