提交 b6eb7035 authored 作者: 徐立's avatar 徐立

修复bug

上级 5303e940
......@@ -134,10 +134,13 @@ export default class isNewTable extends Component {
return (
<Col
style={{
display: ary.content && (ary.content.comName === 'InputHidden'||ary.content.isMobileHidden) && 'none',
display:
ary.content &&
(ary.content.comName === 'InputHidden' || ary.content.isMobileHidden) &&
'none',
...styles,
}}
span={ary.content?.labelSpan||24}
span={ary.content?.labelSpan || 24}
>
{!allhidden && ary.hidden ? (
''
......@@ -255,7 +258,11 @@ export default class isNewTable extends Component {
width: '100%',
height: '100%',
...styles,
display: ary.content && (ary.content.comName === 'InputHidden'||ary.content.isMobileHidden)&& 'none',
display:
ary.content &&
(ary.content.comName === 'InputHidden' ||
ary.content.isMobileHidden) &&
'none',
}}
>
<TableCom
......@@ -296,7 +303,10 @@ export default class isNewTable extends Component {
<Card.Body
style={{
// textAlign:ary.content&&ary.content.comName === 'Table'?"left":'right'
display: ary.content && (ary.content.comName === 'InputHidden'||ary.content.isMobileHidden) && 'none',
display:
ary.content &&
(ary.content.comName === 'InputHidden' || ary.content.isMobileHidden) &&
'none',
}}
>
{' '}
......
/**
* @file 移动端 Row,Col二次封装
*/
import React, { Component } from 'react';
import { Row, Col } from 'antd';
export default class MobileItem extends Component {
render() {
const { labelCol, wrapperCol, label } = this.props;
return (
<Row>
<Col
style={{
minHeight: 32,
}}
span={labelCol.span ? labelCol.span : labelCol}
>
{label}
</Col>
<Col
span={wrapperCol.span ? wrapperCol.span : wrapperCol}
style={{
minHeight: 32,
}}
>
{this.props.children}
</Col>
</Row>
);
}
}
......@@ -73,6 +73,7 @@ import { getToken } from '../utils/token';
import { formulaList } from '../excelInitFuc/functionList';
import FilePreview from '../filePreview';
import DraftEditorCom from '../App/DraftEditorCom';
import MobileItem from './MobileItem';
const Item = MobileList.Item;
const Brief = Item.Brief;
function getBase64(value) {
......@@ -414,9 +415,9 @@ export default class tableCom extends Component {
onFilter: (value, record) =>
record[dataIndex]
? record[dataIndex]
.toString()
.toLowerCase()
.includes(value.toLowerCase())
.toString()
.toLowerCase()
.includes(value.toLowerCase())
: '',
onFilterDropdownVisibleChange: visible => {
if (visible) {
......@@ -489,7 +490,7 @@ export default class tableCom extends Component {
if (this.count.length > 10) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
);
return;
......@@ -511,9 +512,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null)
......@@ -753,7 +754,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -809,7 +810,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
//message.error(`页面${this.props.formKey}第${this.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误${e}`, 10)
......@@ -823,7 +824,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -835,7 +836,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -884,7 +885,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -897,7 +898,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -909,7 +910,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -960,7 +961,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -973,7 +974,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -985,7 +986,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1040,7 +1041,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1053,7 +1054,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1065,7 +1066,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1183,7 +1184,7 @@ export default class tableCom extends Component {
} catch {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,函数内部错误,`,
1}列:公式配置有误,函数内部错误,`,
e,
);
}
......@@ -1193,7 +1194,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,暂存失败,`,
1}列:公式配置有误,暂存失败,`,
e,
);
}
......@@ -1220,9 +1221,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null)
......@@ -1599,8 +1600,8 @@ export default class tableCom extends Component {
{get === 'mobile' ? <br /> : ''}
</span>
) : (
''
);
''
);
break;
case 'UploadCom':
......@@ -1653,8 +1654,10 @@ export default class tableCom extends Component {
break;
}
if (get === 'mobile') {
if ((json.isMobileLabel != null && json.isMobileLabel) || (json.isMobileLabel == null && json.isLabel)) {
if (
(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)
) {
if (obj && obj.defaultValues && obj.defaultValues[formKey]) {
if (!isEdit) {
return (
......@@ -1703,8 +1706,8 @@ export default class tableCom extends Component {
</span>
</>
) : (
''
)}
''
)}
</Col>
<Col
span={json.wrapperSpan}
......@@ -1721,33 +1724,30 @@ export default class tableCom extends Component {
);
} else {
return (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm}
</Form.Item>
</MobileItem>
);
}
} else {
return (
<>
<Form.Item
return (
<>
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm}
</Form.Item>
</MobileItem>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden" />)}
</>
);
);
}
} else {
if (!isEdit && obj.defaultValues && obj.defaultValues[formKey]) {
......@@ -1763,8 +1763,6 @@ export default class tableCom extends Component {
);
}
}
} else {
if (json.isLabel) {
if (obj && obj.defaultValues && obj.defaultValues[formKey]) {
......@@ -1799,7 +1797,7 @@ export default class tableCom extends Component {
}}
>
:
</span>
</span>
</>
) : sqlData[key] ? (
<>
......@@ -1812,11 +1810,11 @@ export default class tableCom extends Component {
}}
>
:
</span>
</span>
</>
) : (
''
)}
''
)}
</Col>
<Col
span={json.wrapperSpan}
......@@ -1873,7 +1871,6 @@ export default class tableCom extends Component {
}
}
}
}
var cm;
......@@ -1884,9 +1881,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
......@@ -1992,18 +1989,18 @@ export default class tableCom extends Component {
<span>
{labels != null
? labels.map((r, i) =>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
Object.values(r)
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
',' + Object.values(r)
),
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
',' + Object.values(r)
),
)
: ''}
</span>
);
......@@ -2081,8 +2078,8 @@ export default class tableCom extends Component {
<span>
{obj[dataColumn.base52]
? moment(+new Date(obj[dataColumn.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
: ''}
</span>
);
......@@ -2196,11 +2193,11 @@ export default class tableCom extends Component {
height={json.height}
/>
) : (
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
/>
);
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
/>
);
}
break;
......@@ -2407,7 +2404,7 @@ export default class tableCom extends Component {
}
>
{(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)
(json.isMobileLabel == null && json.isLabel)
? title
: ''}
</MobileList.Item>
......@@ -2453,13 +2450,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
}
......@@ -2494,13 +2491,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
}
......@@ -2525,13 +2522,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
}
......@@ -2560,13 +2557,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
......@@ -2601,25 +2598,25 @@ export default class tableCom extends Component {
getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div')
? () => {
return document.querySelector('#dynamic_div');
}
return document.querySelector('#dynamic_div');
}
: ''
}
onFocus={() => {
get === 'mobile' // 移动端取消输入键盘弹出
? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
: null;
}}
filterOption={(input, option) =>
......@@ -2630,10 +2627,10 @@ export default class tableCom extends Component {
>
{options
? options.map(r => (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
: ''}
</Select>,
);
......@@ -2644,13 +2641,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
} else if (get === 'mobile') {
cm = <div>{cm}</div>;
......@@ -2665,22 +2662,22 @@ export default class tableCom extends Component {
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
validator: (rule, value, callback) => {
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
var errors = [];
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
{
validator: (rule, value, callback) => {
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
var errors = [];
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
},
required: required,
},
required: required,
},
],
],
})(
<TableSelect
get={get}
......@@ -2698,13 +2695,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -2747,13 +2744,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -2794,21 +2791,21 @@ export default class tableCom extends Component {
onOpenChange={
get === 'mobile'
? () => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly');
setTimeout(() => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.removeAttribute('readonly');
});
}
});
}
: () => { }
.setAttribute('readonly', 'readonly');
setTimeout(() => {
document
.querySelector('.ant-calendar-input ')
.removeAttribute('readonly');
});
}
});
}
: () => {}
}
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
/>,
......@@ -2820,13 +2817,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -2860,13 +2857,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -2885,13 +2882,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -2918,13 +2915,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -2958,13 +2955,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -2983,13 +2980,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -3017,13 +3014,13 @@ export default class tableCom extends Component {
title
) {
cm = (
<Form.Item
<MobileItem
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</Form.Item>
</MobileItem>
);
}
break;
......@@ -3087,8 +3084,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
<Card.Header title={<span style={{ fontSize: 14 }}>{title}:</span>} />
<Card.Body>{cm}</Card.Body>
</Card>
......@@ -3166,8 +3163,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
</Row>
);
} else {
......@@ -3200,8 +3197,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
......@@ -3242,8 +3239,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
{cm}
</>
);
......@@ -3278,8 +3275,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
<Form.Item>{cm}</Form.Item>
</>
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论