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

优化wangEditor

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