From 120a1ca7042212630dbe9a0cb6aa208ebf1b1e3d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 22 十二月 2021 16:15:17 +0800 Subject: [PATCH] 2021-12-22 --- src/templates/sharecomponent/actioncomponent/actionform/index.jsx | 34 ++++++++++++++++++++++++++++------ 1 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx index 20d48f2..e348183 100644 --- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx @@ -4,10 +4,12 @@ import { Form, Row, Col, Input, Select, Radio, notification, Tooltip, InputNumber, Cascader } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' -import { btnIcons, btnClasses, formRule } from '@/utils/option.js' -import MkIcon from '@/components/mk-icon' +import { btnClasses, formRule } from '@/utils/option.js' +import asyncComponent from '@/utils/asyncComponent' import Utils from '@/utils/utils.js' import './index.scss' + +const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) const { TextArea } = Input const actionTypeOptions = { @@ -125,8 +127,6 @@ item.options = btnClasses } else if (item.key === 'innerFunc' && _procMode === 'inner') { item.required = true - } else if (item.key === 'icon') { - item.options = btnIcons } else if (item.key === 'intertype') { let iscustom = ['pop', 'prompt', 'exec'].includes(_opentype) item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom')) @@ -605,12 +605,11 @@ showSearch filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} onChange={(value) => {this.optionChange(item.key, value)}} - allowClear={item.key === 'icon'} getPopupContainer={() => document.getElementById('winter')} > {item.options.map((option, index) => <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value || option.field}> - {item.key === 'icon' && option.value ? <MkIcon type={option.value} /> : null} {option.text || option.label} + {option.text || option.label} </Select.Option> )} </Select> @@ -618,6 +617,29 @@ </Form.Item> </Col> ) + } else if (item.type === 'icon') { // 涓嬫媺鎼滅储 + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> + <QuestionCircleOutlined className="mk-form-tip" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: item.initVal || '', + rules: [ + { + required: !!item.required, + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <MkEditIcon options={['edit', 'direction', 'normal', 'data', 'hint']} allowClear/> + )} + </Form.Item> + </Col> + ) } else if (item.type === 'radio') { fields.push( <Col span={12} key={index}> -- Gitblit v1.8.0