From 704f82b06befe96e5f739b2dce419f76f5683a6f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 15 八月 2022 09:27:54 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/components/form/formaction/actionform/index.jsx | 58 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/menu/components/form/formaction/actionform/index.jsx b/src/menu/components/form/formaction/actionform/index.jsx index a49f945..306130a 100644 --- a/src/menu/components/form/formaction/actionform/index.jsx +++ b/src/menu/components/form/formaction/actionform/index.jsx @@ -21,7 +21,8 @@ formlist: null, // 琛ㄥ崟淇℃伅 interType: null, // 鎺ュ彛绫诲瀷锛氬唴閮ㄣ�佸閮� procMode: null, // 鍙傛暟鏂瑰紡 - linkmenu: null + linkmenu: null, + callbackType: null } @@ -30,12 +31,14 @@ let _intertype = card.intertype || 'system' // 鎺ュ彛绫诲瀷 let _procMode = card.procMode || 'system' // 鍙傛暟璇锋眰鏂瑰紡 + let _callbackType = card.callbackType || 'script' - let _options = this.getOptions(_intertype, _procMode, card.linkmenu) + let _options = this.getOptions(_intertype, _procMode, card.linkmenu, _callbackType) this.setState({ interType: _intertype, procMode: _procMode, + callbackType: _callbackType, linkmenu: card.linkmenu, formlist: this.props.formlist.map(item => { if (item.key === 'innerFunc' && _procMode === 'inner') { @@ -48,7 +51,7 @@ }) } - getOptions = (_intertype, _procMode, linkmenu) => { + getOptions = (_intertype, _procMode, linkmenu, _callbackType) => { const { card } = this.props if (card.type === 'prev') { @@ -60,14 +63,30 @@ if (_intertype === 'custom') { _options.pop() - _options.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method', 'cross') + _options.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross') if (_procMode === 'system') { _options.push('sql', 'sqlType') } else { _options.push('innerFunc') } + if (_callbackType === 'func') { + _options.push('callbackFunc') + } else if (_callbackType !== 'none') { + _options.push('cbTable') + } } else if (_intertype === 'outer') { - _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') + _options.push('procMode', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackType') + if (_procMode === 'system') { + _options.push('sql', 'sqlType') + } else if (_procMode === 'inner') { + _options.push('innerFunc') + } + if (_callbackType === 'func') { + _options.push('callbackFunc') + } else if (_callbackType !== 'none') { + _options.push('cbTable') + } + } else if (_intertype === 'inner') { _options.push('innerFunc') } else { @@ -88,10 +107,10 @@ * 3銆佸垏鎹㈡爣绛剧被鍨嬶紝閲嶇疆鍙�夋爣绛� */ optionChange = (key, value) => { - const { procMode, linkmenu } = this.state + const { procMode, linkmenu, callbackType } = this.state if (key === 'intertype') { - let _options = this.getOptions(value, procMode, linkmenu) + let _options = this.getOptions(value, procMode, linkmenu, callbackType) this.setState({ interType: value, @@ -107,25 +126,38 @@ }) }) } else if (key === 'procMode') { - let _options = this.getOptions(this.state.interType, value, linkmenu) + let _options = this.getOptions(this.state.interType, value, linkmenu, callbackType) this.setState({ procMode: value, formlist: this.state.formlist.map(item => { item.hidden = !_options.includes(item.key) - if (item.key === 'innerFunc') { - item.required = true + if (item.key === 'procMode') { + item.initVal = value } return item }) }) } else if (key === 'linkmenu') { - let _options = this.getOptions(this.state.interType, procMode, value) + let _options = this.getOptions(this.state.interType, procMode, value, callbackType) this.setState({ linkmenu: value, formlist: this.state.formlist.map(item => { + item.hidden = !_options.includes(item.key) + return item + }) + }) + } else if (key === 'callbackType') { + let _options = this.getOptions(this.state.interType, procMode, linkmenu, value) + + this.setState({ + callbackType: value, + formlist: this.state.formlist.map(item => { + if (item.key === 'callbackType') { + item.initVal = value + } item.hidden = !_options.includes(item.key) return item }) @@ -160,7 +192,7 @@ getFields() { const { getFieldDecorator } = this.props.form - const { interType } = this.state + const { interType, callbackType } = this.state const fields = [] this.state.formlist.forEach((item, index) => { @@ -187,7 +219,7 @@ message: formRule.func.maxMessage }] } else if (item.key === 'output') { - if (interType === 'system') { + if (interType === 'system' || ((interType === 'outer' || interType === 'custom') && callbackType === 'script')) { _rules = [{ pattern: /^@[0-9a-zA-Z_]+@?$/, message: '鍙橀噺浠绗﹀紑澶达紝鍙娇鐢ㄥ瓧姣嶃�佹暟瀛椾互鍙奯' -- Gitblit v1.8.0