From f068c617b918fc7817c11724424cb1a9149ec3a2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 09 一月 2020 16:51:10 +0800
Subject: [PATCH] 2020-01-09

---
 src/templates/tableshare/searchform/index.jsx |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/templates/tableshare/searchform/index.jsx b/src/templates/tableshare/searchform/index.jsx
index 2585ba8..0fc9570 100644
--- a/src/templates/tableshare/searchform/index.jsx
+++ b/src/templates/tableshare/searchform/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip } from 'antd'
-import { dateOptions, matchReg } from '@/utils/option.js'
+import { dateOptions, matchReg, formRule } from '@/utils/option.js'
 import EditTable from '../editable'
 import './index.scss'
 
@@ -201,7 +201,22 @@
       if (item.hidden) return
 
       if (item.type === 'text') { // 鏂囨湰鎼滅储
-        let rules = item.rules || []
+        let rules = []
+        if (item.key === 'field') {
+          rules = [{
+            pattern: formRule.field.pattern,
+            message: formRule.field.message
+          }, {
+            max: formRule.field.max,
+            message: formRule.field.maxMessage
+          }]
+        } else {
+          rules = [{
+            max: formRule.input.max,
+            message: formRule.input.message
+          }]
+        }
+        
         fields.push(
           <Col span={12} key={index}>
             <Form.Item label={item.tooltip ?

--
Gitblit v1.8.0