| | |
| | | |
| | | // import { formRule } from '@/utils/option.js' |
| | | import StyleInput from '@/menu/stylecontroller/styleInput' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | |
| | | fields: null, |
| | | display: this.props.config.setting.display || 'modal', |
| | | placement: this.props.config.setting.placement || 'right', |
| | | icon: this.props.config.setting.icon || '', |
| | | appType: sessionStorage.getItem('appType'), |
| | | viewType: sessionStorage.getItem('editMenuType') || '', |
| | | dialogInput: false |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { fields, appType, display, placement } = this.state |
| | | const { fields, appType, display, placement, icon } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const formItemLayout = { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType !== 'mob' && display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="图标"> |
| | | {getFieldDecorator('icon', { |
| | | initialValue: icon |
| | | })(<MkEditIcon onChange={(value) => this.setState({icon: value})} allowClear={true}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType !== 'mob' && display === 'modal' && icon ? <Col span={12}> |
| | | <Form.Item label="图标样式"> |
| | | {getFieldDecorator('iconType', { |
| | | initialValue: config.setting.iconType || 'def' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="def">默认</Radio> |
| | | <Radio value="circle">圆形</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType !== 'mob' && display === 'modal' && icon ? <Col span={12}> |
| | | <Form.Item label="图标颜色"> |
| | | {getFieldDecorator('iconColor', { |
| | | initialValue: config.setting.iconColor || '' |
| | | })(<ColorSketch allowClear={true}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType === 'mob' && display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="表单元素与左侧边界的距离。"> |