| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Button, Input, Radio, Icon, Cascader } from 'antd' |
| | | import { Form, Row, Col, Select, Button, Input, Radio, Cascader } from 'antd' |
| | | |
| | | import { minkeColorSystem, minkeIconSystem } from '@/utils/option.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import './index.scss' |
| | | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | card: PropTypes.object, // 字段信息 |
| | | columns: PropTypes.array, // 列名集合 |
| | | markChange: PropTypes.func // 修改函数 |
| | |
| | | selectIcon: record.icon || '', |
| | | options: this.state.options.map(option => { |
| | | option.children = option.children.map(cell => { |
| | | cell.label = <div className={_type + cell.value}>{record.icon ? <Icon type={record.icon} /> : cell.value}</div> |
| | | cell.label = <div className={_type + cell.value}>{record.icon ? <MkIcon type={record.icon} /> : cell.value}</div> |
| | | |
| | | return cell |
| | | }) |
| | |
| | | selectIcon: val, |
| | | options: this.state.options.map(option => { |
| | | option.children = option.children.map(cell => { |
| | | cell.label = <div className={'font ' + cell.value}><Icon type={val} /></div> |
| | | cell.label = <div className={'font ' + cell.value}><MkIcon type={val} /></div> |
| | | |
| | | return cell |
| | | }) |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '字段!' |
| | | message: '请选择字段!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '对比方式!' |
| | | message: '请选择对比方式!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '对比字段!' |
| | | message: '请选择对比字段!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '标记方式!' |
| | | message: '请选择标记方式!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | <Select.Option value="hint">提示建议性图标</Select.Option> |
| | | <Select.Option value="edit">编辑类图标</Select.Option> |
| | | <Select.Option value="data">数据类图标</Select.Option> |
| | | <Select.Option value="trademark">品牌和标识</Select.Option> |
| | | <Select.Option value="normal">网站通用图标</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {signType === 'icon' ? <Col span={6}> |
| | | <Form.Item label={'图标'}> |
| | | <Form.Item label="图标"> |
| | | {getFieldDecorator('icon', { |
| | | initialValue: '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '图标!' |
| | | message: '请选择图标!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select onChange={this.changeIcon} getPopupContainer={() => document.getElementById('model-mark-form-box')}> |
| | | {icons.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} |
| | | {icons.map(icon => <Select.Option key={icon} value={icon}><MkIcon type={icon} /></Select.Option>)} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '颜色!' |
| | | message: '请选择颜色!' |
| | | } |
| | | ] |
| | | })( |