From e9c48bd7356462ba9257540b130a47a65ad1861d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 26 八月 2021 17:17:11 +0800
Subject: [PATCH] 2021-08-26

---
 src/tabviews/zshare/mutilform/index.jsx |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 28affdd..7006e7b 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -160,6 +160,9 @@
       }
 
       if (item.type === 'text') {
+        if (typeof(item.initval) === 'number') {
+          item.initval = item.initval + ''
+        }
         let _rules = [{
           pattern: /^[^']*$/ig,
           message: formRule.input.quotemsg
@@ -186,6 +189,11 @@
             _rules.push({
               pattern: /^[a-zA-Z0-9]*$/ig,
               message: formRule.input.letternummsg
+            })
+          } else if (item.regular === 'phone') {
+            _rules.push({
+              pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ig,
+              message: '璇锋纭緭鍏ユ墜鏈哄彿'
             })
           } else if (item.regular === 'funcname') {
             _rules.push({
@@ -656,9 +664,9 @@
         let label = item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}><Icon type="question-circle" />{item.label}</Tooltip> : item.label
       
         if (item.type === 'text' || item.type === 'linkMain') {
-          content = (<MKInput config={item} onChange={(val) => this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
+          content = (<MKInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
         } else if (item.type === 'number') {
-          content = (<MKNumberInput config={item} onChange={(val) => this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
+          content = (<MKNumberInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
         } else if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect') {
           content = (<MKSelect config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)} onSubmit={this.props.inputSubmit} />)
         } else if (item.type === 'color') {
@@ -677,7 +685,7 @@
         } else if (item.type === 'fileupload') {
           content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />)
         } else if (item.type === 'textarea') {
-          content = (<MKTextArea config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>)
+          content = (<MKTextArea config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})}/>)
         } else if (item.type === 'brafteditor') {
           content = (<MKEditor config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>)
           label = item.hidelabel !== 'true' ? label : ''

--
Gitblit v1.8.0