king
2023-10-18 d891a5169bef4e64ca8acd354bfe5eab75dbbb4d
src/templates/modalconfig/settingform/index.jsx
@@ -5,7 +5,11 @@
// 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 = {
@@ -18,6 +22,7 @@
    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
@@ -80,7 +85,7 @@
  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 = {
@@ -197,6 +202,32 @@
              )}
            </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="表单元素与左侧边界的距离。">