From 92534e41b9be5a615340ba907b5c55ececeed1f9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 09 八月 2023 13:02:55 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/tabviews/zshare/actionList/normalbutton/mkcounter/index.jsx |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/zshare/actionList/normalbutton/mkcounter/index.jsx b/src/tabviews/zshare/actionList/normalbutton/mkcounter/index.jsx
index 57deaab..05fb8a7 100644
--- a/src/tabviews/zshare/actionList/normalbutton/mkcounter/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/mkcounter/index.jsx
@@ -99,6 +99,20 @@
     }, btn.formType === 'count_line' ? 100 : 500)
   }
 
+  onChange = (val) => {
+    const { btn } = this.props
+
+    this.setState({count: val})
+
+    if (btn.formType === 'count_line' && typeof(val) === 'number') {
+      clearTimeout(this.timer)
+
+      this.timer = setTimeout(() => {
+        this.props.onChange(val)
+      }, 100)
+    }
+  }
+
   render() {
     const { btn, disabled } = this.props
     const { count } = this.state
@@ -106,7 +120,7 @@
     return (
       <div onClick={(e) => e.stopPropagation()} className={'mk-btn-counter ' + (btn.size || '') + (disabled ? ' mk-disabled' : '')} style={btn.style}>
         <span onClick={this.minus}><MinusOutlined /></span>
-        <span><InputNumber value={count} onChange={(val) => this.setState({count: val})} onBlur={this.submit} onPressEnter={this.submit}/></span>
+        <span><InputNumber value={count} onChange={this.onChange} onBlur={this.submit} onPressEnter={this.submit}/></span>
         <span onClick={this.plus}><PlusOutlined /></span>
       </div>
     )

--
Gitblit v1.8.0