From ff045a6a19e2e0bd5c2433aae71145401627c22d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 19 十二月 2019 19:08:32 +0800 Subject: [PATCH] 2019-12-19 --- src/templates/comtableconfig/actionform/index.jsx | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx index 531b09e..c892e70 100644 --- a/src/templates/comtableconfig/actionform/index.jsx +++ b/src/templates/comtableconfig/actionform/index.jsx @@ -41,6 +41,26 @@ }, { MenuID: 'requiredOnce', text: this.props.dict['header.form.requiredOnce'] + }], + insertUpdateOptions: [{ + MenuID: '', + text: this.props.dict['header.form.empty'] + }, { + MenuID: 'insert', + text: this.props.dict['header.form.action.insert'] + }, { + MenuID: 'update', + text: this.props.dict['header.form.action.update'] + }], + deleteOptions: [{ + MenuID: '', + text: this.props.dict['header.form.empty'] + }, { + MenuID: 'LogicDelete', + text: this.props.dict['header.form.action.LogicDelete'] + }, { + MenuID: 'delete', + text: this.props.dict['header.form.action.delete'] }] } @@ -86,6 +106,12 @@ } else { item.options = this.state.reqOptionsMutil } + } else if (item.key === 'sqlType') { + if (['prompt', 'exec'].includes(_opentype)) { + item.options = this.state.deleteOptions + } else { + item.options = this.state.insertUpdateOptions + } } item.hidden = !_options.includes(item.key) return item @@ -129,14 +155,21 @@ if (value === 'innerpage' || this.state.position === 'grid') { item.options = this.state.reqOptionSgl item.initVal = 'requiredSgl' - item.hidden = true } else if (['outerpage', 'blank', 'tab', 'popview'].includes(value)) { item.options = this.state.reqOptions item.initVal = 'requiredSgl' - item.hidden = true } else { item.options = this.state.reqOptionsMutil } + item.hidden = true + } else if (item.key === 'sqlType') { + if (['prompt', 'exec'].includes(value)) { + item.options = this.state.deleteOptions + } else { + item.options = this.state.insertUpdateOptions + } + item.initVal = '' + item.hidden = true } return item }) @@ -146,6 +179,8 @@ this.setState({ formlist: this.state.formlist.map(item => { if (item.key === 'Ot') { + item.hidden = false + } else if (item.key === 'sqlType' && ['prompt', 'exec', 'pop'].includes(value)) { item.hidden = false } return item @@ -213,16 +248,13 @@ let _rules = [] if (item.key === 'innerFunc') { let str = '^(' + item.fields.join('|') + ')' - let _patten = new RegExp(str + '[0-9a-zA-Z_]*', 'ig') + let _patten = new RegExp(str + '[0-9a-zA-Z_]*$', 'g') _rules = [{ pattern: _patten, message: '鍚嶇О鍙厑璁稿寘鍚暟瀛椼�佸瓧姣嶅拰涓嬪垝绾匡紝涓斾互鎸囧畾瀛楃寮�濮嬨��' }, { - min: 6, - message: '鍐呴儴鍑芥暟鍚嶇О涓嶅皬浜�6涓瓧绗︺��' - }, { - max: 100, - message: '鍐呴儴鍑芥暟鍚嶇О涓嶈秴杩�100涓瓧绗︺��' + max: 50, + message: '鍐呴儴鍑芥暟鍚嶇О涓嶈秴杩�50涓瓧绗︺��' }] } fields.push( -- Gitblit v1.8.0