From c7aece35a62b6e91fd98a625bf0e53f64bfbd18d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 17 八月 2023 16:22:15 +0800 Subject: [PATCH] 2023-08-17 --- src/templates/sharecomponent/columncomponent/colspanform/index.jsx | 103 +++++++++++++++++++++++++++------------------------ 1 files changed, 54 insertions(+), 49 deletions(-) diff --git a/src/templates/sharecomponent/columncomponent/colspanform/index.jsx b/src/templates/sharecomponent/columncomponent/colspanform/index.jsx index 2364967..788acdd 100644 --- a/src/templates/sharecomponent/columncomponent/colspanform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/colspanform/index.jsx @@ -1,13 +1,14 @@ 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 } from 'antd' +import { QuestionCircleOutlined } from '@ant-design/icons' + import { formRule } from '@/utils/option.js' import TransferForm from '@/templates/zshare/transferform' -import './index.scss' +// import './index.scss' class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� columns: PropTypes.array, card: PropTypes.any, inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -19,7 +20,7 @@ if (_form && _form.select) { _form.select() } - } catch { + } catch (e) { console.warn('琛ㄥ崟focus澶辫触锛�') } } @@ -62,6 +63,7 @@ } render() { + const { card } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -74,16 +76,16 @@ } } return ( - <Form {...formItemLayout} className="commontable-cospan-column-form" id="columncolspan"> + <Form {...formItemLayout} style={{minHeight: '190px'}} id="columncolspan"> <Row gutter={24}> <Col span={12}> - <Form.Item label={this.props.dict['model.name']}> + <Form.Item label="鍚嶇О"> {getFieldDecorator('label', { - initialValue: this.props.card.label, + initialValue: card.label, rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.name'] + '!' + message: '璇疯緭鍏ュ悕绉�!' }, { max: formRule.input.max, @@ -94,95 +96,98 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['model.form.type']}> + <Form.Item label="绫诲瀷"> {getFieldDecorator('type', { - initialValue: this.props.dict['model.form.colspan'], - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.form.type'] + '!' - } - ] + initialValue: '鍚堝苟鍒�' })(<Input placeholder="" autoComplete="off" disabled={true}/>)} </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['model.form.align']}> + <Form.Item label="瀵归綈鏂瑰紡"> {getFieldDecorator('Align', { - initialValue: this.props.card.Align, + initialValue: card.Align, rules: [ { required: true, - message: this.props.dict['form.required.select'] + this.props.dict['model.form.align'] + '!' + message: '璇烽�夋嫨瀵归綈鏂瑰紡!' } ] })( <Select getPopupContainer={() => document.getElementById('columncolspan')} > - <Select.Option value="left">{this.props.dict['model.form.alignLeft']}</Select.Option> - <Select.Option value="right">{this.props.dict['model.form.alignRight']}</Select.Option> - <Select.Option value="center">{this.props.dict['model.form.alignCenter']}</Select.Option> + <Select.Option value="left">宸﹀榻�</Select.Option> + <Select.Option value="right">鍙冲榻�</Select.Option> + <Select.Option value="center">灞呬腑</Select.Option> </Select> )} </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['model.form.columnWidth']}> + <Form.Item label="鍒楀"> {getFieldDecorator('Width', { - initialValue: this.props.card.Width, + initialValue: card.Width, rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.form.columnWidth'] + '!' + message: '璇疯緭鍏ュ垪瀹�!' } ] - })(<InputNumber min={1} max={1000} precision={0} />)} + })(<InputNumber min={1} max={1000} precision={0} onPressEnter={this.handleSubmit} />)} </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['model.hidden']}> - {getFieldDecorator('Hide', { - initialValue: this.props.card.Hide || 'false', - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + this.props.dict['model.hidden'] + '!' - } - ] + <Form.Item label={ + <Tooltip placement="topLeft" title="閫夋嫨鏄剧ず鍒嗙粍锛岃〃鏍间細灞曞紑娣诲姞鍒嗙粍鐨勫瓙鍒楋紝姝ゆ椂鎺掑垪鏂瑰紡浼氬け鏁堛��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鏄剧ず鍒嗙粍 + </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 value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group> )} </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['header.form.order']}> + <Form.Item label="闅愯棌"> + {getFieldDecorator('Hide', { + initialValue: card.Hide || 'false' + })( + <Radio.Group> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鎺掑垪"> {getFieldDecorator('order', { - initialValue: this.props.card.order, + initialValue: card.order, rules: [ { required: true, - message: this.props.dict['form.required.select'] + this.props.dict['header.form.order'] + '!' + message: '璇烽�夋嫨鎺掑垪鏂瑰紡!' } ] })( - <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> - <Select.Option value="topPicBottomText">{this.props.dict['header.form.topPicBottomText']}</Select.Option> - <Select.Option value="leftPicRightText">{this.props.dict['header.form.leftPicRightText']}</Select.Option> + <Select getPopupContainer={() => document.getElementById('columncolspan')} > + <Select.Option value="vertical">绾靛悜</Select.Option> + <Select.Option value="horizontal">妯悜</Select.Option> + <Select.Option value="vertical2">绾靛悜(2鍒�)</Select.Option> + <Select.Option value="topPicBottomText">涓婂浘涓嬫枃</Select.Option> + <Select.Option value="leftPicRightText">宸﹀浘鍙虫枃</Select.Option> </Select> )} </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> -- Gitblit v1.8.0