提交 8626d8b7 authored 作者: 钟是志's avatar 钟是志

优化wangEditor

上级 4f85d7ee
...@@ -97,7 +97,7 @@ export function requestFileInfo(url, datas) { ...@@ -97,7 +97,7 @@ export function requestFileInfo(url, datas) {
}); });
return false; return false;
} }
console.log(res.status); // console.log(res.status);
return res.json(); return res.json();
}) })
.then(res => { .then(res => {
......
...@@ -82,12 +82,7 @@ const giveRender = (column = {}) => { ...@@ -82,12 +82,7 @@ const giveRender = (column = {}) => {
return column; return column;
}; };
@connect(({ @connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
DataColumn,
SqlManageEntity,
formList,
loading,
}) => ({
DataColumn, DataColumn,
SqlManageEntity, SqlManageEntity,
formList, formList,
...@@ -159,7 +154,7 @@ export default class tableCom extends Component { ...@@ -159,7 +154,7 @@ export default class tableCom extends Component {
file = { file = {
name: 'file', name: 'file',
action: queryApiActionPath() + '/upload', action: queryApiActionPath() + '/upload',
onChange: info => { onChange: (info) => {
if (info.file.status !== 'uploading') { if (info.file.status !== 'uploading') {
this.setState({ this.setState({
img: info.file.response, img: info.file.response,
...@@ -180,7 +175,7 @@ export default class tableCom extends Component { ...@@ -180,7 +175,7 @@ export default class tableCom extends Component {
this.setState({ searchText: selectedKeys[0] }); this.setState({ searchText: selectedKeys[0] });
}; };
handleReset = clearFilters => { handleReset = (clearFilters) => {
clearFilters(); clearFilters();
this.resetSearchText(); this.resetSearchText();
}; };
...@@ -192,20 +187,15 @@ export default class tableCom extends Component { ...@@ -192,20 +187,15 @@ export default class tableCom extends Component {
}; };
getColumnSearchProps = (dataIndex, title) => ({ getColumnSearchProps = (dataIndex, title) => ({
filterDropdown: ({ filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
setSelectedKeys,
selectedKeys,
confirm,
clearFilters,
}) => (
<div style={{ padding: 8 }}> <div style={{ padding: 8 }}>
<Input <Input
ref={node => { ref={(node) => {
this.searchInput = node; this.searchInput = node;
}} }}
placeholder={`请输入${title}`} placeholder={`请输入${title}`}
value={selectedKeys[0]} value={selectedKeys[0]}
onChange={e => setSelectedKeys(e.target.value ? [e.target.value] : [])} onChange={(e) => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onPressEnter={() => this.handleSearch(selectedKeys, confirm)} onPressEnter={() => this.handleSearch(selectedKeys, confirm)}
style={{ style={{
width: 188, width: 188,
...@@ -214,29 +204,29 @@ export default class tableCom extends Component { ...@@ -214,29 +204,29 @@ export default class tableCom extends Component {
}} }}
/> />
<Button <Button
type='primary' type="primary"
onClick={() => this.handleSearch(selectedKeys, confirm)} onClick={() => this.handleSearch(selectedKeys, confirm)}
icon='search' icon="search"
loading={this.props.loading} loading={this.props.loading}
size='small' size="small"
style={{ style={{
width: 90, width: 90,
marginRight: 8, marginRight: 8,
}} }}>
>
搜索 搜索
</Button> </Button>
<Button <Button
loading={this.props.loading} loading={this.props.loading}
onClick={() => this.handleReset(clearFilters)} onClick={() => this.handleReset(clearFilters)}
size='small' size="small"
style={{ width: 90 }} style={{ width: 90 }}>
>
重置 重置
</Button> </Button>
</div> </div>
), ),
filterIcon: filtered => <Icon type='search' style={{ color: filtered ? '#1890ff' : 'red' }} />, filterIcon: (filtered) => (
<Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }} />
),
onFilter: (value, record) => onFilter: (value, record) =>
record[dataIndex] record[dataIndex]
? record[dataIndex] ? record[dataIndex]
...@@ -244,12 +234,12 @@ export default class tableCom extends Component { ...@@ -244,12 +234,12 @@ export default class tableCom extends Component {
.toLowerCase() .toLowerCase()
.includes(value.toLowerCase()) .includes(value.toLowerCase())
: '', : '',
onFilterDropdownVisibleChange: visible => { onFilterDropdownVisibleChange: (visible) => {
if (visible) { if (visible) {
setTimeout(() => this.searchInput.select()); setTimeout(() => this.searchInput.select());
} }
}, },
render: text => { render: (text) => {
if (text != null) { if (text != null) {
return ( return (
<Highlighter <Highlighter
...@@ -284,11 +274,7 @@ export default class tableCom extends Component { ...@@ -284,11 +274,7 @@ export default class tableCom extends Component {
}; };
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
const { const { json, mapData, obj } = props;
json,
mapData,
obj,
} = props;
if (json == null || this.props.safe) { if (json == null || this.props.safe) {
return; return;
} }
...@@ -406,21 +392,18 @@ export default class tableCom extends Component { ...@@ -406,21 +392,18 @@ export default class tableCom extends Component {
allValues = JSON.stringify(allValues); allValues = JSON.stringify(allValues);
if (json.comName === 'TableSelect') { if (json.comName === 'TableSelect') {
const { dispatch } = this.props; const { dispatch } = this.props;
const { const { sqlKey, optionType } = json;
sqlKey,
optionType,
} = json;
if (optionType === 'sql') { if (optionType === 'sql') {
dispatch({ dispatch({
type: 'SqlManageEntity/find', type: 'SqlManageEntity/find',
payload: { sqlKey }, payload: { sqlKey },
callback: sqlModel => { callback: (sqlModel) => {
this.setState({ sqlModel }); this.setState({ sqlModel });
if (sqlModel.dataObjId) { if (sqlModel.dataObjId) {
dispatch({ dispatch({
type: 'formList/getHead', type: 'formList/getHead',
payload: { dataObjId: sqlModel.dataObjId }, payload: { dataObjId: sqlModel.dataObjId },
callback: datas => { callback: (datas) => {
if (datas) { if (datas) {
const columns = []; const columns = [];
for (var i = 0; i < datas.length; i++) { for (var i = 0; i < datas.length; i++) {
...@@ -431,8 +414,7 @@ export default class tableCom extends Component { ...@@ -431,8 +414,7 @@ export default class tableCom extends Component {
if ( if (
['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type) ['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)
) { ) {
column.render = val => moment(val) column.render = (val) => moment(val).format('YYYY-MM-DD HH:mm:ss');
.format('YYYY-MM-DD HH:mm:ss');
} }
column = giveRender(column); column = giveRender(column);
...@@ -469,8 +451,7 @@ export default class tableCom extends Component { ...@@ -469,8 +451,7 @@ export default class tableCom extends Component {
break; break;
} }
column.render = val => moment(parseInt(val)) column.render = (val) => moment(parseInt(val)).format(ff);
.format(ff);
} }
if (cll[k].isQuery) { if (cll[k].isQuery) {
column = { column = {
...@@ -493,7 +474,7 @@ export default class tableCom extends Component { ...@@ -493,7 +474,7 @@ export default class tableCom extends Component {
sqlKey, sqlKey,
allValues, allValues,
}, },
callback: list => { callback: (list) => {
const x = { const x = {
list: list, list: list,
pagination: false, pagination: false,
...@@ -508,7 +489,7 @@ export default class tableCom extends Component { ...@@ -508,7 +489,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'formList/getHead', type: 'formList/getHead',
payload: { dataObjId: dataColumn.referenceObjId }, payload: { dataObjId: dataColumn.referenceObjId },
callback: datas => { callback: (datas) => {
if (datas) { if (datas) {
const columns = []; const columns = [];
for (var i = 0; i < datas.length; i++) { for (var i = 0; i < datas.length; i++) {
...@@ -517,8 +498,7 @@ export default class tableCom extends Component { ...@@ -517,8 +498,7 @@ export default class tableCom extends Component {
column.title = datas[i].title; column.title = datas[i].title;
column.dataIndex = datas[i].name; column.dataIndex = datas[i].name;
if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) { if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) {
column.render = val => moment(val) column.render = (val) => moment(val).format('YYYY-MM-DD HH:mm:ss');
.format('YYYY-MM-DD HH:mm:ss');
} }
column = giveRender(column); column = giveRender(column);
columns.push(column); columns.push(column);
...@@ -768,7 +748,7 @@ export default class tableCom extends Component { ...@@ -768,7 +748,7 @@ export default class tableCom extends Component {
} }
// const newData = giveFilePostDataInfoForTrue(params,url); // const newData = giveFilePostDataInfoForTrue(params,url);
noPrefixRequest(url, params).then(data => { noPrefixRequest(url, params).then((data) => {
// if (!data || !Array.isArray(data)) { // if (!data || !Array.isArray(data)) {
// data = []; // data = [];
// } // }
...@@ -959,8 +939,7 @@ export default class tableCom extends Component { ...@@ -959,8 +939,7 @@ export default class tableCom extends Component {
if (getToken() != null) { if (getToken() != null) {
pp.token = getToken(); pp.token = getToken();
} }
uaaRequest(url, pp) uaaRequest(url, pp).then((data) => {
.then(data => {
const { sqlKeys } = this.state; const { sqlKeys } = this.state;
sqlKeys[sqlKey].data = data; sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys }); this.setState({ sqlKeys });
...@@ -1041,8 +1020,8 @@ export default class tableCom extends Component { ...@@ -1041,8 +1020,8 @@ export default class tableCom extends Component {
* 动态生成表单配置函数所使用 * 动态生成表单配置函数所使用
*/ */
let functionObj = {}; let functionObj = {};
formulaList.map(item => { formulaList.map((item) => {
item.children.map(arr => { item.children.map((arr) => {
functionObj[arr.callKey] = arr.function; functionObj[arr.callKey] = arr.function;
}); });
}); });
...@@ -1163,12 +1142,7 @@ export default class tableCom extends Component { ...@@ -1163,12 +1142,7 @@ export default class tableCom extends Component {
}; };
componentDidMount() { componentDidMount() {
const { const { json, mapData, obj, init } = this.props;
json,
mapData,
obj,
init,
} = this.props;
if (json == null) { if (json == null) {
return; return;
} }
...@@ -1177,7 +1151,7 @@ export default class tableCom extends Component { ...@@ -1177,7 +1151,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'SqlManageEntity/find', type: 'SqlManageEntity/find',
payload: { sqlKey: json.sqlKey }, payload: { sqlKey: json.sqlKey },
callback: res => { callback: (res) => {
this.setState({ sqlContent: res.sql }); this.setState({ sqlContent: res.sql });
}, },
}); });
...@@ -1223,7 +1197,7 @@ export default class tableCom extends Component { ...@@ -1223,7 +1197,7 @@ export default class tableCom extends Component {
allValues, allValues,
isMeta, isMeta,
}, },
callback: options => { callback: (options) => {
const optionsx = []; const optionsx = [];
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52]; let vl = this.props.form.getFieldsValue()[base52];
...@@ -1265,7 +1239,7 @@ export default class tableCom extends Component { ...@@ -1265,7 +1239,7 @@ export default class tableCom extends Component {
allValues, allValues,
isMeta, isMeta,
}, },
callback: labels => { callback: (labels) => {
this.setState({ this.setState({
labels, labels,
selectDis: false, selectDis: false,
...@@ -1281,7 +1255,7 @@ export default class tableCom extends Component { ...@@ -1281,7 +1255,7 @@ export default class tableCom extends Component {
allValues, allValues,
isMeta, isMeta,
}, },
callback: options => { callback: (options) => {
// console.log(options); // console.log(options);
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52]; let vl = this.props.form.getFieldsValue()[base52];
...@@ -1363,7 +1337,7 @@ export default class tableCom extends Component { ...@@ -1363,7 +1337,7 @@ export default class tableCom extends Component {
filterSql, filterSql,
allValues, allValues,
}, },
callback: options => { callback: (options) => {
const optionsx = []; const optionsx = [];
for (var i = 0; i < options.length; i++) { for (var i = 0; i < options.length; i++) {
optionsx.push({ optionsx.push({
...@@ -1387,7 +1361,7 @@ export default class tableCom extends Component { ...@@ -1387,7 +1361,7 @@ export default class tableCom extends Component {
filterSql, filterSql,
allValues, allValues,
}, },
callback: labels => { callback: (labels) => {
this.setState({ this.setState({
labels, labels,
selectDis: false, selectDis: false,
...@@ -1403,7 +1377,7 @@ export default class tableCom extends Component { ...@@ -1403,7 +1377,7 @@ export default class tableCom extends Component {
filterSql, filterSql,
allValues, allValues,
}, },
callback: options => { callback: (options) => {
const optionsx = []; const optionsx = [];
for (var i = 0; i < options.length; i++) { for (var i = 0; i < options.length; i++) {
optionsx.push({ optionsx.push({
...@@ -1419,11 +1393,8 @@ export default class tableCom extends Component { ...@@ -1419,11 +1393,8 @@ export default class tableCom extends Component {
}); });
} }
}; };
getColumn = key => { getColumn = (key) => {
let { let { mapData, json } = this.props;
mapData,
json,
} = this.props;
const columnIds = json.columnIds; const columnIds = json.columnIds;
...@@ -1466,20 +1437,8 @@ export default class tableCom extends Component { ...@@ -1466,20 +1437,8 @@ export default class tableCom extends Component {
getCellValue, getCellValue,
} = this.props; } = this.props;
// console.log(this.props.datas); // console.log(this.props.datas);
const { const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
options, const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
labels,
selectDis,
modalCode,
modalTitle,
modalInit,
modalProps,
} = this.state;
const {
getFieldDecorator,
getFieldError,
getFieldProps,
} = this.props.form;
const disabled = json != null ? json.disabled : false; const disabled = json != null ? json.disabled : false;
const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0; const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0;
if (json?.label === '账号') { if (json?.label === '账号') {
...@@ -1533,7 +1492,7 @@ export default class tableCom extends Component { ...@@ -1533,7 +1492,7 @@ export default class tableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(this.props.uuid, { {this.props.form.getFieldDecorator(this.props.uuid, {
initialValue: fk, initialValue: fk,
})(<Input type='hidden' />)}{' '} })(<Input type="hidden" />)}{' '}
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
importExcel={this.props.importExcel} importExcel={this.props.importExcel}
...@@ -1587,8 +1546,7 @@ export default class tableCom extends Component { ...@@ -1587,8 +1546,7 @@ export default class tableCom extends Component {
style={{ style={{
textAlign: 'center', textAlign: 'center',
height: value == null ? 20 : null, height: value == null ? 20 : null,
}} }}>
>
{value} {value}
</div> </div>
); );
...@@ -1609,14 +1567,13 @@ export default class tableCom extends Component { ...@@ -1609,14 +1567,13 @@ export default class tableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uid, { {this.props.form.getFieldDecorator(uid, {
initialValue: obj[this.props.uuid] || json.initialValue, initialValue: obj[this.props.uuid] || json.initialValue,
})(<Input type='hidden' />)} })(<Input type="hidden" />)}
<span <span
style={{ style={{
fontWeight: get === 'mobile' ? 'bold' : '', fontWeight: get === 'mobile' ? 'bold' : '',
marginRight: get === 'mobile' ? 12 : '', marginRight: get === 'mobile' ? 12 : '',
}} }}
{...json.props} {...json.props}>
>
{obj[this.props.uuid] || json.initialValue} {obj[this.props.uuid] || json.initialValue}
</span> </span>
</> </>
...@@ -1626,14 +1583,13 @@ export default class tableCom extends Component { ...@@ -1626,14 +1583,13 @@ export default class tableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uid, { {this.props.form.getFieldDecorator(uid, {
initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue, initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue,
})(<Input type='hidden' />)} })(<Input type="hidden" />)}
<span <span
style={{ style={{
fontWeight: get === 'mobile' ? 'bold' : '', fontWeight: get === 'mobile' ? 'bold' : '',
marginRight: get === 'mobile' ? 12 : '', marginRight: get === 'mobile' ? 12 : '',
}} }}
{...json.props} {...json.props}>
>
{this.props.form.getFieldsValue()[uid]} {this.props.form.getFieldsValue()[uid]}
</span> </span>
</> </>
...@@ -1719,8 +1675,7 @@ export default class tableCom extends Component { ...@@ -1719,8 +1675,7 @@ export default class tableCom extends Component {
case 'DatePicker': case 'DatePicker':
cm = value ? ( cm = value ? (
<span> <span>
{moment(parseInt(value)) {moment(parseInt(value)).format('YYYY-MM-DD HH:mm:ss')}
.format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
) : ( ) : (
...@@ -1736,7 +1691,7 @@ export default class tableCom extends Component { ...@@ -1736,7 +1691,7 @@ export default class tableCom extends Component {
{filesX.map((f, index2) => { {filesX.map((f, index2) => {
return ( return (
<li key={index2}> <li key={index2}>
<a target='_blank' key={f.path} href={queryApiActionPath() + f.path}> <a target="_blank" key={f.path} href={queryApiActionPath() + f.path}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -1756,7 +1711,7 @@ export default class tableCom extends Component { ...@@ -1756,7 +1711,7 @@ export default class tableCom extends Component {
{files.map((f, index2) => { {files.map((f, index2) => {
return ( return (
<li key={index2}> <li key={index2}>
<a target='_blank' key={f.path} href={queryApiActionPath() + f.path}> <a target="_blank" key={f.path} href={queryApiActionPath() + f.path}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -1831,8 +1786,7 @@ export default class tableCom extends Component { ...@@ -1831,8 +1786,7 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''} label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -1843,13 +1797,12 @@ export default class tableCom extends Component { ...@@ -1843,13 +1797,12 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''} label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
>
{cm} {cm}
</MobileItem> </MobileItem>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type='hidden' />)} })(<Input type="hidden" />)}
</> </>
); );
} }
...@@ -1862,7 +1815,7 @@ export default class tableCom extends Component { ...@@ -1862,7 +1815,7 @@ export default class tableCom extends Component {
{cm} {cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type='hidden' />)} })(<Input type="hidden" />)}
</> </>
); );
} }
...@@ -1876,8 +1829,7 @@ export default class tableCom extends Component { ...@@ -1876,8 +1829,7 @@ export default class tableCom extends Component {
style={{ style={{
minHeight: 40, minHeight: 40,
lineHeight: '40px', lineHeight: '40px',
}} }}>
>
<Col <Col
className={json.label ? json.label : sqlData[key] ? styles.row_col_div : ''} className={json.label ? json.label : sqlData[key] ? styles.row_col_div : ''}
span={json.labelSpan} span={json.labelSpan}
...@@ -1888,8 +1840,7 @@ export default class tableCom extends Component { ...@@ -1888,8 +1840,7 @@ export default class tableCom extends Component {
overflow: 'hidden', overflow: 'hidden',
fontSize: 14, fontSize: 14,
color: 'rgba(0,0,0,0.85)', color: 'rgba(0,0,0,0.85)',
}} }}>
>
{json.label ? ( {json.label ? (
<> <>
{json.label} {json.label}
...@@ -1898,8 +1849,7 @@ export default class tableCom extends Component { ...@@ -1898,8 +1849,7 @@ export default class tableCom extends Component {
position: 'relative', position: 'relative',
top: '-0.5px', top: '-0.5px',
margin: '0 8px 0 2px', margin: '0 8px 0 2px',
}} }}>
>
: :
</span> </span>
</> </>
...@@ -1911,8 +1861,7 @@ export default class tableCom extends Component { ...@@ -1911,8 +1861,7 @@ export default class tableCom extends Component {
position: 'relative', position: 'relative',
top: '-0.5px', top: '-0.5px',
margin: '0 8px 0 2px', margin: '0 8px 0 2px',
}} }}>
>
: :
</span> </span>
</> </>
...@@ -1927,8 +1876,7 @@ export default class tableCom extends Component { ...@@ -1927,8 +1876,7 @@ export default class tableCom extends Component {
lineHeight: '40px', lineHeight: '40px',
zoom: 1, zoom: 1,
fontSize: 14, fontSize: 14,
}} }}>
>
{cm} {cm}
</Col> </Col>
</Row> </Row>
...@@ -1938,8 +1886,7 @@ export default class tableCom extends Component { ...@@ -1938,8 +1886,7 @@ export default class tableCom extends Component {
<Form.Item <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''} label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
>
{cm} {cm}
</Form.Item> </Form.Item>
); );
...@@ -1950,13 +1897,12 @@ export default class tableCom extends Component { ...@@ -1950,13 +1897,12 @@ export default class tableCom extends Component {
<Form.Item <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''} label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
>
{cm} {cm}
</Form.Item> </Form.Item>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type='hidden' />)} })(<Input type="hidden" />)}
</> </>
); );
} }
...@@ -1969,7 +1915,7 @@ export default class tableCom extends Component { ...@@ -1969,7 +1915,7 @@ export default class tableCom extends Component {
{cm} {cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type='hidden' />)} })(<Input type="hidden" />)}
</> </>
); );
} }
...@@ -2060,17 +2006,18 @@ export default class tableCom extends Component { ...@@ -2060,17 +2006,18 @@ export default class tableCom extends Component {
); );
break; break;
case 'WangEditor': case 'WangEditor':
let textV = obj[dataColumn.base52];
if (!textV || textV === 'null') {
return <div />;
}
cm = ( cm = (
<div <div
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: `<div class='wangEditorHtml'> __html: `<div class='wangEditorHtml'>
${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ${obj[dataColumn.base52]}
obj[dataColumn.base52] : ''}
</div>`, </div>`,
}} }}
> />
</div>
); );
break; break;
case 'TextArea': case 'TextArea':
...@@ -2078,8 +2025,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2078,8 +2025,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
<span <span
style={{ style={{
wordBreak: 'break-all', wordBreak: 'break-all',
}} }}>
>
{obj[dataColumn.base52]} {obj[dataColumn.base52]}
</span> </span>
); );
...@@ -2093,8 +2039,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2093,8 +2039,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
<span <span
style={{ style={{
wordBreak: 'break-all', wordBreak: 'break-all',
}} }}>
>
{obj[dataColumn.base52]} {obj[dataColumn.base52]}
</span> </span>
); );
...@@ -2123,7 +2068,8 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2123,7 +2068,8 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
cm = ( cm = (
<span> <span>
{labels != null {labels != null
? labels.map((r, i) => ? labels.map(
(r, i) =>
i == 0 ? ( i == 0 ? (
typeof r == 'string' ? ( typeof r == 'string' ? (
<span>{r}</span> <span>{r}</span>
...@@ -2163,7 +2109,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2163,7 +2109,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
<Table <Table
get={get} get={get}
columns={this.state.columns} columns={this.state.columns}
size='small' size="small"
dataSource={ds} dataSource={ds}
pagination={false} pagination={false}
/> />
...@@ -2196,13 +2142,11 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2196,13 +2142,11 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
} else { } else {
cm = ( cm = (
<span> <span>
{moment(parseInt(obj[begin.base52])) {moment(parseInt(obj[begin.base52])).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '} )}{' '}
{' '} {' '}
{moment(parseInt(obj[end.base52])) {moment(parseInt(obj[end.base52])).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)} )}
</span> </span>
...@@ -2218,18 +2162,14 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2218,18 +2162,14 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) { if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) {
cm = ( cm = (
<span> <span>
{moment(parseInt(vTime)) {moment(parseInt(vTime)).format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span> </span>
); );
} else { } else {
cm = ( cm = (
<span> <span>
{vTime {vTime
? moment(+new Date(vTime)) ? moment(+new Date(vTime)).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
) )
: ''} : ''}
...@@ -2297,7 +2237,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2297,7 +2237,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
width: '100%', width: '100%',
textAlign: 'center', textAlign: 'center',
}} }}
></span> />
); );
} }
...@@ -2337,7 +2277,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2337,7 +2277,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
} }
return ( return (
<li key={index2}> <li key={index2}>
<a target='_blank' key={f.path} href={queryApiActionPath() + f.path}> <a target="_blank" key={f.path} href={queryApiActionPath() + f.path}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -2374,10 +2314,9 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2374,10 +2314,9 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
return ( return (
<li key={index2}> <li key={index2}>
<a <a
target='_blank' target="_blank"
key={f.filePath} key={f.filePath}
href={queryApiActionPath() + f.filePath} href={queryApiActionPath() + f.filePath}>
>
{f.fileName} {f.fileName}
</a> </a>
</li> </li>
...@@ -2393,8 +2332,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2393,8 +2332,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
display: 'inline-block', display: 'inline-block',
width: '100%', width: '100%',
textAlign: 'center', textAlign: 'center',
}} }}>
>
暂无附件 暂无附件
</span> </span>
); );
...@@ -2534,7 +2472,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2534,7 +2472,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <Button loading={this.props.loading} type='primary' {...ev} />; cm = <Button loading={this.props.loading} type="primary" {...ev} />;
} }
} }
...@@ -2552,11 +2490,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2552,11 +2490,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
v = {}; v = {};
} }
} }
cm = ( cm = <span>{v.address || ''}</span>;
<span>
{v.address || ''}
</span>
);
break; break;
case 'Table': case 'Table':
...@@ -2620,7 +2554,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2620,7 +2554,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <Button loading={this.props.loading} type='primary' {...ev} />; cm = <Button loading={this.props.loading} type="primary" {...ev} />;
} }
} }
...@@ -2648,15 +2582,14 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2648,15 +2582,14 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
], ],
})} })}
disabled={disabled} disabled={disabled}
onClick={checked => { onClick={(checked) => {
// set new value // set new value
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
[dataColumn.base52]: checked, [dataColumn.base52]: checked,
}); });
}} }}
/> />
} }>
>
{(json.isMobileLabel != null && json.isMobileLabel) || {(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel) (json.isMobileLabel == null && json.isLabel)
? title ? title
...@@ -2732,8 +2665,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2732,8 +2665,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2794,8 +2726,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2794,8 +2726,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2805,7 +2736,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2805,7 +2736,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
case 'InputHidden': case 'InputHidden':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
})(<Input type='hidden' />); })(<Input type="hidden" />);
break; break;
case 'InputNumber': case 'InputNumber':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -2841,8 +2772,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2841,8 +2772,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2878,8 +2808,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2878,8 +2808,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2893,7 +2822,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2893,7 +2822,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
case 'Checkbox': case 'Checkbox':
if (get === 'mobile') { if (get === 'mobile') {
cm = ( cm = (
<Flex direction='column' align='start'> <Flex direction="column" align="start">
{getFieldDecorator(dataColumn.base52, { {getFieldDecorator(dataColumn.base52, {
initialValue: initValue, // 默认值 initialValue: initValue, // 默认值
rules: rules:
...@@ -2919,8 +2848,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2919,8 +2848,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2976,7 +2904,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2976,7 +2904,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
disabled={selectDis || disabled} disabled={selectDis || disabled}
placeholder={json.placeholder} placeholder={json.placeholder}
style={{ width: json.width }} style={{ width: json.width }}
optionFilterProp='children' optionFilterProp="children"
getPopupContainer={ getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div') this.props.isDynamic && document.querySelector('#dynamic_div')
? () => { ? () => {
...@@ -2989,7 +2917,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -2989,7 +2917,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
? setTimeout(() => { ? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) { if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)]; let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => { ary.map((item) => {
item.setAttribute('readonly', 'readonly'); item.setAttribute('readonly', 'readonly');
// setTimeout(() => { // setTimeout(() => {
// ary.map(arr => { // ary.map(arr => {
...@@ -3003,14 +2931,12 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3003,14 +2931,12 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
}} }}
filterOption={(input, option) => filterOption={(input, option) =>
option option
? option.props.children.toLowerCase() ? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
.indexOf(input.toLowerCase()) >= 0
: false : false
} }
{...otherProps} {...otherProps}>
>
{options && options instanceof Array {options && options instanceof Array
? options.map(r => ( ? options.map((r) => (
<Option key={r.value} value={r.value}> <Option key={r.value} value={r.value}>
{r.label} {r.label}
</Option> </Option>
...@@ -3029,8 +2955,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3029,8 +2955,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3053,8 +2978,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3053,8 +2978,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
} }
const filterF = function filter(inputValue, path) { const filterF = function filter(inputValue, path) {
return path.some( return path.some(
option => option?.label?.toLowerCase() (option) => option?.label?.toLowerCase()?.indexOf(inputValue.toLowerCase()) > -1,
?.indexOf(inputValue.toLowerCase()) > -1,
); );
}; };
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3113,8 +3037,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3113,8 +3037,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3170,8 +3093,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3170,8 +3093,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3203,13 +3125,11 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3203,13 +3125,11 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
if (!isEdit) { if (!isEdit) {
cm = ( cm = (
<span> <span>
{moment(parseInt(obj[begin.base52])) {moment(parseInt(obj[begin.base52])).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '} )}{' '}
{' '} {' '}
{moment(parseInt(obj[end.base52])) {moment(parseInt(obj[end.base52])).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)} )}
</span> </span>
...@@ -3227,7 +3147,14 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3227,7 +3147,14 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
message: '请选择起止时间', message: '请选择起止时间',
}, },
], ],
})(<MobileDate disabled={disabled} required={required} format={json.format} showTime={json.showTime}/>); })(
<MobileDate
disabled={disabled}
required={required}
format={json.format}
showTime={json.showTime}
/>,
);
if ( if (
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)) && (json.isMobileLabel == null && json.isLabel)) &&
...@@ -3239,8 +3166,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3239,8 +3166,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}
required={required} required={required}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3313,8 +3239,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3313,8 +3239,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
} }
}); });
} }
: () => { : () => {}
}
} }
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'} format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
/>, />,
...@@ -3330,8 +3255,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3330,8 +3255,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3374,8 +3298,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3374,8 +3298,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3425,8 +3348,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3425,8 +3348,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3477,8 +3399,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3477,8 +3399,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3505,14 +3426,17 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3505,14 +3426,17 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
rules: rules:
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [{ : [
{
required, required,
message: '请获取定位信息', message: '请获取定位信息',
validator: (rule, valueThis, callback) => { validator: (rule, valueThis, callback) => {
let errors = []; let errors = [];
console.log(valueThis); console.log(valueThis);
if ((!valueThis || !JSON.stringify(valueThis) if (
.includes('address')) && required) { (!valueThis || !JSON.stringify(valueThis).includes('address')) &&
required
) {
errors.push(new Error('请获取定位信息', rule.field)); errors.push(new Error('请获取定位信息', rule.field));
} }
callback(errors); callback(errors);
...@@ -3540,8 +3464,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3540,8 +3464,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3590,8 +3513,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3590,8 +3513,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3621,8 +3543,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3621,8 +3543,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3652,8 +3573,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3652,8 +3573,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3692,8 +3612,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3692,8 +3612,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3736,15 +3655,13 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3736,15 +3655,13 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
margin: 5, margin: 5,
border: '1px solid #ccc', border: '1px solid #ccc',
}} }}
className={styles.mobileList} className={styles.mobileList}>
>
{modalCode ? ( {modalCode ? (
<FormModal <FormModal
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}>
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3785,8 +3702,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3785,8 +3702,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
style={{ style={{
minHeight: 40, minHeight: 40,
lineHeight: '40px', lineHeight: '40px',
}} }}>
>
<Col <Col
className={title ? styles.row_col_div : ''} className={title ? styles.row_col_div : ''}
span={json.labelSpan} span={json.labelSpan}
...@@ -3797,17 +3713,16 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3797,17 +3713,16 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
overflow: 'hidden', overflow: 'hidden',
fontSize: 14, fontSize: 14,
color: 'rgba(0,0,0,0.85)', color: 'rgba(0,0,0,0.85)',
}} }}>
>
{title} {title}
{title && ( {title && (
<span <span
data-cell-component-name={json.comName || 'no_com'}
style={{ style={{
position: 'relative', position: 'relative',
top: '-0.5px', top: '-0.5px',
margin: '0 8px 0 2px', margin: '0 8px 0 2px',
}} }}>
>
: :
</span> </span>
)} )}
...@@ -3819,8 +3734,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3819,8 +3734,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
lineHeight: '40px', lineHeight: '40px',
zoom: 1, zoom: 1,
fontSize: 14, fontSize: 14,
}} }}>
>
{cm} {cm}
</Col> </Col>
{modalCode ? ( {modalCode ? (
...@@ -3828,8 +3742,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3828,8 +3742,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}>
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3865,8 +3778,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3865,8 +3778,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}>
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3896,7 +3808,11 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3896,7 +3808,11 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
> data-cell-component-name={json.comName || 'no_com'}>
<span
style={{ display: 'none' }}
data-cell-component-name={json.comName || 'no_com'}
/>
{cm} {cm}
</Form.Item> </Form.Item>
</> </>
...@@ -3910,8 +3826,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3910,8 +3826,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}>
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3948,8 +3863,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3948,8 +3863,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}>
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3979,8 +3893,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3979,8 +3893,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}>
>
{cm} {cm}
</MobileItem> </MobileItem>
) : isEdit && get == 'web' ? ( ) : isEdit && get == 'web' ? (
...@@ -3989,7 +3902,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ? ...@@ -3989,7 +3902,7 @@ ${obj[dataColumn.base52] && obj[dataColumn.base52] !== 'null' ?
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
> data-cell-component-name={json.comName || 'no_com'}>
{cm} {cm}
</Form.Item> </Form.Item>
) : ( ) : (
......
...@@ -16,6 +16,9 @@ function Index({ onChange, value, otherProps, dataColumn, disabled, json, uuid } ...@@ -16,6 +16,9 @@ function Index({ onChange, value, otherProps, dataColumn, disabled, json, uuid }
return null; return null;
} }
if(disabled){ if(disabled){
if(!value || value === 'null'){
return <div></div>
}
return <div dangerouslySetInnerHTML={{__html: `<div class="wangEditorHtml">${value}</div>`}}> return <div dangerouslySetInnerHTML={{__html: `<div class="wangEditorHtml">${value}</div>`}}>
</div> </div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论