提交 1ba7dffb authored 作者: 钟是志's avatar 钟是志

签名组件优化

上级 53d70e31
...@@ -78,9 +78,13 @@ import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUp ...@@ -78,9 +78,13 @@ import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUp
import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb'; import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb';
import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index'; import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index';
import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy'; import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy';
import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength'; import giveVarcharRules
from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
const { MonthPicker, WeekPicker } = DatePicker; const {
MonthPicker,
WeekPicker
} = DatePicker;
/** /**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选 * 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
*/ */
...@@ -101,7 +105,12 @@ const giveRender = (column = {}) => { ...@@ -101,7 +105,12 @@ const giveRender = (column = {}) => {
return column; return column;
}; };
@connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({ @connect(({
DataColumn,
SqlManageEntity,
formList,
loading
}) => ({
DataColumn, DataColumn,
SqlManageEntity, SqlManageEntity,
formList, formList,
...@@ -207,7 +216,12 @@ export default class TableCom extends Component { ...@@ -207,7 +216,12 @@ export default class TableCom extends Component {
}; };
getColumnSearchProps = (dataIndex, title) => ({ getColumnSearchProps = (dataIndex, title) => ({
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => ( filterDropdown: ({
setSelectedKeys,
selectedKeys,
confirm,
clearFilters
}) => (
<div style={{ padding: 8 }}> <div style={{ padding: 8 }}>
<Input <Input
ref={node => { ref={node => {
...@@ -246,13 +260,13 @@ export default class TableCom extends Component { ...@@ -246,13 +260,13 @@ export default class TableCom extends Component {
</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]
.toString() .toString()
.toLowerCase() .toLowerCase()
.includes(value.toLowerCase()) .includes(value.toLowerCase())
: '', : '',
onFilterDropdownVisibleChange: visible => { onFilterDropdownVisibleChange: visible => {
if (visible) { if (visible) {
...@@ -294,7 +308,11 @@ export default class TableCom extends Component { ...@@ -294,7 +308,11 @@ export default class TableCom extends Component {
}; };
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
const { json, mapData, obj } = props; const {
json,
mapData,
obj
} = props;
if (json == null || this.props.safe) { if (json == null || this.props.safe) {
return; return;
} }
...@@ -352,7 +370,7 @@ export default class TableCom extends Component { ...@@ -352,7 +370,7 @@ export default class TableCom extends Component {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props
.i + 1}行,第${this.props.j + .i + 1}行,第${this.props.j +
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`, 1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
); );
return; return;
...@@ -374,9 +392,9 @@ export default class TableCom extends Component { ...@@ -374,9 +392,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null this.props.fatherCode != null
? bindObj ? bindObj
? { ? {
...bindObj, ...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`, base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
} }
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` } : { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj; : bindObj;
if (this.props.fatherCode == null && dataColumn == null) { if (this.props.fatherCode == null && dataColumn == null) {
...@@ -407,7 +425,10 @@ export default class TableCom extends Component { ...@@ -407,7 +425,10 @@ export default class TableCom extends Component {
dataFilter = ['Select', 'Radio', 'Checkbox', 'Cascader']; dataFilter = ['Select', 'Radio', 'Checkbox', 'Cascader'];
getData = (json, dataColumn, obj, init) => { getData = (json, dataColumn, obj, init) => {
const { formKey, uuid } = this.props; const {
formKey,
uuid
} = this.props;
let jsonStatic = json; let jsonStatic = json;
json = { json = {
...jsonStatic, ...jsonStatic,
...@@ -418,7 +439,10 @@ export default class TableCom extends Component { ...@@ -418,7 +439,10 @@ 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 { sqlKey, optionType } = json; const {
sqlKey,
optionType
} = json;
if (optionType === 'sql') { if (optionType === 'sql') {
dispatch({ dispatch({
type: 'SqlManageEntity/find', type: 'SqlManageEntity/find',
...@@ -440,7 +464,8 @@ export default class TableCom extends Component { ...@@ -440,7 +464,8 @@ 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).format('YYYY-MM-DD HH:mm:ss'); column.render = val => moment(val)
.format('YYYY-MM-DD HH:mm:ss');
} }
column = giveRender(column); column = giveRender(column);
...@@ -477,7 +502,8 @@ export default class TableCom extends Component { ...@@ -477,7 +502,8 @@ export default class TableCom extends Component {
break; break;
} }
column.render = val => moment(parseInt(val)).format(ff); column.render = val => moment(parseInt(val))
.format(ff);
} }
if (cll[k].isQuery) { if (cll[k].isQuery) {
column = { column = {
...@@ -523,7 +549,8 @@ export default class TableCom extends Component { ...@@ -523,7 +549,8 @@ 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).format('YYYY-MM-DD HH:mm:ss'); column.render = val => moment(val)
.format('YYYY-MM-DD HH:mm:ss');
} }
column = giveRender(column); column = giveRender(column);
columns.push(column); columns.push(column);
...@@ -653,7 +680,7 @@ export default class TableCom extends Component { ...@@ -653,7 +680,7 @@ export default class TableCom extends Component {
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i +
1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e, e,
); );
} }
...@@ -747,7 +774,7 @@ export default class TableCom extends Component { ...@@ -747,7 +774,7 @@ export default class TableCom extends Component {
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j + `页面${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`, 1}列:公式配置有误,回调函数内部错误,`,
e, e,
); );
} }
...@@ -762,78 +789,79 @@ export default class TableCom extends Component { ...@@ -762,78 +789,79 @@ export default class TableCom extends Component {
delete params[i]; delete params[i];
} }
} }
noPrefixRequest(url, params).then(data => { noPrefixRequest(url, params)
// if (!data || !Array.isArray(data)) { .then(data => {
// data = []; // if (!data || !Array.isArray(data)) {
// } // data = [];
const { reqUrls } = this.state; // }
if (reqUrls && reqUrls[url]) { const { reqUrls } = this.state;
reqUrls[url].data = data; if (reqUrls && reqUrls[url]) {
} reqUrls[url].data = data;
this.setState( }
{ this.setState(
res: data, {
reqUrls, res: data,
}, reqUrls,
() => { },
if (callback) { () => {
if (json.optionType && json.optionType == 'func') { if (callback) {
const res = callback(data); if (json.optionType && json.optionType == 'func') {
if (res != null && !(typeof res === 'function')) { const res = callback(data);
this.setState( if (res != null && !(typeof res === 'function')) {
{ this.setState(
options: res, {
selectDis: false, options: res,
}, selectDis: false,
() => { },
if (orgCallback) orgCallback(); () => {
}, if (orgCallback) orgCallback();
); },
} );
} else if (json.comName == 'Button') {
try {
callback(data);
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
} }
} catch (e) { } else if (json.comName == 'Button') {
console.log( try {
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this callback(data);
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, } catch (e) {
e, console.log(
); `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
} .props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
} else { e,
if (base52) { );
}
} else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) {
try { try {
const x = callback(data); const x = callback(data);
// console.log(x, '757'); if (x != null) {
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x }); this.setState({ option: x });
}
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${ `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
json.comName .props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
e, e,
); );
} }
} else {
if (base52) {
try {
const x = callback(data);
// console.log(x, '757');
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${
json.comName
}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
}
} }
} }
} },
}, );
); });
});
return 'norefeshxxxxxxxxxxxxxxxxxxxx'; return 'norefeshxxxxxxxxxxxxxxxxxxxx';
}; };
...@@ -964,62 +992,50 @@ export default class TableCom extends Component { ...@@ -964,62 +992,50 @@ export default class TableCom extends Component {
if (getToken() != null) { if (getToken() != null) {
pp.token = getToken(); pp.token = getToken();
} }
uaaRequest(url, pp).then(data => { uaaRequest(url, pp)
const { sqlKeys } = this.state; .then(data => {
sqlKeys[sqlKey].data = data; const { sqlKeys } = this.state;
this.setState({ sqlKeys }); sqlKeys[sqlKey].data = data;
if (data == null) { this.setState({ sqlKeys });
return; if (data == null) {
} return;
}
if (callback) { if (callback) {
if (json.optionType && json.optionType === 'func') { if (json.optionType && json.optionType === 'func') {
const res = callback(data); const res = callback(data);
if (res != null && !(typeof res === 'function')) { if (res != null && !(typeof res === 'function')) {
this.setState( this.setState(
{ {
options: res, options: res,
selectDis: false, selectDis: false,
}, },
() => { () => {
if (orgCallback) orgCallback(); if (orgCallback) orgCallback();
}, },
); );
}
} else if (json.comName == 'Button') {
try {
callback(data);
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else if (
json.comName == 'Echart' ||
json.comName == 'QRCode' ||
json.comName == 'Graph'
) {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
} }
} catch (e) { } else if (json.comName == 'Button') {
console.log( try {
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this callback(data);
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, } catch (e) {
e, console.log(
); `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
} .props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
} else { e,
if (base52) { );
}
} else if (
json.comName == 'Echart' ||
json.comName == 'QRCode' ||
json.comName == 'Graph'
) {
try { try {
const x = callback(data); const x = callback(data);
// console.log(x, 938); if (x != null) {
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x }); this.setState({ option: x });
}
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
...@@ -1027,10 +1043,23 @@ export default class TableCom extends Component { ...@@ -1027,10 +1043,23 @@ export default class TableCom extends Component {
e, e,
); );
} }
} else {
if (base52) {
try {
const x = callback(data);
// console.log(x, 938);
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
}
} }
} }
} });
});
}); });
return 'norefeshxxxxxxxxxxxxxxxxxxxx'; return 'norefeshxxxxxxxxxxxxxxxxxxxx';
...@@ -1162,14 +1191,19 @@ export default class TableCom extends Component { ...@@ -1162,14 +1191,19 @@ export default class TableCom extends Component {
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i +
1}行,第${this.props.j + 1}列:公式配置有误,暂存失败,`, 1}行,第${this.props.j + 1}列:公式配置有误,暂存失败,`,
e, e,
); );
} }
}; };
componentDidMount() { componentDidMount() {
const { json, mapData, obj, init } = this.props; const {
json,
mapData,
obj,
init
} = this.props;
if (json == null) { if (json == null) {
return; return;
} }
...@@ -1190,9 +1224,9 @@ export default class TableCom extends Component { ...@@ -1190,9 +1224,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null this.props.fatherCode != null
? bindObj ? bindObj
? { ? {
...bindObj, ...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`, base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
} }
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` } : { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj; : bindObj;
if (this.props.fatherCode == null && dataColumn == null) { if (this.props.fatherCode == null && dataColumn == null) {
...@@ -1214,7 +1248,13 @@ export default class TableCom extends Component { ...@@ -1214,7 +1248,13 @@ export default class TableCom extends Component {
} }
fetchData3 = (obj, dataColumn, init, json, allValues) => { fetchData3 = (obj, dataColumn, init, json, allValues) => {
const { sqlKey, labelName, valueName, isMeta, filterSql } = json; const {
sqlKey,
labelName,
valueName,
isMeta,
filterSql
} = json;
if (isMeta) { if (isMeta) {
// 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
// 解决禅道bug 28017 // 解决禅道bug 28017
...@@ -1454,7 +1494,10 @@ export default class TableCom extends Component { ...@@ -1454,7 +1494,10 @@ export default class TableCom extends Component {
} }
}; };
getColumn = key => { getColumn = key => {
let { mapData, json } = this.props; let {
mapData,
json
} = this.props;
const columnIds = json?.columnIds; const columnIds = json?.columnIds;
...@@ -1510,8 +1553,20 @@ export default class TableCom extends Component { ...@@ -1510,8 +1553,20 @@ export default class TableCom extends Component {
// console.log(formKey, json); // console.log(formKey, json);
// } // }
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state; const {
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form; options,
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 === '账号') {
...@@ -1534,7 +1589,7 @@ export default class TableCom extends Component { ...@@ -1534,7 +1589,7 @@ export default class TableCom extends Component {
) { ) {
return <></>; return <></>;
} }
return <QRCode {...this.state.option} key={uuid} />; return <QRCode {...this.state.option} key={uuid}/>;
} }
if (json.comName == 'Echart') { if (json.comName == 'Echart') {
return ( return (
...@@ -1550,7 +1605,7 @@ export default class TableCom extends Component { ...@@ -1550,7 +1605,7 @@ export default class TableCom extends Component {
); );
} }
if (json.comName == 'Graph') { if (json.comName == 'Graph') {
return <Neo4jD3Com key={uuid} json={json} option={this.state.option || []} />; return <Neo4jD3Com key={uuid} json={json} option={this.state.option || []}/>;
} }
if (json.comName == 'PartForm') { if (json.comName == 'PartForm') {
...@@ -1565,7 +1620,7 @@ export default class TableCom extends Component { ...@@ -1565,7 +1620,7 @@ export default class TableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uuid, { {this.props.form.getFieldDecorator(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}
...@@ -1641,7 +1696,7 @@ export default class TableCom extends Component { ...@@ -1641,7 +1696,7 @@ export default class TableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uid, { {this.props.form.getFieldDecorator(uid, {
initialValue: obj[uuid] || json.initialValue, initialValue: obj[uuid] || json.initialValue,
})(<Input type="hidden" />)} })(<Input type="hidden"/>)}
<span <span
style={{ style={{
fontWeight: get === 'mobile' ? 'bold' : '', fontWeight: get === 'mobile' ? 'bold' : '',
...@@ -1658,7 +1713,7 @@ export default class TableCom extends Component { ...@@ -1658,7 +1713,7 @@ 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' : '',
...@@ -1707,7 +1762,7 @@ export default class TableCom extends Component { ...@@ -1707,7 +1762,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span style={{ paddingRight: get === 'mobile' ? 8 : '' }}> <span style={{ paddingRight: get === 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</span> </span>
); );
break; break;
...@@ -1715,7 +1770,7 @@ export default class TableCom extends Component { ...@@ -1715,7 +1770,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span> <span>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</span> </span>
); );
...@@ -1733,7 +1788,7 @@ export default class TableCom extends Component { ...@@ -1733,7 +1788,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}> <span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</span> </span>
); );
...@@ -1742,7 +1797,7 @@ export default class TableCom extends Component { ...@@ -1742,7 +1797,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span> <span>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</span> </span>
); );
...@@ -1750,8 +1805,9 @@ export default class TableCom extends Component { ...@@ -1750,8 +1805,9 @@ export default class TableCom extends Component {
case 'DatePicker': case 'DatePicker':
cm = value ? ( cm = value ? (
<span> <span>
{moment(parseInt(value)).format('YYYY-MM-DD HH:mm:ss')} {moment(parseInt(value))
{get === 'mobile' ? <br /> : ''} .format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br/> : ''}
</span> </span>
) : ( ) : (
'' ''
...@@ -1773,7 +1829,7 @@ export default class TableCom extends Component { ...@@ -1773,7 +1829,7 @@ export default class TableCom extends Component {
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</> </>
); );
...@@ -1793,7 +1849,7 @@ export default class TableCom extends Component { ...@@ -1793,7 +1849,7 @@ export default class TableCom extends Component {
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</> </>
); );
...@@ -1818,7 +1874,7 @@ export default class TableCom extends Component { ...@@ -1818,7 +1874,7 @@ export default class TableCom extends Component {
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</> </>
); );
} }
...@@ -1844,7 +1900,7 @@ export default class TableCom extends Component { ...@@ -1844,7 +1900,7 @@ export default class TableCom extends Component {
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</> </>
); );
} }
...@@ -1879,7 +1935,7 @@ export default class TableCom extends Component { ...@@ -1879,7 +1935,7 @@ export default class TableCom extends Component {
</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"/>)}
</> </>
); );
} }
...@@ -1892,7 +1948,7 @@ export default class TableCom extends Component { ...@@ -1892,7 +1948,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"/>)}
</> </>
); );
} }
...@@ -1986,7 +2042,7 @@ export default class TableCom extends Component { ...@@ -1986,7 +2042,7 @@ export default class TableCom extends Component {
</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"/>)}
</> </>
); );
} }
...@@ -1999,7 +2055,7 @@ export default class TableCom extends Component { ...@@ -1999,7 +2055,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"/>)}
</> </>
); );
} }
...@@ -2015,9 +2071,9 @@ export default class TableCom extends Component { ...@@ -2015,9 +2071,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null this.props.fatherCode != null
? bindObj ? bindObj
? { ? {
...bindObj, ...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`, base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
} }
: { base52: `${this.props.fatherCode}.[${this.props.index}].${uuid}` } : { base52: `${this.props.fatherCode}.[${this.props.index}].${uuid}` }
: bindObj; : bindObj;
...@@ -2078,7 +2134,7 @@ export default class TableCom extends Component { ...@@ -2078,7 +2134,7 @@ export default class TableCom extends Component {
case 'WangEditor': case 'WangEditor':
let textV = obj[dataColumn.base52]; let textV = obj[dataColumn.base52];
if (!textV || textV === 'null') { if (!textV || textV === 'null') {
return <div />; return <div/>;
} }
cm = ( cm = (
<div <div
...@@ -2143,18 +2199,18 @@ ${obj[dataColumn.base52]} ...@@ -2143,18 +2199,18 @@ ${obj[dataColumn.base52]}
<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>
) : (
Object.values(r)
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : ( ) : (
',' + Object.values(r) Object.values(r)
), )
) ) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
',' + Object.values(r)
),
)
: ''} : ''}
</span> </span>
); );
...@@ -2214,13 +2270,15 @@ ${obj[dataColumn.base52]} ...@@ -2214,13 +2270,15 @@ ${obj[dataColumn.base52]}
} else { } else {
cm = ( cm = (
<span> <span>
{moment(parseInt(obj[begin.base52])).format( {moment(parseInt(obj[begin.base52]))
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', .format(
)}{' '} json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '} {' '}
{moment(parseInt(obj[end.base52])).format( {moment(parseInt(obj[end.base52]))
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', .format(
)} json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span> </span>
); );
} }
...@@ -2234,14 +2292,16 @@ ${obj[dataColumn.base52]} ...@@ -2234,14 +2292,16 @@ ${obj[dataColumn.base52]}
if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) { if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) {
cm = ( cm = (
<span> <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> </span>
); );
} else { } else {
cm = ( cm = (
<span> <span>
{vTime {vTime
? moment(+new Date(vTime)).format( ? moment(+new Date(vTime))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
) )
: ''} : ''}
...@@ -2286,18 +2346,18 @@ ${obj[dataColumn.base52]} ...@@ -2286,18 +2346,18 @@ ${obj[dataColumn.base52]}
cm = ( cm = (
<ul className={styles.imageUl}> <ul className={styles.imageUl}>
{Array.isArray(files) && {Array.isArray(files) &&
files.map((f, index2) => { files.map((f, index2) => {
return ( return (
<li key={f.path}> <li key={f.path}>
<PictureSignature <PictureSignature
json={json} json={json}
disabled={true} // 只读模式 disabled={true} // 只读模式
basicUrl={queryApiActionPath()} basicUrl={queryApiActionPath()}
fileInfo={f} fileInfo={f}
/> />
</li> </li>
); );
})} })}
</ul> </ul>
); );
} }
...@@ -2362,26 +2422,26 @@ ${obj[dataColumn.base52]} ...@@ -2362,26 +2422,26 @@ ${obj[dataColumn.base52]}
cm = ( cm = (
<ul className={styles.imageUl}> <ul className={styles.imageUl}>
{Array.isArray(files) && {Array.isArray(files) &&
files.map((f, index2) => { files.map((f, index2) => {
if (get === 'web' || !this.props.isPrint) { if (get === 'web' || !this.props.isPrint) {
return (
<li key={index2}>
<FilePreview
path={queryFileUrl(f.path)}
pathName={f.name}
type={'UploadCom'}
/>
</li>
);
}
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" key={f.filePath} href={queryFileUrl(f.filePath)}> <FilePreview
{f.fileName} path={queryFileUrl(f.path)}
</a> pathName={f.name}
type={'UploadCom'}
/>
</li> </li>
); );
})} }
return (
<li key={index2}>
<a target="_blank" key={f.filePath} href={queryFileUrl(f.filePath)}>
{f.fileName}
</a>
</li>
);
})}
</ul> </ul>
); );
} }
...@@ -2466,21 +2526,27 @@ ${obj[dataColumn.base52]} ...@@ -2466,21 +2526,27 @@ ${obj[dataColumn.base52]}
cm = ''; cm = '';
} else { } else {
console.log(obj[dataColumn.base52], '签名组件获取的值'); console.log(obj[dataColumn.base52], '签名组件获取的值');
cm = ( const filePath = queryFileUrl(obj[dataColumn.base52]);
<img if (!filePath) {
data-cell-component={'Signature'} cm = '';
data-cell-base52={dataColumn.base52} } else {
src={queryFileUrl(obj[dataColumn.base52])} cm = (
style={{ <img
marginLeft: 5, data-cell-component={'Signature'}
width: data-cell-base52={dataColumn.base52}
get === 'mobile' src={filePath}
? document.documentElement.clientWidth - 10 || document.body.clientWidth - 10 style={{
: json.width, marginLeft: 5,
height: get === 'mobile' ? '' : json.height, width:
}} get === 'mobile'
/> ? document.documentElement.clientWidth - 10 || document.body.clientWidth - 10
); : json.width,
height: get === 'mobile' ? '' : json.height,
}}
/>
);
}
} }
break; break;
...@@ -2650,11 +2716,11 @@ ${obj[dataColumn.base52]} ...@@ -2650,11 +2716,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + title, message: '请选择' + title,
}, },
], ],
})} })}
disabled={disabled} disabled={disabled}
onClick={checked => { onClick={checked => {
...@@ -2681,12 +2747,12 @@ ${obj[dataColumn.base52]} ...@@ -2681,12 +2747,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + title, message: '请选择' + title,
}, },
], ],
})(<SwitchWeb json={json} disabled={disabled} />); })(<SwitchWeb json={json} disabled={disabled}/>);
break; break;
case 'TextArea': case 'TextArea':
...@@ -2765,7 +2831,10 @@ ${obj[dataColumn.base52]} ...@@ -2765,7 +2831,10 @@ ${obj[dataColumn.base52]}
otherProps = {}; otherProps = {};
} }
} }
const { disabledInputStyle = {}, addonAfter } = otherProps; const {
disabledInputStyle = {},
addonAfter
} = otherProps;
let inputStyle = { let inputStyle = {
width: json.width, width: json.width,
}; };
...@@ -2815,7 +2884,7 @@ ${obj[dataColumn.base52]} ...@@ -2815,7 +2884,7 @@ ${obj[dataColumn.base52]}
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':
if (json?.otherProps) { if (json?.otherProps) {
...@@ -2832,11 +2901,11 @@ ${obj[dataColumn.base52]} ...@@ -2832,11 +2901,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请输入' + title, message: '请输入' + title,
}, },
], ],
})( })(
<InputNumber <InputNumber
disabled={disabled} disabled={disabled}
...@@ -2879,12 +2948,12 @@ ${obj[dataColumn.base52]} ...@@ -2879,12 +2948,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<Radio.Group options={options} disabled={disabled} />); })(<Radio.Group options={options} disabled={disabled}/>);
if (get == 'mobile') { if (get == 'mobile') {
cm = <div>{cm}</div>; cm = <div>{cm}</div>;
if ( if (
...@@ -2919,12 +2988,12 @@ ${obj[dataColumn.base52]} ...@@ -2919,12 +2988,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<Checkbox.Group options={options} disabled={disabled} />)} })(<Checkbox.Group options={options} disabled={disabled}/>)}
</Flex> </Flex>
); );
...@@ -2954,11 +3023,11 @@ ${obj[dataColumn.base52]} ...@@ -2954,11 +3023,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})( })(
<Checkbox.Group <Checkbox.Group
options={options} options={options}
...@@ -2983,11 +3052,11 @@ ${obj[dataColumn.base52]} ...@@ -2983,11 +3052,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})( })(
<Select <Select
allowClear allowClear
...@@ -2999,49 +3068,50 @@ ${obj[dataColumn.base52]} ...@@ -2999,49 +3068,50 @@ ${obj[dataColumn.base52]}
getPopupContainer={ getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div') this.props.isDynamic && document.querySelector('#dynamic_div')
? () => { ? () => {
return document.querySelector('#dynamic_div'); return document.querySelector('#dynamic_div');
} }
: '' : ''
} }
onFocus={() => { onFocus={() => {
get === 'mobile' // 移动端取消输入键盘弹出 get === 'mobile' // 移动端取消输入键盘弹出
? 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 => {
// arr.removeAttribute('readonly'); // arr.removeAttribute('readonly');
// }) // })
// }); // });
}); });
} }
}) })
: null; : null;
}} }}
filterOption={(input, option) => filterOption={(input, option) =>
option option
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 ? option.props.children.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
: false : false
} }
{...otherProps} {...otherProps}
> >
{json.options && Array.isArray(json.options) {json.options && Array.isArray(json.options)
? json.options.map(r => { ? json.options.map(r => {
return ( return (
<Option key={r.value} value={r.value}> <Option key={r.value} value={r.value}>
{r.label} {r.label}
</Option> </Option>
); );
}) })
: 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>
)) ))
: ''} : ''}
</Select>, </Select>,
); );
if ( if (
...@@ -3079,7 +3149,8 @@ ${obj[dataColumn.base52]} ...@@ -3079,7 +3149,8 @@ ${obj[dataColumn.base52]}
} }
const filterF = function filter(inputValue, path) { const filterF = function filter(inputValue, path) {
return path.some( return path.some(
option => option?.label?.toLowerCase()?.indexOf(inputValue.toLowerCase()) > -1, option => option?.label?.toLowerCase()
?.indexOf(inputValue.toLowerCase()) > -1,
); );
}; };
// if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){ // if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){
...@@ -3096,11 +3167,11 @@ ${obj[dataColumn.base52]} ...@@ -3096,11 +3167,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})( })(
<Cascader // 这里的options 获取方式存在bug 公式会重复调用 <Cascader // 这里的options 获取方式存在bug 公式会重复调用
options={options} options={options}
...@@ -3111,8 +3182,8 @@ ${obj[dataColumn.base52]} ...@@ -3111,8 +3182,8 @@ ${obj[dataColumn.base52]}
getPopupContainer={ getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div') this.props.isDynamic && document.querySelector('#dynamic_div')
? () => { ? () => {
return document.querySelector('#dynamic_div'); return document.querySelector('#dynamic_div');
} }
: '' : ''
} }
placeholder={json.placeholder} placeholder={json.placeholder}
...@@ -3128,12 +3199,12 @@ ${obj[dataColumn.base52]} ...@@ -3128,12 +3199,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json} />); })(<MobileCascader options={options} label={title} disabled={disabled} json={json}/>);
} }
if ( if (
...@@ -3165,22 +3236,22 @@ ${obj[dataColumn.base52]} ...@@ -3165,22 +3236,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
let errors = []; let errors = [];
if ( if (
(Object.keys(value).length == 0 || (Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) && Object.keys(value.selects).length == 0) &&
required != null && required != null &&
required required
) { ) {
errors.push(new Error('请选择至少一个', rule.field)); errors.push(new Error('请选择至少一个', rule.field));
} }
callback(errors); callback(errors);
},
required: required,
}, },
], required: required,
},
],
})( })(
<TableSelect <TableSelect
get={get} get={get}
...@@ -3229,13 +3300,15 @@ ${obj[dataColumn.base52]} ...@@ -3229,13 +3300,15 @@ ${obj[dataColumn.base52]}
if (!isEdit) { if (!isEdit) {
cm = ( cm = (
<span> <span>
{moment(parseInt(obj[begin.base52])).format( {moment(parseInt(obj[begin.base52]))
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', .format(
)}{' '} json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '} {' '}
{moment(parseInt(obj[end.base52])).format( {moment(parseInt(obj[end.base52]))
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 {
...@@ -3246,11 +3319,11 @@ ${obj[dataColumn.base52]} ...@@ -3246,11 +3319,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择起止时间', message: '请选择起止时间',
}, },
], ],
})( })(
<MobileDate <MobileDate
disabled={disabled} disabled={disabled}
...@@ -3286,12 +3359,12 @@ ${obj[dataColumn.base52]} ...@@ -3286,12 +3359,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择起止时间', message: '请选择起止时间',
}, },
], ],
})(<RangePickerDiy json={json} disabled={disabled} />); })(<RangePickerDiy json={json} disabled={disabled}/>);
} }
if (json.label == null) title = '起止时间'; if (json.label == null) title = '起止时间';
break; break;
...@@ -3318,11 +3391,11 @@ ${obj[dataColumn.base52]} ...@@ -3318,11 +3391,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择起止时间', message: '请选择起止时间',
}, },
], ],
})( })(
<DatePicker <DatePicker
disabled={disabled} disabled={disabled}
...@@ -3333,21 +3406,22 @@ ${obj[dataColumn.base52]} ...@@ -3333,21 +3406,22 @@ ${obj[dataColumn.base52]}
onOpenChange={ onOpenChange={
get === 'mobile' get === 'mobile'
? () => { ? () => {
// 取消唤起移动端小键盘 // 取消唤起移动端小键盘
setTimeout(() => { setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) { if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly');
setTimeout(() => {
document document
.querySelector('.ant-calendar-input ') .querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly'); .removeAttribute('readonly');
setTimeout(() => { });
document }
.querySelector('.ant-calendar-input ') });
.removeAttribute('readonly'); }
}); : () => {
} }
});
}
: () => {}
} }
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'} format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
{...otherProps} {...otherProps}
...@@ -3384,11 +3458,11 @@ ${obj[dataColumn.base52]} ...@@ -3384,11 +3458,11 @@ ${obj[dataColumn.base52]}
json?.vlds && json?.vlds.length > 0 json?.vlds && json?.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required, required,
message: '请进行签章', message: '请进行签章',
}, },
], ],
})( })(
<SignArray // 签章组件 编辑模式 <SignArray // 签章组件 编辑模式
json={json} json={json}
...@@ -3473,12 +3547,12 @@ ${obj[dataColumn.base52]} ...@@ -3473,12 +3547,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请输入', message: '请输入',
}, },
], ],
})(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid} />); })(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid}/>);
break; break;
case 'RichText': case 'RichText':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3487,12 +3561,12 @@ ${obj[dataColumn.base52]} ...@@ -3487,12 +3561,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请输入', message: '请输入',
}, },
], ],
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled} />); })(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled}/>);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3518,12 +3592,12 @@ ${obj[dataColumn.base52]} ...@@ -3518,12 +3592,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请输入' + title, message: '请输入' + title,
}, },
], ],
})(<CronEditorDiy />); })(<CronEditorDiy/>);
break; break;
case 'LocationCom': case 'LocationCom':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3532,22 +3606,23 @@ ${obj[dataColumn.base52]} ...@@ -3532,22 +3606,23 @@ ${obj[dataColumn.base52]}
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 ( if (
(!valueThis || !JSON.stringify(valueThis).includes('address')) && (!valueThis || !JSON.stringify(valueThis)
required .includes('address')) &&
) { required
errors.push(new Error('请获取定位信息', rule.field)); ) {
} errors.push(new Error('请获取定位信息', rule.field));
callback(errors); }
}, callback(errors);
}, },
], },
],
})( })(
<LocationCom <LocationCom
get={get} get={get}
...@@ -3633,12 +3708,12 @@ ${obj[dataColumn.base52]} ...@@ -3633,12 +3708,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请上传图片', message: '请上传图片',
}, },
], ],
})(<ImgUploadCom json={json} disabled={disabled} />); })(<ImgUploadCom json={json} disabled={disabled}/>);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3664,12 +3739,12 @@ ${obj[dataColumn.base52]} ...@@ -3664,12 +3739,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请上传视频', message: '请上传视频',
}, },
], ],
})(<VideoUploadCom json={json} disabled={disabled} />); })(<VideoUploadCom json={json} disabled={disabled}/>);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3695,12 +3770,12 @@ ${obj[dataColumn.base52]} ...@@ -3695,12 +3770,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请进行签名', message: '请进行签名',
}, },
], ],
})(<Signature width={json.width} height={json.height} get={get} />); })(<Signature width={json.width} height={json.height} get={get}/>);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3920,7 +3995,7 @@ ${obj[dataColumn.base52]} ...@@ -3920,7 +3995,7 @@ ${obj[dataColumn.base52]}
label={title} label={title}
data-cell-component-name={json.comName || 'no_com'} data-cell-component-name={json.comName || 'no_com'}
> >
<ShowComName json={json} /> <ShowComName json={json}/>
{cm} {cm}
</Form.Item> </Form.Item>
</> </>
...@@ -4015,12 +4090,12 @@ ${obj[dataColumn.base52]} ...@@ -4015,12 +4090,12 @@ ${obj[dataColumn.base52]}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
> >
<ShowComName json={json} /> <ShowComName json={json}/>
{cm} {cm}
</Form.Item> </Form.Item>
) : ( ) : (
<Form.Item> <Form.Item>
<ShowComName json={json} /> <ShowComName json={json}/>
{cm} {cm}
</Form.Item> </Form.Item>
) )
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论