From f8c3c53f9e29541f8c0e3fcbf682c301fd17e06a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 23 十一月 2020 17:49:23 +0800 Subject: [PATCH] 2020-11-23 --- src/menu/actioncomponent/actionform/index.jsx | 72 ++---------------------------------- 1 files changed, 4 insertions(+), 68 deletions(-) diff --git a/src/menu/actioncomponent/actionform/index.jsx b/src/menu/actioncomponent/actionform/index.jsx index f71386c..a9758c6 100644 --- a/src/menu/actioncomponent/actionform/index.jsx +++ b/src/menu/actioncomponent/actionform/index.jsx @@ -4,8 +4,6 @@ import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Cascader } from 'antd' import { btnIcons, btnCustomClasses, formRule } from '@/utils/option.js' -import Api from '@/api' -import options from '@/store/options.js' import './index.scss' const { TextArea } = Input @@ -157,7 +155,7 @@ _options.push('execMode', 'intertype', 'innerFunc', 'Ot', 'execSuccess', 'execError') } } - } else { + } else if (_opentype === 'popview' && _opentype === 'tab') { if (_intertype === 'outer') { _options.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') } else if (_intertype === 'inner') { @@ -243,14 +241,7 @@ this.props.form.setFieldsValue(_fieldval) }) } else if (key === 'funcType') { - let _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] - if (value === 'print') { - if (this.state.interType === 'outer') { - _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] - } else { - _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] - } - } + let _options = this.getOptions(this.state.openType, this.state.interType, value, card.pageTemplate) let _fieldval = {} this.setState({ @@ -303,17 +294,14 @@ } else if (value === 'LogicDelete' || value === 'delete') { _fieldval.label = '鍒犻櫎' _fieldval.class = 'danger' - _fieldval.Ot = 'required' + _fieldval.Ot = 'requiredSgl' } this.props.form.setFieldsValue(_fieldval) }) } else if (key === 'pageTemplate') { - let _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class'] let _fieldval = {} - if (value === 'custom') { - _options.push('url', 'joint') - } + let _options = this.getOptions(this.state.openType, this.state.interType, this.state.funcType, value) this.setState({ openType: value, @@ -558,7 +546,6 @@ })( <Cascader options={this.state.menulist} - loadData={this.loadData} placeholder="" /> )} @@ -580,57 +567,6 @@ } }) return fields - } - - loadData = selectedOptions => { - const { MenuID } = this.props - const targetOption = selectedOptions[selectedOptions.length - 1] - targetOption.loading = true - - let _param = { - func: 'sPC_Get_FunMenu', - ParentID: targetOption.value, - systemType: options.sysType, - debug: 'Y' - } - - Api.getSystemConfig(_param).then(result => { - if (result.status) { - targetOption.loading = false - targetOption.children = result.data.map(item => { - let submenu = { - value: item.ParentID, - label: item.MenuNameP, - children: item.FunMenu.map(cell => { - return { - value: cell.MenuID, - label: cell.MenuName, - MenuID: cell.MenuID, - MenuName: cell.MenuName, - MenuNo: cell.MenuNo, - Ot: cell.Ot, - PageParam: cell.PageParam, - LinkUrl: cell.LinkUrl, - disabled: cell.MenuID === MenuID - } - }) - } - - return submenu - }) - - this.setState({ - menulist: [...this.state.menulist] - }) - } else { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - targetOption.loading = false - } - }) } handleConfirm = () => { -- Gitblit v1.8.0