From 888095418c902cc94693cba8b45f31bb79cdf818 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 28 二月 2020 01:31:46 +0800 Subject: [PATCH] 2020-02-28 --- src/templates/formtabconfig/settingform/index.jsx | 47 ++++++++++++++--------------------------------- 1 files changed, 14 insertions(+), 33 deletions(-) diff --git a/src/templates/formtabconfig/settingform/index.jsx b/src/templates/formtabconfig/settingform/index.jsx index b469fbf..94dfa77 100644 --- a/src/templates/formtabconfig/settingform/index.jsx +++ b/src/templates/formtabconfig/settingform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification } from 'antd' +import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification, InputNumber } from 'antd' import { formRule } from '@/utils/option.js' import './index.scss' @@ -18,7 +18,6 @@ interType: (this.props.config.setting && this.props.config.setting.interType) || 'inner', columns: null, interReadonly: false, - primaryKey: '' } UNSAFE_componentWillMount() { @@ -50,28 +49,12 @@ }) } - let primaryKey = _setting.primaryKey - if (primaryKey) { - let field = _columns.filter(column => column.field === primaryKey) - if (field.length !== 1) { - primaryKey = '' - } - } - if (!primaryKey) { - _columns.forEach(col => { - if (col.field.toLowerCase() === 'id') { - primaryKey = col.field - } - }) - } - this.setState({ columns: _columns, setting: _setting, interType: _setting.interType || 'inner', interReadonly: _setting.sysInterface === 'true', - datatype: _setting.datatype || 'maintable', - primaryKey: primaryKey + datatype: _setting.datatype || 'maintable' }) } @@ -152,7 +135,7 @@ render() { const { dict, usefulFields, menu } = this.props const { getFieldDecorator } = this.props.form - const { interType, columns, setting, datatype, primaryKey } = this.state + const { interType, setting, datatype } = this.state const formItemLayout = { labelCol: { @@ -213,22 +196,13 @@ )} </Form.Item> </Col> - {datatype === 'query' ? <Col span={12}> + <Col span={12}> <Form.Item label="涓婚敭"> {getFieldDecorator('primaryKey', { - initialValue: primaryKey || '' - })( - <Select - getPopupContainer={() => document.getElementById('commontable-setting-form')} - > - <Select.Option key='unset' value="">鏈缃�</Select.Option> - {columns.map((option, index) => - <Select.Option id={option.uuid} title={option.label} key={index} value={option.field}>{option.label}</Select.Option> - )} - </Select> - )} + initialValue: setting.primaryKey + })(<Input placeholder="" autoComplete="off" disabled/>)} </Form.Item> - </Col> : null} + </Col> {datatype === 'query' ? <Col span={12}> <Form.Item label={dict['header.form.intertype']}> {getFieldDecorator('interType', { @@ -319,6 +293,13 @@ })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> : null} + <Col span={12}> + <Form.Item label="瀹藉害"> + {getFieldDecorator('width', { + initialValue: setting.width || 100 + })(<InputNumber min={10} max={100} precision={0} />)} + </Form.Item> + </Col> </Row> </Form> ) -- Gitblit v1.8.0