From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 09 二月 2022 11:48:29 +0800 Subject: [PATCH] 2022-02-09 --- src/menu/components/share/actioncomponent/actionform/index.jsx | 98 ++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 81 insertions(+), 17 deletions(-) diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index dce21d6..0d4b95f 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -11,15 +11,16 @@ const { TextArea } = Input const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) const acTyOptions = { - pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'refreshTab', 'reload'], - prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'refreshTab', 'reload'], - exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'refreshTab', 'reload'], + pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'refreshTab'], + prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'refreshTab'], + exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'refreshTab'], excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'], excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'], popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'syncComponent', 'clickouter'], tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width'], innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'open'], - funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width'] + funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width'], + form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'open', 'refreshTab', 'title'] } class ActionForm extends Component { @@ -38,13 +39,13 @@ requireOptions: [], insertUpdateOptions: [{ value: 'insert', - text: this.props.dict['header.form.action.insert'] + text: '娣诲姞' }, { value: 'update', - text: this.props.dict['header.form.action.update'] + text: '淇敼' }, { value: 'audit', - text: this.props.dict['header.form.action.audit'] + text: '瀹℃牳' }], deleteOptions: [{ value: 'LogicDelete', @@ -54,7 +55,7 @@ text: '鐗╃悊鍒犻櫎' }, { value: 'custom', - text: this.props.dict['header.form.custom'] + text: '鑷畾涔�' }], interTypeOptions: [{ value: 'system', @@ -197,6 +198,50 @@ } else { reOptions.sqlType = this.state.insertUpdateOptions } + // if (this.record.execSuccess === 'goback') { + shows.push('reload') + // } + } else if (openType === 'form') { + let intertype = this.record.intertype + + if (this.record.formType === 'switch') { + shows.push('field', 'size', 'openVal', 'closeVal', 'openText', 'closeText') + } else { + shows.push('field', 'openVal', 'closeVal') + } + + reOptions.intertype = this.state.interTypeOptions.filter(item => item.value !== 'custom') + + if (intertype === 'outer') { + shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') + reRequired.innerFunc = false + + if (this.record.sysInterface === 'false') { + reReadonly.interface = false + reRequired.interface = true + } else { + reReadonly.interface = true + reRequired.interface = false + } + } else if (intertype === 'inner') { + shows.push('innerFunc') + reRequired.innerFunc = true + } else { + shows.push('sql', 'sqlType') + } + + if (this.record.execSuccess === 'goback') { + shows.push('reload') + } + + reOptions.Ot = requireOptions + reOptions.sqlType = [{ + value: 'update', + text: '淇敼' + }, { + value: 'custom', + text: '鑷畾涔�' + }] } else if (openType === 'excelIn') { reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom') reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) @@ -375,6 +420,10 @@ _fieldval.intertype = 'system' _fieldval.sqlType = '' + } else if (value === 'form') { + _fieldval.Ot = 'requiredSgl' + + this.record.Ot = 'requiredSgl' } else if (value === 'excelIn') { _fieldval.intertype = 'system' _fieldval.Ot = 'notRequired' @@ -446,10 +495,12 @@ } else if (value === 'update') { _fieldval.label = '淇敼' _fieldval.Ot = 'requiredSgl' - if (hasclass) { - _fieldval.class = 'purple' - } else { - _fieldval.color = 'primary' + if (this.record.OpenType !== 'form') { + if (hasclass) { + _fieldval.class = 'purple' + } else { + _fieldval.color = 'primary' + } } } else if (value === 'audit') { _fieldval.label = '瀹℃牳' @@ -469,10 +520,10 @@ } } - this.record.label = _fieldval.label - this.record.Ot = _fieldval.Ot - this.record.class = _fieldval.class || '' - this.record.color = _fieldval.color || '' + this.record.label = _fieldval.label || this.record.label || '' + this.record.Ot = _fieldval.Ot || this.record.Ot || '' + this.record.class = _fieldval.class || this.record.class || '' + this.record.color = _fieldval.color || this.record.color || '' if (appType !== 'mob' && _fieldval.Ot === 'notRequired') { this.record.control = '' @@ -549,6 +600,14 @@ let content = null let initVal = item.initVal || '' + if (item.type === 'splitLine') { + fields.push( + <Col span={24} key={index}> + <p style={{borderBottom: '1px solid #e9e9e9', color: '#1890ff', textAlign: 'center'}}>{item.label}</p> + </Col> + ) + return + } if (item.type === 'text') { rules = [ { required: item.required, message: dict['form.required.input'] + item.label + '!' } @@ -655,7 +714,12 @@ values.verify = card.verify || null values.modal = card.modal || null - if (values.OpenType === 'excelOut') { + if (values.OpenType === 'form') { + if (/^(0|[1-9]\d*)$/.test(values.openVal) && /^(0|[1-9]\d*)$/.test(values.closeVal)) { + values.openVal = +values.openVal + values.closeVal = +values.closeVal + } + } else if (values.OpenType === 'excelOut') { if (values.intertype === 'system' && setting.interType !== 'system') { notification.warning({ top: 92, -- Gitblit v1.8.0