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

28974 辅导员考核相关需求,有疑问联系我

onestop 增加 步骤条组件
上级 cdcb10b2
import React, { useState, useEffect, useMemo, useCallback } from 'react'; import React, { useState, useEffect, useMemo, useCallback } from 'react';
import { Steps } from 'antd'; import { Steps } from 'antd';
import ZdyTable from '@/webPublic/one_stop_public/Table';
const { Step } = Steps; const { Step } = Steps;
export default function StepDiy(props) { export default function StepDiy(props) {
const { value, onChange, json, form } = props; const { value, json, partFormProps, dataColumn, onChange } = props;
const diyProps = useMemo(() => { const diyProps = useMemo(() => {
let b = {}; let b = {};
if (value && typeof value === 'object') { if (value && typeof value === 'object') {
b = { b = {
...value, ...value,
}; };
delete b.formValues;
} }
if (json.otherProps && typeof json.otherProps === 'string') { if (json.otherProps && typeof json.otherProps === 'string') {
try { try {
...@@ -30,21 +32,65 @@ export default function StepDiy(props) { ...@@ -30,21 +32,65 @@ export default function StepDiy(props) {
} }
}, [json.otherProps, value]); }, [json.otherProps, value]);
/** const [current, setCurrent] = useState(diyProps?.StepsProps?.current || 0);
* 按姚鑫国的要求 在切换步骤时将表单的值保存起来 const [formValues, setFormValues] = useState({});
* */
const partFormKey = useMemo(() => {
if (typeof current !== 'undefined') {
let item = diyProps.Step.find((g, index) => {
return index === current;
});
if (item) {
return item.formKey;
}
}
return undefined;
}, [current]);
useEffect(() => { useEffect(() => {
console.log(JSON.stringify(form.getFieldsValue())); if (diyProps?.StepsProps?.current !== current) {
}, [diyProps?.StepsProps.current]); const oldValues = partFormProps.form.getFieldsValue();
let newV = {
...oldValues,
};
delete newV[dataColumn.base52];
setFormValues({
...formValues,
...newV,
});
}
setCurrent(diyProps?.StepsProps?.current);
}, [diyProps?.StepsProps?.current]);
useEffect(() => {
onChange({
...value,
formValues,
})
}, [formValues]);
console.log(value);
return ( return (
<div style={diyProps.outSideDivStyle}> <div style={diyProps.outSideDivStyle}>
<Steps {...diyProps.StepsProps}> <Steps {...diyProps.StepsProps}
current={current}>
{Array.isArray(diyProps.Step) && {Array.isArray(diyProps.Step) &&
diyProps.Step.map(g => { diyProps.Step.map(g => {
return <Step {...g} key={g.title} />; return <Step {...g} key={g.title} />;
})} })}
</Steps> </Steps>
{!!partFormKey && (
<div>
<ZdyTable
{...partFormProps}
currentFormTitle={'Steps组件的子表单' + partFormKey}
key={partFormKey}
currentFormKey={partFormKey}
{...partFormProps?.datas[partFormKey]}
/>
</div>
)}
</div> </div>
); );
} }
...@@ -80,16 +80,11 @@ import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUp ...@@ -80,16 +80,11 @@ 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 import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength'; import getPopupContainer from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
import getPopupContainer
from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
import StepDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/StepDiy'; import StepDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/StepDiy';
const { const { MonthPicker, WeekPicker } = DatePicker;
MonthPicker,
WeekPicker,
} = DatePicker;
/** /**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选 * 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
*/ */
...@@ -111,12 +106,7 @@ const giveRender = (column = {}) => { ...@@ -111,12 +106,7 @@ const giveRender = (column = {}) => {
return column; return column;
}; };
@connect(({ @connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
DataColumn,
SqlManageEntity,
formList,
loading,
}) => ({
DataColumn, DataColumn,
SqlManageEntity, SqlManageEntity,
formList, formList,
...@@ -163,13 +153,12 @@ export default class TableCom extends Component { ...@@ -163,13 +153,12 @@ export default class TableCom extends Component {
}); });
}; };
changeTabsActiveKey = (activeKey) => { changeTabsActiveKey = activeKey => {
this.setState({ this.setState({
activeKey, activeKey,
}); });
}; };
showModal = (fk, title, data, modalProps) => { showModal = (fk, title, data, modalProps) => {
// console.log(fk, title, data, modalProps); // console.log(fk, title, data, modalProps);
...@@ -230,12 +219,7 @@ export default class TableCom extends Component { ...@@ -230,12 +219,7 @@ 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 => {
...@@ -252,11 +236,11 @@ export default class TableCom extends Component { ...@@ -252,11 +236,11 @@ 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,
...@@ -267,20 +251,20 @@ export default class TableCom extends Component { ...@@ -267,20 +251,20 @@ export default class TableCom extends Component {
<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]
.toString() .toString()
.toLowerCase() .toLowerCase()
.includes(value.toLowerCase()) .includes(value.toLowerCase())
: '', : '',
onFilterDropdownVisibleChange: visible => { onFilterDropdownVisibleChange: visible => {
if (visible) { if (visible) {
...@@ -322,11 +306,7 @@ export default class TableCom extends Component { ...@@ -322,11 +306,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;
} }
...@@ -384,7 +364,7 @@ export default class TableCom extends Component { ...@@ -384,7 +364,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;
...@@ -406,9 +386,9 @@ export default class TableCom extends Component { ...@@ -406,9 +386,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) {
...@@ -439,10 +419,7 @@ export default class TableCom extends Component { ...@@ -439,10 +419,7 @@ 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 { const { formKey, uuid } = this.props;
formKey,
uuid,
} = this.props;
let jsonStatic = json; let jsonStatic = json;
json = { json = {
...jsonStatic, ...jsonStatic,
...@@ -453,10 +430,7 @@ export default class TableCom extends Component { ...@@ -453,10 +430,7 @@ 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',
...@@ -478,8 +452,7 @@ export default class TableCom extends Component { ...@@ -478,8 +452,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);
...@@ -516,8 +489,7 @@ export default class TableCom extends Component { ...@@ -516,8 +489,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 = {
...@@ -563,8 +535,7 @@ export default class TableCom extends Component { ...@@ -563,8 +535,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);
...@@ -694,7 +665,7 @@ export default class TableCom extends Component { ...@@ -694,7 +665,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,
); );
} }
...@@ -788,7 +759,7 @@ export default class TableCom extends Component { ...@@ -788,7 +759,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,
); );
} }
...@@ -803,79 +774,78 @@ export default class TableCom extends Component { ...@@ -803,79 +774,78 @@ export default class TableCom extends Component {
delete params[i]; delete params[i];
} }
} }
noPrefixRequest(url, params) noPrefixRequest(url, params).then(data => {
.then(data => { // if (!data || !Array.isArray(data)) {
// if (!data || !Array.isArray(data)) { // data = [];
// data = []; // }
// } const { reqUrls } = this.state;
const { reqUrls } = this.state; if (reqUrls && reqUrls[url]) {
if (reqUrls && reqUrls[url]) { reqUrls[url].data = data;
reqUrls[url].data = data; }
} this.setState(
this.setState( {
{ res: data,
res: data, reqUrls,
reqUrls, },
}, () => {
() => { 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') {
} else if (json.comName == 'Button') { try {
try { callback(data);
callback(data); } 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 .props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, e,
e, );
); }
} else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
} }
} else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) { } catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else {
if (base52) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { // console.log(x, '757');
this.setState({ option: x }); if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
}
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this `页面${this.props.currentFormTitle} ${this.props.formKey} ${
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, json.comName
}${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';
}; };
...@@ -1006,46 +976,58 @@ export default class TableCom extends Component { ...@@ -1006,46 +976,58 @@ 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 }); if (data == null) {
if (data == null) { return;
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') { } else if (json.comName == 'Button') {
try { try {
callback(data); callback(data);
} 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
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, .props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e, e,
); );
}
} else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
} }
} else if (['Echart', 'QRCode', 'Graph', 'Tabs'].includes(json.comName)) { } catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else {
if (base52) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { // console.log(x, 938);
this.setState({ option: x }); if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: 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
...@@ -1053,23 +1035,10 @@ export default class TableCom extends Component { ...@@ -1053,23 +1035,10 @@ 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';
...@@ -1108,7 +1077,6 @@ export default class TableCom extends Component { ...@@ -1108,7 +1077,6 @@ export default class TableCom extends Component {
}; };
} }
let obj = {}; let obj = {};
if (!isEdit && fatherCode) { if (!isEdit && fatherCode) {
obj = { obj = {
...@@ -1178,7 +1146,6 @@ export default class TableCom extends Component { ...@@ -1178,7 +1146,6 @@ export default class TableCom extends Component {
messageData, messageData,
concealModel, concealModel,
}; };
}; };
getFunctionValue = (fun, column, json, callback) => { getFunctionValue = (fun, column, json, callback) => {
...@@ -1270,19 +1237,14 @@ export default class TableCom extends Component { ...@@ -1270,19 +1237,14 @@ 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 { const { json, mapData, obj, init } = this.props;
json,
mapData,
obj,
init,
} = this.props;
if (json == null) { if (json == null) {
return; return;
} }
...@@ -1303,9 +1265,9 @@ export default class TableCom extends Component { ...@@ -1303,9 +1265,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) {
...@@ -1327,13 +1289,7 @@ export default class TableCom extends Component { ...@@ -1327,13 +1289,7 @@ export default class TableCom extends Component {
} }
fetchData3 = (obj, dataColumn, init, json, allValues) => { fetchData3 = (obj, dataColumn, init, json, allValues) => {
const { const { sqlKey, labelName, valueName, isMeta, filterSql } = json;
sqlKey,
labelName,
valueName,
isMeta,
filterSql,
} = json;
if (isMeta) { if (isMeta) {
// 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
// 解决禅道bug 28017 // 解决禅道bug 28017
...@@ -1573,10 +1529,7 @@ export default class TableCom extends Component { ...@@ -1573,10 +1529,7 @@ 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;
...@@ -1632,20 +1585,8 @@ export default class TableCom extends Component { ...@@ -1632,20 +1585,8 @@ export default class TableCom extends Component {
// console.log(formKey, json); // console.log(formKey, json);
// } // }
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 === '账号') {
...@@ -1683,53 +1624,64 @@ export default class TableCom extends Component { ...@@ -1683,53 +1624,64 @@ 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 (['PartForm', 'Steps'].includes(json.comName)) {
this.partFormProps = {
taskId: this.props.taskId,
importExcel: this.props.importExcel,
setRealTimeValues: this.props.setRealTimeValues,
hfInstance: this.props.hfInstance,
getCellValue: getCellValue,
taskAssignee: taskAssignee,
isWebPrint: this.props.isWebPrint || false,
userId: userId,
isPreview: isPreview,
modalInit: modalInit,
datas: datas,
trees: this.props.trees,
get: get,
isChild: true,
isEdit: isEdit,
obj: obj,
init: init,
formCode: this.props.formCode,
formId: this.props.formId,
form: this.props.form,
mapData: mapData,
sqlData: sqlData,
defaultValues: defaultValues,
// currentFormTitle={
// this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null
// }
// key={fk}
// currentFormKey={fk}
// {...datas[fk]}
};
}
if (json.comName == 'PartForm') { if (json.comName === 'PartForm') {
const fk = this.props.form.getFieldsValue()[uuid] || json.childFormKey; const fk = this.props.form.getFieldsValue()[uuid] || json.childFormKey;
if (fk == null) { if (fk == null) {
return <></>; return <></>;
} }
if (formKey == fk) { if (formKey === fk) {
return <>片段表单key不能和自身相同</>; return <>片段表单key不能和自身相同</>;
} }
return ( return (
<> <>
{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} {...this.partFormProps}
importExcel={this.props.importExcel}
setRealTimeValues={this.props.setRealTimeValues}
hfInstance={this.props.hfInstance}
currentFormTitle={ currentFormTitle={
this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null
} }
getCellValue={getCellValue}
taskAssignee={taskAssignee}
isWebPrint={this.props.isWebPrint || false}
userId={userId}
key={fk} key={fk}
isPreview={isPreview}
modalInit={modalInit}
datas={datas}
trees={this.props.trees}
get={get}
isChild={true}
currentFormKey={fk} currentFormKey={fk}
isEdit={isEdit}
obj={obj}
init={init}
formCode={this.props.formCode}
formId={this.props.formId}
form={this.props.form}
mapData={mapData}
sqlData={sqlData}
{...datas[fk]} {...datas[fk]}
defaultValues={defaultValues}
/> />
</> </>
); );
...@@ -1775,7 +1727,7 @@ export default class TableCom extends Component { ...@@ -1775,7 +1727,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' : '',
...@@ -1792,7 +1744,7 @@ export default class TableCom extends Component { ...@@ -1792,7 +1744,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' : '',
...@@ -1884,8 +1836,7 @@ export default class TableCom extends Component { ...@@ -1884,8 +1836,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>
) : ( ) : (
...@@ -1901,7 +1852,7 @@ export default class TableCom extends Component { ...@@ -1901,7 +1852,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={queryFileUrl(f.path)}> <a target="_blank" key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -1921,7 +1872,7 @@ export default class TableCom extends Component { ...@@ -1921,7 +1872,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={queryFileUrl(f.path)}> <a target="_blank" key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -2014,7 +1965,7 @@ export default class TableCom extends Component { ...@@ -2014,7 +1965,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" />)}
</> </>
); );
} }
...@@ -2027,7 +1978,7 @@ export default class TableCom extends Component { ...@@ -2027,7 +1978,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" />)}
</> </>
); );
} }
...@@ -2121,7 +2072,7 @@ export default class TableCom extends Component { ...@@ -2121,7 +2072,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" />)}
</> </>
); );
} }
...@@ -2134,7 +2085,7 @@ export default class TableCom extends Component { ...@@ -2134,7 +2085,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" />)}
</> </>
); );
} }
...@@ -2150,9 +2101,9 @@ export default class TableCom extends Component { ...@@ -2150,9 +2101,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;
...@@ -2215,12 +2166,15 @@ export default class TableCom extends Component { ...@@ -2215,12 +2166,15 @@ export default class TableCom extends Component {
if (!value || value === 'null') { if (!value || value === 'null') {
return <div />; return <div />;
} }
cm = <MobileCard value={value} cm = (
json={json} <MobileCard
getArguments={this.functionArguments} value={value}
tableComProps={this.props} json={json}
dataColumn={dataColumn} getArguments={this.functionArguments}
/>; tableComProps={this.props}
dataColumn={dataColumn}
/>
);
break; break;
case 'WangEditor': case 'WangEditor':
let textV = obj[dataColumn.base52]; let textV = obj[dataColumn.base52];
...@@ -2290,18 +2244,18 @@ ${obj[dataColumn.base52]} ...@@ -2290,18 +2244,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>
); );
...@@ -2329,7 +2283,7 @@ ${obj[dataColumn.base52]} ...@@ -2329,7 +2283,7 @@ ${obj[dataColumn.base52]}
<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}
/> />
...@@ -2361,15 +2315,13 @@ ${obj[dataColumn.base52]} ...@@ -2361,15 +2315,13 @@ ${obj[dataColumn.base52]}
} 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>
); );
} }
...@@ -2383,16 +2335,14 @@ ${obj[dataColumn.base52]} ...@@ -2383,16 +2335,14 @@ ${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)) {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',
) )
: ''} : ''}
...@@ -2437,18 +2387,18 @@ ${obj[dataColumn.base52]} ...@@ -2437,18 +2387,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>
); );
} }
...@@ -2500,7 +2450,7 @@ ${obj[dataColumn.base52]} ...@@ -2500,7 +2450,7 @@ ${obj[dataColumn.base52]}
} }
return ( return (
<li key={index2}> <li key={index2}>
<a target='_blank' key={f.path} href={queryFileUrl(f.path)}> <a target="_blank" key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -2513,26 +2463,26 @@ ${obj[dataColumn.base52]} ...@@ -2513,26 +2463,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}>
<FilePreview <a target="_blank" key={f.filePath} href={queryFileUrl(f.filePath)}>
path={queryFileUrl(f.path)} {f.fileName}
pathName={f.name} </a>
type={'UploadCom'}
/>
</li> </li>
); );
} })}
return (
<li key={index2}>
<a target='_blank' key={f.filePath} href={queryFileUrl(f.filePath)}>
{f.fileName}
</a>
</li>
);
})}
</ul> </ul>
); );
} }
...@@ -2630,14 +2580,14 @@ ${obj[dataColumn.base52]} ...@@ -2630,14 +2580,14 @@ ${obj[dataColumn.base52]}
marginLeft: 5, marginLeft: 5,
width: width:
get === 'mobile' get === 'mobile'
? document.documentElement.clientWidth - 10 || document.body.clientWidth - 10 ? document.documentElement.clientWidth - 10 ||
document.body.clientWidth - 10
: json.width, : json.width,
height: get === 'mobile' ? '' : json.height, height: get === 'mobile' ? '' : json.height,
}} }}
/> />
); );
} }
} }
break; break;
...@@ -2698,7 +2648,7 @@ ${obj[dataColumn.base52]} ...@@ -2698,7 +2648,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <ButtonDiy loading={this.props.loading} type='primary' {...ev} />; cm = <ButtonDiy loading={this.props.loading} type="primary" {...ev} />;
} }
} }
...@@ -2781,7 +2731,7 @@ ${obj[dataColumn.base52]} ...@@ -2781,7 +2731,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <ButtonDiy loading={this.props.loading} type='primary' {...ev} />; cm = <ButtonDiy loading={this.props.loading} type="primary" {...ev} />;
} }
} }
...@@ -2807,11 +2757,11 @@ ${obj[dataColumn.base52]} ...@@ -2807,11 +2757,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 => {
...@@ -2838,11 +2788,11 @@ ${obj[dataColumn.base52]} ...@@ -2838,11 +2788,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,
}, },
], ],
})(<SwitchWeb json={json} disabled={disabled} />); })(<SwitchWeb json={json} disabled={disabled} />);
break; break;
...@@ -2922,10 +2872,7 @@ ${obj[dataColumn.base52]} ...@@ -2922,10 +2872,7 @@ ${obj[dataColumn.base52]}
otherProps = {}; otherProps = {};
} }
} }
const { const { disabledInputStyle = {}, addonAfter } = otherProps;
disabledInputStyle = {},
addonAfter,
} = otherProps;
let inputStyle = { let inputStyle = {
width: json.width, width: json.width,
}; };
...@@ -2975,7 +2922,7 @@ ${obj[dataColumn.base52]} ...@@ -2975,7 +2922,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) {
...@@ -2992,11 +2939,11 @@ ${obj[dataColumn.base52]} ...@@ -2992,11 +2939,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}
...@@ -3042,14 +2989,12 @@ ${obj[dataColumn.base52]} ...@@ -3042,14 +2989,12 @@ ${obj[dataColumn.base52]}
const tabPaneProps = configOption.tabPaneProps || {}; const tabPaneProps = configOption.tabPaneProps || {};
let activeKey = this.state.activeKey || configOption.data[0].key; let activeKey = this.state.activeKey || configOption.data[0].key;
console.log(configOption); console.log(configOption);
cm = <Tabs cm = (
onChange={this.changeTabsActiveKey} <Tabs onChange={this.changeTabsActiveKey} activeKey={activeKey} {...tabsProps}>
activeKey={activeKey} {configOption.data.map(r => {
{...tabsProps}> return (
{configOption.data.map((r) => { <Tabs.TabPane tab={r.title} key={r.key} {...tabPaneProps}>
return ( {activeKey === r.key ? (
<Tabs.TabPane tab={r.title} key={r.key} {...tabPaneProps}>
{activeKey === r.key ? (
<ZdyTable <ZdyTable
changedValues={this.props.changedValues} changedValues={this.props.changedValues}
setRealTimeValues={this.props.setRealTimeValues} setRealTimeValues={this.props.setRealTimeValues}
...@@ -3072,7 +3017,7 @@ ${obj[dataColumn.base52]} ...@@ -3072,7 +3017,7 @@ ${obj[dataColumn.base52]}
{...datas[r.key]} {...datas[r.key]}
defaultValues={defaultValues} defaultValues={defaultValues}
/> />
/** ) : /**
<ZdyTable <ZdyTable
key={r} key={r}
modalInit={modalInit} modalInit={modalInit}
...@@ -3102,11 +3047,12 @@ ${obj[dataColumn.base52]} ...@@ -3102,11 +3047,12 @@ ${obj[dataColumn.base52]}
defaultValues={defaultValues} defaultValues={defaultValues}
/> />
* */ * */
) : null} null}
</Tabs.TabPane> </Tabs.TabPane>
); );
})} })}
</Tabs>; </Tabs>
);
break; break;
/** /**
* 为Radio为单选 * 为Radio为单选
...@@ -3118,11 +3064,11 @@ ${obj[dataColumn.base52]} ...@@ -3118,11 +3064,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,
}, },
], ],
})(<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>;
...@@ -3151,18 +3097,18 @@ ${obj[dataColumn.base52]} ...@@ -3151,18 +3097,18 @@ ${obj[dataColumn.base52]}
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:
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>
); );
...@@ -3193,11 +3139,11 @@ ${obj[dataColumn.base52]} ...@@ -3193,11 +3139,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}
...@@ -3222,11 +3168,11 @@ ${obj[dataColumn.base52]} ...@@ -3222,11 +3168,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
...@@ -3234,48 +3180,47 @@ ${obj[dataColumn.base52]} ...@@ -3234,48 +3180,47 @@ ${obj[dataColumn.base52]}
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, uuid)} getPopupContainer={getPopupContainer(this.props.isDynamic, uuid)}
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() ? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
.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 (
...@@ -3313,8 +3258,7 @@ ${obj[dataColumn.base52]} ...@@ -3313,8 +3258,7 @@ ${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() option => option?.label?.toLowerCase()?.indexOf(inputValue.toLowerCase()) > -1,
?.indexOf(inputValue.toLowerCase()) > -1,
); );
}; };
// if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){ // if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){
...@@ -3331,11 +3275,11 @@ ${obj[dataColumn.base52]} ...@@ -3331,11 +3275,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}
...@@ -3357,11 +3301,11 @@ ${obj[dataColumn.base52]} ...@@ -3357,11 +3301,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,
}, },
], ],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json} />); })(<MobileCascader options={options} label={title} disabled={disabled} json={json} />);
} }
...@@ -3394,22 +3338,22 @@ ${obj[dataColumn.base52]} ...@@ -3394,22 +3338,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}
...@@ -3467,15 +3411,13 @@ ${obj[dataColumn.base52]} ...@@ -3467,15 +3411,13 @@ ${obj[dataColumn.base52]}
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>
); );
} else { } else {
...@@ -3486,11 +3428,11 @@ ${obj[dataColumn.base52]} ...@@ -3486,11 +3428,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}
...@@ -3527,11 +3469,11 @@ ${obj[dataColumn.base52]} ...@@ -3527,11 +3469,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: '请选择起止时间',
}, },
], ],
})(<RangePickerDiy json={json} disabled={disabled} uuid={uuid} />); })(<RangePickerDiy json={json} disabled={disabled} uuid={uuid} />);
} }
if (json.label == null) title = '起止时间'; if (json.label == null) title = '起止时间';
...@@ -3559,11 +3501,11 @@ ${obj[dataColumn.base52]} ...@@ -3559,11 +3501,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}
...@@ -3572,22 +3514,21 @@ ${obj[dataColumn.base52]} ...@@ -3572,22 +3514,21 @@ ${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 ')
.removeAttribute('readonly'); .setAttribute('readonly', '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}
...@@ -3624,11 +3565,11 @@ ${obj[dataColumn.base52]} ...@@ -3624,11 +3565,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}
...@@ -3713,22 +3654,25 @@ ${obj[dataColumn.base52]} ...@@ -3713,22 +3654,25 @@ ${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 'Steps': case 'Steps':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
})(<StepDiy json={json} })(
dataColumn={dataColumn} <StepDiy
disabled={disabled} json={json}
uuid={uuid} dataColumn={dataColumn}
form={this.props.form} disabled={disabled}
/>); uuid={uuid}
partFormProps={this.partFormProps}
/>,
);
break; break;
case 'MobileCard': case 'MobileCard':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3740,7 +3684,8 @@ ${obj[dataColumn.base52]} ...@@ -3740,7 +3684,8 @@ ${obj[dataColumn.base52]}
getArguments={this.functionArguments} getArguments={this.functionArguments}
tableComProps={this.props} tableComProps={this.props}
dataColumn={dataColumn} dataColumn={dataColumn}
/>); />,
);
break; break;
case 'RichText': case 'RichText':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3749,11 +3694,11 @@ ${obj[dataColumn.base52]} ...@@ -3749,11 +3694,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: '请输入',
}, },
], ],
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled} />); })(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
...@@ -3780,11 +3725,11 @@ ${obj[dataColumn.base52]} ...@@ -3780,11 +3725,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,
}, },
], ],
})(<CronEditorDiy />); })(<CronEditorDiy />);
break; break;
case 'LocationCom': case 'LocationCom':
...@@ -3794,23 +3739,22 @@ ${obj[dataColumn.base52]} ...@@ -3794,23 +3739,22 @@ ${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) (!valueThis || !JSON.stringify(valueThis).includes('address')) &&
.includes('address')) && required
required ) {
) { errors.push(new Error('请获取定位信息', rule.field));
errors.push(new Error('请获取定位信息', rule.field)); }
} callback(errors);
callback(errors); },
}, },
}, ],
],
})( })(
<LocationCom <LocationCom
get={get} get={get}
...@@ -3896,11 +3840,11 @@ ${obj[dataColumn.base52]} ...@@ -3896,11 +3840,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: '请上传图片',
}, },
], ],
})(<ImgUploadCom json={json} disabled={disabled} />); })(<ImgUploadCom json={json} disabled={disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
...@@ -3927,11 +3871,11 @@ ${obj[dataColumn.base52]} ...@@ -3927,11 +3871,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: '请上传视频',
}, },
], ],
})(<VideoUploadCom json={json} disabled={disabled} />); })(<VideoUploadCom json={json} disabled={disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
...@@ -3958,11 +3902,11 @@ ${obj[dataColumn.base52]} ...@@ -3958,11 +3902,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: '请进行签名',
}, },
], ],
})(<Signature width={json.width} height={json.height} get={get} />); })(<Signature width={json.width} height={json.height} get={get} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论