| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, InputNumber, Select, Radio } from 'antd' |
| | | import { Form, Row, Col, Input, InputNumber, Select, Radio, Tooltip, Icon } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import TransferForm from '@/templates/zshare/transferform' |
| | | import './index.scss' |
| | |
| | | if (_form && _form.select) { |
| | | _form.select() |
| | | } |
| | | } catch { |
| | | } catch (e) { |
| | | console.warn('表单focus失败!') |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['model.name']}> |
| | | {getFieldDecorator('label', { |
| | | initialValue: this.props.card.label, |
| | | initialValue: card.label, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['model.form.align']}> |
| | | {getFieldDecorator('Align', { |
| | | initialValue: this.props.card.Align, |
| | | initialValue: card.Align, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['model.form.columnWidth']}> |
| | | {getFieldDecorator('Width', { |
| | | initialValue: this.props.card.Width, |
| | | initialValue: card.Width, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="选择显示分组,表格会展开添加分组的子列,此时排列方式会失效。"> |
| | | <Icon type="question-circle" /> |
| | | 显示分组 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('unfold', { |
| | | initialValue: card.unfold || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">{this.props.dict['model.true']}</Radio> |
| | | <Radio value="false">{this.props.dict['model.false']}</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['model.hidden']}> |
| | | {getFieldDecorator('Hide', { |
| | | initialValue: this.props.card.Hide || 'false', |
| | | initialValue: card.Hide || 'false', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['header.form.order']}> |
| | | {getFieldDecorator('order', { |
| | | initialValue: this.props.card.order, |
| | | initialValue: card.order, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Select |
| | | getPopupContainer={() => document.getElementById('columncolspan')} |
| | | > |
| | | <Select getPopupContainer={() => document.getElementById('columncolspan')} > |
| | | <Select.Option value="vertical">{this.props.dict['header.form.vertical']}</Select.Option> |
| | | <Select.Option value="horizontal">{this.props.dict['header.form.horizontal']}</Select.Option> |
| | | <Select.Option value="vertical2">{this.props.dict['header.form.vertical2']}</Select.Option> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <TransferForm columns={this.props.columns} ref="column-transfer" selected={this.props.card.sublist}/> |
| | | <TransferForm columns={this.props.columns} ref="column-transfer" selected={card.sublist}/> |
| | | </Col> |
| | | </Row> |
| | | </Form> |