From 4e1ff4a312e5c5655de7c2ba611bab70415f3eda Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 10 三月 2020 18:20:35 +0800 Subject: [PATCH] 2020-03-10 --- src/templates/subtableconfig/actionform/index.jsx | 79 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 77 insertions(+), 2 deletions(-) diff --git a/src/templates/subtableconfig/actionform/index.jsx b/src/templates/subtableconfig/actionform/index.jsx index 1e1c9e9..6075f12 100644 --- a/src/templates/subtableconfig/actionform/index.jsx +++ b/src/templates/subtableconfig/actionform/index.jsx @@ -21,6 +21,7 @@ formlist: null, openType: null, interType: null, + funcType: null, // 鍔熻兘绫诲瀷 position: null, reqOptionSgl: [{ value: 'requiredSgl', @@ -90,17 +91,24 @@ let _intertype = '' let _position = '' let _tabType = '' + let _funcType = '' // 鍔熻兘鎸夐挳绫诲瀷 let _options = null this.props.formlist.forEach(form => { if (form.key === 'OpenType') { - _opentype = form.initVal + if (this.props.card.execMode) { // 杞崲鎵撳嵃鏃舵墦寮�鏂瑰紡 + _opentype = 'funcbutton' + } else { + _opentype = form.initVal + } } else if (form.key === 'intertype') { _intertype = form.initVal } else if (form.key === 'position') { _position = form.initVal } else if (form.key === 'tabType') { _tabType = form.initVal + } else if (form.key === 'funcType') { + _funcType = form.initVal } }) @@ -120,6 +128,18 @@ } else { _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] } + } else if (_opentype === 'funcbutton') { + if (!_funcType) { + _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] + } else if (_funcType === 'changeuser') { + _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] + } else if (_funcType === 'print') { + if (_intertype === 'outer') { + _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] + } else { + _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] + } + } } else { if (_intertype === 'outer') { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] @@ -131,6 +151,7 @@ openType: _opentype, interType: _intertype, position: _position, + funcType: _funcType, formlist: this.props.formlist.map(item => { if (item.key === 'class') { item.options = btnClasses @@ -176,8 +197,12 @@ }, { value: 'popview', text: this.props.dict['header.form.popview'] + }, { + value: 'funcbutton', + text: this.props.dict['header.form.funcbutton'] } ] + item.initVal = _opentype } else if (item.key === 'execSuccess') { item.options = this.state.closeOptions } else if (item.key === 'execError') { @@ -224,6 +249,18 @@ } else { _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] } + } else if (value === 'funcbutton') { + if (!this.state.funcType) { + _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] + } else if (this.state.funcType === 'changeuser') { + _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] + } else if (this.state.funcType === 'print') { + if (this.state.interType === 'outer') { + _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] + } else { + _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] + } + } } else { if (this.state.interType === 'inner') { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] @@ -268,7 +305,7 @@ this.setState({ formlist: this.state.formlist.map(item => { - if (item.key === 'Ot') { + if (item.key === 'Ot' && !(value === 'funcbutton' && (!this.state.funcType || this.state.funcType === 'changeuser'))) { item.hidden = false } else if (item.key === 'sqlType' && ['prompt', 'exec', 'pop'].includes(value) && this.state.interType === 'inner') { item.hidden = false @@ -332,6 +369,33 @@ }) }) }) + } else if (key === 'funcType') { + let _options = null + if (!value) { + _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] + } else if (value === 'changeuser') { + _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] + } else if (value === 'print') { + if (this.state.interType === 'outer') { + _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] + } else { + _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] + } + } + + this.setState({ + formlist: this.state.formlist.map(item => { + item.hidden = !_options.includes(item.key) + + if (item.hidden) return item + + if (item.key === 'Ot' && value === 'print') { + item.options = this.state.reqOptionsMutil + } + + return item + }) + }) } } @@ -352,6 +416,12 @@ _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] } else { _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] + } + } else if (openType === 'funcbutton') { + if (value === 'outer') { + _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] + } else { + _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] } } else { if (value === 'inner') { @@ -571,6 +641,11 @@ values.Ot = 'notRequired' } else if (values.OpenType === 'popview' && !values.linkTab) { // 娌℃湁鍏宠仈鏍囩锛堟柊寤烘椂锛夛紝鍒涘缓鏂版爣绛綢d values.linkTab = Utils.getuuid() + } else if (values.OpenType === 'funcbutton') { // 杞崲鎵撳嵃鏃舵墦寮�鏂瑰紡 + values.position = 'toolbar' + if (values.funcType === 'print') { + values.OpenType = values.execMode + } } if (values.innerFunc === '' && values.sql === '') { -- Gitblit v1.8.0