From 822bc67061448c6e3a1eb77d39be4ad2b84b416a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 27 二月 2020 09:36:34 +0800 Subject: [PATCH] 2020-02-27 --- src/templates/comtableconfig/actionform/index.jsx | 86 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 78 insertions(+), 8 deletions(-) diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx index 9adcb57..36a4f25 100644 --- a/src/templates/comtableconfig/actionform/index.jsx +++ b/src/templates/comtableconfig/actionform/index.jsx @@ -20,6 +20,7 @@ formlist: null, // 琛ㄥ崟淇℃伅 openType: null, // 鎵撳紑鏂瑰紡 interType: null, // 鎺ュ彛绫诲瀷锛氬唴閮ㄣ�佸閮� + funcType: null, // 鍔熻兘绫诲瀷 position: null, // 鎸夐挳浣嶇疆 reqOptionSgl: [{ value: 'requiredSgl', @@ -69,21 +70,28 @@ UNSAFE_componentWillMount () { - let _opentype = '' - let _intertype = '' - let _position = '' - let _tabType = '' - let _options = null + let _opentype = '' // 鎵撳紑鏂瑰紡 + 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 } }) @@ -109,6 +117,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'] @@ -120,6 +140,7 @@ openType: _opentype, interType: _intertype, position: _position, + funcType: _funcType, formlist: this.props.formlist.map(item => { if (item.key === 'class') { item.options = btnClasses @@ -147,7 +168,10 @@ }, ..._tabs ] + } else if (item.key === 'OpenType') { + item.initVal = _opentype } + item.hidden = !_options.includes(item.key) return item }) @@ -175,7 +199,7 @@ */ openTypeChange = (key, value) => { if (key === 'OpenType') { - let _options = [] + let _options = null if (value === 'innerpage') { _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position'] } else if (value === 'outerpage') { @@ -195,6 +219,18 @@ _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 (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') { @@ -280,12 +316,38 @@ }, ..._tabs ] - _fieldval.linkTab = '' } return item }) }, () => { this.props.form.setFieldsValue(_fieldval) + }) + } 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 + }) }) } } @@ -306,6 +368,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') { @@ -526,6 +594,8 @@ values.Ot = 'notRequired' } else if (values.OpenType === 'popview' && !values.linkTab) { // 娌℃湁鍏宠仈鏍囩锛堟柊寤烘椂锛夛紝鍒涘缓鏂版爣绛綢d values.linkTab = Utils.getuuid() + } else if (values.OpenType === 'funcbutton' && values.funcType === 'print') { // 杞崲鎵撳嵃鏃舵墦寮�鏂瑰紡 + values.OpenType = values.execMode } if (values.innerFunc === '' && values.sql === '') { -- Gitblit v1.8.0