From 523cec6c87d88b43954a4409a8dfde6aade095a1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 22 五月 2020 11:02:10 +0800 Subject: [PATCH] 2020-05-22 --- src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx | 53 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 47 insertions(+), 6 deletions(-) diff --git a/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx b/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx index 6b9bfbf..6147594 100644 --- a/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { Form, Row, Col, Select, Button, Input, InputNumber, Radio, Icon, Cascader, Tooltip } from 'antd' -import { minkeColorSystem } from '@/utils/option.js' +import { minkeColorSystem, minkeIconSystem } from '@/utils/option.js' import './index.scss' class UniqueForm extends Component { @@ -19,7 +19,8 @@ originField: this.props.card, signType: 'background', selectIcon: '', - options: minkeColorSystem + options: minkeColorSystem, + icons: minkeIconSystem.direction } UNSAFE_componentWillMount() { @@ -57,6 +58,9 @@ }) } + /** + * @description 瀛楁鍒囨崲 + */ fieldChange = (value) => { const { columns } = this.props let item = columns.filter(col => col.field === value)[0] @@ -72,12 +76,18 @@ } } + /** + * @description 瀵规瘮鍊肩被鍨嬪垏鎹� + */ changeType = (val) => { this.setState({ contrastType: val }) } + /** + * @description 鏍囪绫诲瀷鍒囨崲 + */ changeSignType = (val) => { let _type = 'background ' if (val === 'icon' || val === 'font') { @@ -103,6 +113,20 @@ this.setState(newState) } + /** + * @description 鍥炬爣绫诲瀷鍒囨崲 + */ + changeIconType = (val) => { + this.setState({ + icons: minkeIconSystem[val], + selectIcon: '' + }) + this.props.form.setFieldsValue({icon: ''}) + } + + /** + * @description 鍒囨崲鍥炬爣 + */ changeIcon = (val) => { this.setState({ selectIcon: val, @@ -141,7 +165,7 @@ render() { const { columns } = this.props - const { originField, contrastType, signType, options, selectIcon } = this.state + const { originField, contrastType, signType, options, selectIcon, icons } = this.state const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -288,6 +312,22 @@ </Form.Item> </Col> : null} {signType === 'icon' ? <Col span={6}> + <Form.Item label={'鍥炬爣绫诲瀷'}> + {getFieldDecorator('iconType', { + initialValue: 'direction' + })( + <Select onChange={this.changeIconType}> + <Select.Option value="direction">鏂瑰悜鎬у浘鏍�</Select.Option> + <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={'鍥炬爣'}> {getFieldDecorator('icon', { initialValue: '', @@ -299,7 +339,8 @@ ] })( <Select onChange={this.changeIcon} getPopupContainer={() => document.getElementById('model-mark-form-box')}> - <Select.Option value="arrow-up"><Icon type="arrow-up" /></Select.Option> + {icons.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} + {/* <Select.Option value="arrow-up"><Icon type="arrow-up" /></Select.Option> <Select.Option value="arrow-down"><Icon type="arrow-down" /></Select.Option> <Select.Option value="arrow-left"><Icon type="arrow-left" /></Select.Option> <Select.Option value="arrow-right"><Icon type="arrow-right" /></Select.Option> @@ -317,7 +358,7 @@ <Select.Option value="question"><Icon type="question" /></Select.Option> <Select.Option value="fall"><Icon type="fall" /></Select.Option> <Select.Option value="rise"><Icon type="rise" /></Select.Option> - <Select.Option value="link"><Icon type="link" /></Select.Option> + <Select.Option value="link"><Icon type="link" /></Select.Option> */} {/* <Select.Option value="link"></Select.Option> */} </Select> )} @@ -343,7 +384,7 @@ )} </Form.Item> </Col> : null} - <Col span={signType === 'icon' ? 24 : 12} style={{textAlign: 'right', marginBottom: 10}}> + <Col span={signType === 'icon' ? (!selectIcon ? 24 : 18) : 12} style={{textAlign: 'right', marginBottom: 10}}> <Button onClick={this.handleConfirm} type="primary" className="mk-green"> 淇濆瓨 </Button> -- Gitblit v1.8.0