From c0930736f5b5955efecdac4c0ca85957d4f7b574 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 16 十二月 2019 22:55:17 +0800 Subject: [PATCH] 2019-12-16 --- src/templates/comtableconfig/actionform/index.jsx | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx index 14250ea..b1f06d8 100644 --- a/src/templates/comtableconfig/actionform/index.jsx +++ b/src/templates/comtableconfig/actionform/index.jsx @@ -210,6 +210,21 @@ if (item.hidden) return if (item.type === 'text') { // 鏂囨湰鎼滅储 + let _rules = [] + if (item.key === 'innerFunc') { + let str = '^(' + item.fields.join('|') + ')' + let _patten = new RegExp(str + '[0-9a-zA-Z_]*', 'ig') + _rules = [{ + pattern: _patten, + message: '鍚嶇О鍙厑璁稿寘鍚暟瀛椼�佸瓧姣嶅拰涓嬪垝绾匡紝涓斾互鎸囧畾瀛楃寮�濮嬨��' + }, { + min: 6, + message: '鍐呴儴鍑芥暟鍚嶇О涓嶅皬浜�6涓瓧绗︺��' + }, { + max: 100, + message: '鍐呴儴鍑芥暟鍚嶇О涓嶈秴杩�100涓瓧绗︺��' + }] + } fields.push( <Col span={12} key={index}> <Form.Item label={item.tooltip ? @@ -224,7 +239,8 @@ { required: item.readonly ? false : !!item.required, message: this.props.dict['form.required.input'] + item.label + '!' - } + }, + ..._rules ] })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} </Form.Item> @@ -317,13 +333,19 @@ values.position = 'toolbar' values.Ot = 'notRequired' } - + console.log(values) if (values.innerFunc === '' && values.sql === '') { notification.warning({ top: 92, message: this.props.dict['header.form.actionhelp.datasource'], duration: 10 }) + } else if (values.innerFunc === '' && values.sql !== '' && values.sqlType === '') { + notification.warning({ + top: 92, + message: this.props.dict['header.form.actionhelp.sqlType'], + duration: 10 + }) } else { resolve({ type: 'action', -- Gitblit v1.8.0