| | |
| | | |
| | | componentDidMount () { |
| | | this.loadHomeConfig() |
| | | if (this.props.permMenus.length > 0 && JSON.stringify(this.props.permAction) !== '{}') { |
| | | this.setState({ |
| | | waiting: false |
| | | }) |
| | | } |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Button, Input, InputNumber, Radio } from 'antd' |
| | | import { Form, Row, Col, Button, Input, InputNumber } from 'antd' |
| | | import './index.scss' |
| | | |
| | | class ExcelOutColumn extends Component { |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form"> |
| | | <Row gutter={24}> |
| | | <Col span={5}> |
| | | <Col span={7}> |
| | | <Form.Item label={dict['model.form.field']}> |
| | | {getFieldDecorator('Column', { |
| | | initialValue: '', |
| | |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={5}> |
| | | <Col span={7}> |
| | | <Form.Item label={dict['model.name']}> |
| | | {getFieldDecorator('Text', { |
| | | initialValue: '', |
| | |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={5}> |
| | | <Col span={7}> |
| | | <Form.Item label={dict['model.form.columnWidth']}> |
| | | {getFieldDecorator('Width', { |
| | | initialValue: 20, |
| | |
| | | })(<InputNumber min={5} max={200} precision={0} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={5}> |
| | | {/* <Col span={5}> |
| | | <Form.Item label="类型"> |
| | | {getFieldDecorator('type', { |
| | | initialValue: 'text' |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={4} className="add"> |
| | | </Col> */} |
| | | <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="mk-green"> |
| | | 添加 |
| | | </Button> |
| | |
| | | inputType: 'input', |
| | | editable: true, |
| | | unique: true, |
| | | width: '20%' |
| | | width: '25%' |
| | | }, |
| | | { |
| | | title: this.props.dict['model.name'], |
| | | dataIndex: 'Text', |
| | | inputType: 'input', |
| | | editable: true, |
| | | width: '20%' |
| | | width: '25%' |
| | | }, |
| | | { |
| | | title: this.props.dict['model.form.columnWidth'], |
| | |
| | | min: 5, |
| | | max: 200, |
| | | editable: true, |
| | | width: '20%' |
| | | width: '25%' |
| | | }, |
| | | { |
| | | title: '类型', |
| | | dataIndex: 'type', |
| | | inputType: 'select', |
| | | editable: true, |
| | | required: false, |
| | | width: '20%', |
| | | render: (text) => { |
| | | if (text === 'image') { |
| | | return '图片' |
| | | } else { |
| | | return '文本' |
| | | } |
| | | }, |
| | | options: [ |
| | | {value: 'text', text: '文本'}, |
| | | {value: 'image', text: '图片'} |
| | | ] |
| | | }, |
| | | // { |
| | | // title: '类型', |
| | | // dataIndex: 'type', |
| | | // inputType: 'select', |
| | | // editable: true, |
| | | // required: false, |
| | | // width: '20%', |
| | | // render: (text) => { |
| | | // if (text === 'image') { |
| | | // return '图片' |
| | | // } else { |
| | | // return '文本' |
| | | // } |
| | | // }, |
| | | // options: [ |
| | | // {value: 'text', text: '文本'}, |
| | | // {value: 'image', text: '图片'} |
| | | // ] |
| | | // }, |
| | | { |
| | | title: '取绝对值', |
| | | dataIndex: 'abs', |
| | | inputType: 'select', |
| | | editable: true, |
| | | required: false, |
| | | width: '20%', |
| | | width: '25%', |
| | | render: (text) => { |
| | | if (text === 'true') { |
| | | return '是' |
| | |
| | | if (card.intertype !== 'system') { |
| | | _verify.enable = 'false' |
| | | } |
| | | if (_verify.columns[0] && !_verify.columns[0].type) { |
| | | _verify.columns = _verify.columns.map(col => { |
| | | col.type = col.type || 'text' |
| | | return col |
| | | }) |
| | | } |
| | | // if (_verify.columns[0] && !_verify.columns[0].type) { |
| | | // _verify.columns = _verify.columns.map(col => { |
| | | // col.type = col.type || 'text' |
| | | // return col |
| | | // }) |
| | | // } |
| | | |
| | | let defaultscript = '' |
| | | if (!_verify.script && card.intertype === 'system') { |
| | |
| | | Text: item.label, |
| | | Width: 20, |
| | | abs: 'false', |
| | | type: 'text', |
| | | // type: 'text', |
| | | uuid: Utils.getuuid() |
| | | }) |
| | | }) |