From 1fa9bbd032749dc07f98d21b7403b041053d0bed Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 25 三月 2024 10:29:19 +0800 Subject: [PATCH] 2024-03-25 --- src/menu/components/card/cardcellcomponent/elementform/index.jsx | 68 ++++++++++++++++++++++++--------- 1 files changed, 49 insertions(+), 19 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index dee9a31..f4f8214 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Popover } from 'antd' +import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Popover, message } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' @@ -421,24 +421,45 @@ </Col> ) } else if (item.type === 'number') { - fields.push( - <Col span={12} key={index}> - <Form.Item help={item.help || null} label={item.tooltip ? - <Tooltip placement="topLeft" title={item.tooltip}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [{ - required: item.readonly ? false : !!item.required, - message: '璇疯緭鍏�' + item.label + '!' - }] - })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} - </Form.Item> - </Col> - ) + if (item.help) { + fields.push( + <Col span={12} key={index}> + <Form.Item help={item.help} label={item.tooltip ? + <Tooltip placement="topLeft" title={item.tooltip}> + <QuestionCircleOutlined className="mk-form-tip" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: item.initVal, + rules: [{ + required: item.readonly ? false : !!item.required, + message: '璇疯緭鍏�' + item.label + '!' + }] + })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> + ) + } else { + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" title={item.tooltip}> + <QuestionCircleOutlined className="mk-form-tip" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: item.initVal, + rules: [{ + required: item.readonly ? false : !!item.required, + message: '璇疯緭鍏�' + item.label + '!' + }] + })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> + ) + } } else if (item.type === 'select') { // 涓嬫媺鎼滅储 fields.push( <Col span={12} key={index}> @@ -649,6 +670,15 @@ }) } + if (values.width === 0) { + let utype = {picture: '鍥剧墖', video: '瑙嗛', slider: '杩涘害鏉�', splitline: '鍒嗗壊绾�', barcode: '鏉″舰鐮�', qrcode: '浜岀淮鐮�'} + + if (utype[values.eleType]) { + message.warning(utype[values.eleType] + '鍏冪礌瀹藉害涓嶅彲涓�0锛�') + return + } + } + resolve(values) } else { reject(err) -- Gitblit v1.8.0