提交 3cd60082 authored 作者: 钟是志's avatar 钟是志

移动端 textarea 组件修改

上级 f252b6c5
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* 测试新表格 * 测试新表格
*/ */
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Card, WhiteSpace } from 'antd-mobile';
import { Row, Col } from 'antd'; import { Row, Col } from 'antd';
import TableCom from '../tableCompon/index'; import TableCom from '../tableCompon/index';
......
...@@ -1471,7 +1471,7 @@ export default class tableCom extends Component { ...@@ -1471,7 +1471,7 @@ export default class tableCom extends Component {
switch (json.viewName) { switch (json.viewName) {
case 'TextArea': case 'TextArea':
cm = ( cm = (
<span> <span style={{ paddingRight: get === 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
...@@ -1488,7 +1488,7 @@ export default class tableCom extends Component { ...@@ -1488,7 +1488,7 @@ export default class tableCom extends Component {
break; break;
case 'Input': case 'Input':
cm = ( cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}> <span style={{ paddingRight: get === 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
...@@ -2288,71 +2288,6 @@ export default class tableCom extends Component { ...@@ -2288,71 +2288,6 @@ export default class tableCom extends Component {
} }
} }
break;
case 'TextArea':
if (get === 'mobile') {
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
})(
<TextArea
autoSize={{ minRows: 4 }}
disabled={disabled}
placeholder={json.placeholder}
/>,
);
/* cm = (
<MobileTextareaItem
{...getFieldProps(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
})}
//disabled={disabled}
style={{ fontSize: 14 }}
clear
autoHeight
// title={<span className={styles.text}>{dataColumn.title}</span>}
placeholder={json.placeholder}
/>
); */
if (
((json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)) &&
title
) {
cm = (
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
);
}
} else {
// console.log(JSON.stringify(this.props.form.getFieldsValue()), '----formValue----');
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
})(
<TextArea
autoSize={{ minRows: 4 }}
disabled={disabled}
rows={4}
placeholder={json.placeholder}
/>,
);
}
break; break;
case 'Switch': case 'Switch':
if (get === 'mobile') { if (get === 'mobile') {
...@@ -2410,7 +2345,55 @@ export default class tableCom extends Component { ...@@ -2410,7 +2345,55 @@ export default class tableCom extends Component {
); );
break; break;
case 'TextArea':
if (get === 'mobile') {
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
})(
<TextArea
autoSize={{ minRows: 4 }}
disabled={disabled}
placeholder={json.placeholder}
/>,
);
cm = <div>{cm}</div>;
if (((json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)) &&
title
) {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</MobileItem>
);
}
} else {
// console.log(JSON.stringify(this.props.form.getFieldsValue()), '----formValue----');
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
})(
<TextArea
autoSize={{ minRows: 4 }}
disabled={disabled}
rows={4}
placeholder={json.placeholder}
/>,
);
}
break;
case 'Input': case 'Input':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
...@@ -2425,7 +2408,7 @@ export default class tableCom extends Component { ...@@ -2425,7 +2408,7 @@ export default class tableCom extends Component {
placeholder={json.placeholder} placeholder={json.placeholder}
/>, />,
); );
if (get == 'mobile') { if (get === 'mobile') {
cm = <div>{cm}</div>; cm = <div>{cm}</div>;
if ( if (
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论