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

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

onestop 增加 步骤条组件
上级 cdcb10b2
import React, { useState, useEffect, useMemo, useCallback } from 'react';
import { Steps } from 'antd';
import ZdyTable from '@/webPublic/one_stop_public/Table';
const { Step } = Steps;
export default function StepDiy(props) {
const { value, onChange, json, form } = props;
const { value, json, partFormProps, dataColumn, onChange } = props;
const diyProps = useMemo(() => {
let b = {};
if (value && typeof value === 'object') {
b = {
...value,
};
delete b.formValues;
}
if (json.otherProps && typeof json.otherProps === 'string') {
try {
......@@ -30,21 +32,65 @@ export default function StepDiy(props) {
}
}, [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(() => {
console.log(JSON.stringify(form.getFieldsValue()));
}, [diyProps?.StepsProps.current]);
if (diyProps?.StepsProps?.current !== 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 (
<div style={diyProps.outSideDivStyle}>
<Steps {...diyProps.StepsProps}>
<Steps {...diyProps.StepsProps}
current={current}>
{Array.isArray(diyProps.Step) &&
diyProps.Step.map(g => {
return <Step {...g} key={g.title} />;
})}
</Steps>
{!!partFormKey && (
<div>
<ZdyTable
{...partFormProps}
currentFormTitle={'Steps组件的子表单' + partFormKey}
key={partFormKey}
currentFormKey={partFormKey}
{...partFormProps?.datas[partFormKey]}
/>
</div>
)}
</div>
);
}
......@@ -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 CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index';
import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy';
import giveVarcharRules
from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
import getPopupContainer
from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
import getPopupContainer from '@/webPublic/one_stop_public/tableCompon/Split_Index/getPopupContainer';
import StepDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/StepDiy';
const {
MonthPicker,
WeekPicker,
} = DatePicker;
const { MonthPicker, WeekPicker } = DatePicker;
/**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
*/
......@@ -111,12 +106,7 @@ const giveRender = (column = {}) => {
return column;
};
@connect(({
DataColumn,
SqlManageEntity,
formList,
loading,
}) => ({
@connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
DataColumn,
SqlManageEntity,
formList,
......@@ -163,13 +153,12 @@ export default class TableCom extends Component {
});
};
changeTabsActiveKey = (activeKey) => {
changeTabsActiveKey = activeKey => {
this.setState({
activeKey,
});
};
showModal = (fk, title, data, modalProps) => {
// console.log(fk, title, data, modalProps);
......@@ -230,12 +219,7 @@ export default class TableCom extends Component {
};
getColumnSearchProps = (dataIndex, title) => ({
filterDropdown: ({
setSelectedKeys,
selectedKeys,
confirm,
clearFilters,
}) => (
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
<div style={{ padding: 8 }}>
<Input
ref={node => {
......@@ -252,11 +236,11 @@ export default class TableCom extends Component {
}}
/>
<Button
type='primary'
type="primary"
onClick={() => this.handleSearch(selectedKeys, confirm)}
icon='search'
icon="search"
loading={this.props.loading}
size='small'
size="small"
style={{
width: 90,
marginRight: 8,
......@@ -267,20 +251,20 @@ export default class TableCom extends Component {
<Button
loading={this.props.loading}
onClick={() => this.handleReset(clearFilters)}
size='small'
size="small"
style={{ width: 90 }}
>
重置
</Button>
</div>
),
filterIcon: filtered => <Icon type='search' style={{ color: filtered ? '#1890ff' : 'red' }} />,
filterIcon: filtered => <Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }} />,
onFilter: (value, record) =>
record[dataIndex]
? record[dataIndex]
.toString()
.toLowerCase()
.includes(value.toLowerCase())
.toString()
.toLowerCase()
.includes(value.toLowerCase())
: '',
onFilterDropdownVisibleChange: visible => {
if (visible) {
......@@ -322,11 +306,7 @@ export default class TableCom extends Component {
};
componentWillReceiveProps(props) {
const {
json,
mapData,
obj,
} = props;
const { json, mapData, obj } = props;
if (json == null || this.props.safe) {
return;
}
......@@ -384,7 +364,7 @@ export default class TableCom extends Component {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props
.i + 1}行,第${this.props.j +
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
);
return;
......@@ -406,9 +386,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null) {
......@@ -439,10 +419,7 @@ export default class TableCom extends Component {
dataFilter = ['Select', 'Radio', 'Checkbox', 'Cascader'];
getData = (json, dataColumn, obj, init) => {
const {
formKey,
uuid,
} = this.props;
const { formKey, uuid } = this.props;
let jsonStatic = json;
json = {
...jsonStatic,
......@@ -453,10 +430,7 @@ export default class TableCom extends Component {
allValues = JSON.stringify(allValues);
if (json.comName === 'TableSelect') {
const { dispatch } = this.props;
const {
sqlKey,
optionType,
} = json;
const { sqlKey, optionType } = json;
if (optionType === 'sql') {
dispatch({
type: 'SqlManageEntity/find',
......@@ -478,8 +452,7 @@ export default class TableCom extends Component {
if (
['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)
) {
column.render = val => moment(val)
.format('YYYY-MM-DD HH:mm:ss');
column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
}
column = giveRender(column);
......@@ -516,8 +489,7 @@ export default class TableCom extends Component {
break;
}
column.render = val => moment(parseInt(val))
.format(ff);
column.render = val => moment(parseInt(val)).format(ff);
}
if (cll[k].isQuery) {
column = {
......@@ -563,8 +535,7 @@ export default class TableCom extends Component {
column.title = datas[i].title;
column.dataIndex = datas[i].name;
if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) {
column.render = val => moment(val)
.format('YYYY-MM-DD HH:mm:ss');
column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
}
column = giveRender(column);
columns.push(column);
......@@ -694,7 +665,7 @@ export default class TableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i +
1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -788,7 +759,7 @@ export default class TableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -803,79 +774,78 @@ export default class TableCom extends Component {
delete params[i];
}
}
noPrefixRequest(url, params)
.then(data => {
// if (!data || !Array.isArray(data)) {
// data = [];
// }
const { reqUrls } = this.state;
if (reqUrls && reqUrls[url]) {
reqUrls[url].data = data;
}
this.setState(
{
res: data,
reqUrls,
},
() => {
if (callback) {
if (json.optionType && json.optionType == 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState(
{
options: res,
selectDis: false,
},
() => {
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,
);
noPrefixRequest(url, params).then(data => {
// if (!data || !Array.isArray(data)) {
// data = [];
// }
const { reqUrls } = this.state;
if (reqUrls && reqUrls[url]) {
reqUrls[url].data = data;
}
this.setState(
{
res: data,
reqUrls,
},
() => {
if (callback) {
if (json.optionType && json.optionType == 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState(
{
options: res,
selectDis: false,
},
() => {
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', '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 {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
}
// 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}列:公式配置有误,回调函数内部错误,`,
`页面${this.props.currentFormTitle} ${this.props.formKey} ${
json.comName
}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
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';
};
......@@ -1006,46 +976,58 @@ export default class TableCom extends Component {
if (getToken() != null) {
pp.token = getToken();
}
uaaRequest(url, pp)
.then(data => {
const { sqlKeys } = this.state;
sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys });
if (data == null) {
return;
}
uaaRequest(url, pp).then(data => {
const { sqlKeys } = this.state;
sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys });
if (data == null) {
return;
}
if (callback) {
if (json.optionType && json.optionType === 'func') {
const res = callback(data);
if (callback) {
if (json.optionType && json.optionType === 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState(
{
options: res,
selectDis: false,
},
() => {
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,
);
if (res != null && !(typeof res === 'function')) {
this.setState(
{
options: res,
selectDis: false,
},
() => {
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', '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 {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
}
// 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
......@@ -1053,23 +1035,10 @@ export default class TableCom extends Component {
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';
......@@ -1108,7 +1077,6 @@ export default class TableCom extends Component {
};
}
let obj = {};
if (!isEdit && fatherCode) {
obj = {
......@@ -1178,7 +1146,6 @@ export default class TableCom extends Component {
messageData,
concealModel,
};
};
getFunctionValue = (fun, column, json, callback) => {
......@@ -1270,19 +1237,14 @@ export default class TableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i +
1}行,第${this.props.j + 1}列:公式配置有误,暂存失败,`,
1}行,第${this.props.j + 1}列:公式配置有误,暂存失败,`,
e,
);
}
};
componentDidMount() {
const {
json,
mapData,
obj,
init,
} = this.props;
const { json, mapData, obj, init } = this.props;
if (json == null) {
return;
}
......@@ -1303,9 +1265,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null) {
......@@ -1327,13 +1289,7 @@ export default class TableCom extends Component {
}
fetchData3 = (obj, dataColumn, init, json, allValues) => {
const {
sqlKey,
labelName,
valueName,
isMeta,
filterSql,
} = json;
const { sqlKey, labelName, valueName, isMeta, filterSql } = json;
if (isMeta) {
// 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
// 解决禅道bug 28017
......@@ -1573,10 +1529,7 @@ export default class TableCom extends Component {
}
};
getColumn = key => {
let {
mapData,
json,
} = this.props;
let { mapData, json } = this.props;
const columnIds = json?.columnIds;
......@@ -1632,20 +1585,8 @@ export default class TableCom extends Component {
// console.log(formKey, json);
// }
const {
options,
labels,
selectDis,
modalCode,
modalTitle,
modalInit,
modalProps,
} = this.state;
const {
getFieldDecorator,
getFieldError,
getFieldProps,
} = this.props.form;
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
const disabled = json != null ? json.disabled : false;
const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0;
if (json?.label === '账号') {
......@@ -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 || []} />;
}
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;
if (fk == null) {
return <></>;
}
if (formKey == fk) {
if (formKey === fk) {
return <>片段表单key不能和自身相同</>;
}
return (
<>
{this.props.form.getFieldDecorator(uuid, {
initialValue: fk,
})(<Input type='hidden' />)}{' '}
})(<Input type="hidden" />)}{' '}
<ZdyTable
taskId={this.props.taskId}
importExcel={this.props.importExcel}
setRealTimeValues={this.props.setRealTimeValues}
hfInstance={this.props.hfInstance}
{...this.partFormProps}
currentFormTitle={
this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null
}
getCellValue={getCellValue}
taskAssignee={taskAssignee}
isWebPrint={this.props.isWebPrint || false}
userId={userId}
key={fk}
isPreview={isPreview}
modalInit={modalInit}
datas={datas}
trees={this.props.trees}
get={get}
isChild={true}
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]}
defaultValues={defaultValues}
/>
</>
);
......@@ -1775,7 +1727,7 @@ export default class TableCom extends Component {
<>
{this.props.form.getFieldDecorator(uid, {
initialValue: obj[uuid] || json.initialValue,
})(<Input type='hidden' />)}
})(<Input type="hidden" />)}
<span
style={{
fontWeight: get === 'mobile' ? 'bold' : '',
......@@ -1792,7 +1744,7 @@ export default class TableCom extends Component {
<>
{this.props.form.getFieldDecorator(uid, {
initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue,
})(<Input type='hidden' />)}
})(<Input type="hidden" />)}
<span
style={{
fontWeight: get === 'mobile' ? 'bold' : '',
......@@ -1884,8 +1836,7 @@ export default class TableCom extends Component {
case 'DatePicker':
cm = value ? (
<span>
{moment(parseInt(value))
.format('YYYY-MM-DD HH:mm:ss')}
{moment(parseInt(value)).format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br /> : ''}
</span>
) : (
......@@ -1901,7 +1852,7 @@ export default class TableCom extends Component {
{filesX.map((f, index2) => {
return (
<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}
</a>
</li>
......@@ -1921,7 +1872,7 @@ export default class TableCom extends Component {
{files.map((f, index2) => {
return (
<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}
</a>
</li>
......@@ -2014,7 +1965,7 @@ export default class TableCom extends Component {
</MobileItem>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type='hidden' />)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2027,7 +1978,7 @@ export default class TableCom extends Component {
{cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type='hidden' />)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2121,7 +2072,7 @@ export default class TableCom extends Component {
</Form.Item>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type='hidden' />)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2134,7 +2085,7 @@ export default class TableCom extends Component {
{cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type='hidden' />)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2150,9 +2101,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${uuid}` }
: bindObj;
......@@ -2215,12 +2166,15 @@ export default class TableCom extends Component {
if (!value || value === 'null') {
return <div />;
}
cm = <MobileCard value={value}
json={json}
getArguments={this.functionArguments}
tableComProps={this.props}
dataColumn={dataColumn}
/>;
cm = (
<MobileCard
value={value}
json={json}
getArguments={this.functionArguments}
tableComProps={this.props}
dataColumn={dataColumn}
/>
);
break;
case 'WangEditor':
let textV = obj[dataColumn.base52];
......@@ -2290,18 +2244,18 @@ ${obj[dataColumn.base52]}
<span>
{labels != null
? labels.map((r, i) =>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
Object.values(r)
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
Object.values(r)
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
',' + Object.values(r)
),
)
',' + Object.values(r)
),
)
: ''}
</span>
);
......@@ -2329,7 +2283,7 @@ ${obj[dataColumn.base52]}
<Table
get={get}
columns={this.state.columns}
size='small'
size="small"
dataSource={ds}
pagination={false}
/>
......@@ -2361,15 +2315,13 @@ ${obj[dataColumn.base52]}
} else {
cm = (
<span>
{moment(parseInt(obj[begin.base52]))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{moment(parseInt(obj[begin.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '}
{moment(parseInt(obj[end.base52]))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
{moment(parseInt(obj[end.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
);
}
......@@ -2383,16 +2335,14 @@ ${obj[dataColumn.base52]}
if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) {
cm = (
<span>
{moment(parseInt(vTime))
.format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
{moment(parseInt(vTime)).format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
</span>
);
} else {
cm = (
<span>
{vTime
? moment(+new Date(vTime))
.format(
? moment(+new Date(vTime)).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
: ''}
......@@ -2437,18 +2387,18 @@ ${obj[dataColumn.base52]}
cm = (
<ul className={styles.imageUl}>
{Array.isArray(files) &&
files.map((f, index2) => {
return (
<li key={f.path}>
<PictureSignature
json={json}
disabled={true} // 只读模式
basicUrl={queryApiActionPath()}
fileInfo={f}
/>
</li>
);
})}
files.map((f, index2) => {
return (
<li key={f.path}>
<PictureSignature
json={json}
disabled={true} // 只读模式
basicUrl={queryApiActionPath()}
fileInfo={f}
/>
</li>
);
})}
</ul>
);
}
......@@ -2500,7 +2450,7 @@ ${obj[dataColumn.base52]}
}
return (
<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}
</a>
</li>
......@@ -2513,26 +2463,26 @@ ${obj[dataColumn.base52]}
cm = (
<ul className={styles.imageUl}>
{Array.isArray(files) &&
files.map((f, index2) => {
if (get === 'web' || !this.props.isPrint) {
files.map((f, index2) => {
if (get === 'web' || !this.props.isPrint) {
return (
<li key={index2}>
<FilePreview
path={queryFileUrl(f.path)}
pathName={f.name}
type={'UploadCom'}
/>
</li>
);
}
return (
<li key={index2}>
<FilePreview
path={queryFileUrl(f.path)}
pathName={f.name}
type={'UploadCom'}
/>
<a target="_blank" key={f.filePath} href={queryFileUrl(f.filePath)}>
{f.fileName}
</a>
</li>
);
}
return (
<li key={index2}>
<a target='_blank' key={f.filePath} href={queryFileUrl(f.filePath)}>
{f.fileName}
</a>
</li>
);
})}
})}
</ul>
);
}
......@@ -2630,14 +2580,14 @@ ${obj[dataColumn.base52]}
marginLeft: 5,
width:
get === 'mobile'
? document.documentElement.clientWidth - 10 || document.body.clientWidth - 10
? document.documentElement.clientWidth - 10 ||
document.body.clientWidth - 10
: json.width,
height: get === 'mobile' ? '' : json.height,
}}
/>
);
}
}
break;
......@@ -2698,7 +2648,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) {
cm = <a {...ev} />;
} 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]}
if (json.isLink) {
cm = <a {...ev} />;
} 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]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + title,
},
],
{
required: required,
message: '请选择' + title,
},
],
})}
disabled={disabled}
onClick={checked => {
......@@ -2838,11 +2788,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + title,
},
],
{
required: required,
message: '请选择' + title,
},
],
})(<SwitchWeb json={json} disabled={disabled} />);
break;
......@@ -2922,10 +2872,7 @@ ${obj[dataColumn.base52]}
otherProps = {};
}
}
const {
disabledInputStyle = {},
addonAfter,
} = otherProps;
const { disabledInputStyle = {}, addonAfter } = otherProps;
let inputStyle = {
width: json.width,
};
......@@ -2975,7 +2922,7 @@ ${obj[dataColumn.base52]}
case 'InputHidden':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
})(<Input type='hidden' />);
})(<Input type="hidden" />);
break;
case 'InputNumber':
if (json?.otherProps) {
......@@ -2992,11 +2939,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入' + title,
},
],
{
required: required,
message: '请输入' + title,
},
],
})(
<InputNumber
disabled={disabled}
......@@ -3042,14 +2989,12 @@ ${obj[dataColumn.base52]}
const tabPaneProps = configOption.tabPaneProps || {};
let activeKey = this.state.activeKey || configOption.data[0].key;
console.log(configOption);
cm = <Tabs
onChange={this.changeTabsActiveKey}
activeKey={activeKey}
{...tabsProps}>
{configOption.data.map((r) => {
return (
<Tabs.TabPane tab={r.title} key={r.key} {...tabPaneProps}>
{activeKey === r.key ? (
cm = (
<Tabs onChange={this.changeTabsActiveKey} activeKey={activeKey} {...tabsProps}>
{configOption.data.map(r => {
return (
<Tabs.TabPane tab={r.title} key={r.key} {...tabPaneProps}>
{activeKey === r.key ? (
<ZdyTable
changedValues={this.props.changedValues}
setRealTimeValues={this.props.setRealTimeValues}
......@@ -3072,7 +3017,7 @@ ${obj[dataColumn.base52]}
{...datas[r.key]}
defaultValues={defaultValues}
/>
/**
) : /**
<ZdyTable
key={r}
modalInit={modalInit}
......@@ -3102,11 +3047,12 @@ ${obj[dataColumn.base52]}
defaultValues={defaultValues}
/>
* */
) : null}
</Tabs.TabPane>
);
})}
</Tabs>;
null}
</Tabs.TabPane>
);
})}
</Tabs>
);
break;
/**
* 为Radio为单选
......@@ -3118,11 +3064,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<Radio.Group options={options} disabled={disabled} />);
if (get == 'mobile') {
cm = <div>{cm}</div>;
......@@ -3151,18 +3097,18 @@ ${obj[dataColumn.base52]}
case 'Checkbox':
if (get === 'mobile') {
cm = (
<Flex direction='column' align='start'>
<Flex direction="column" align="start">
{getFieldDecorator(dataColumn.base52, {
initialValue: initValue, // 默认值
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<Checkbox.Group options={options} disabled={disabled} />)}
</Flex>
);
......@@ -3193,11 +3139,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(
<Checkbox.Group
options={options}
......@@ -3222,11 +3168,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(
<Select
allowClear
......@@ -3234,48 +3180,47 @@ ${obj[dataColumn.base52]}
disabled={selectDis || disabled}
placeholder={json.placeholder}
style={{ width: json.width }}
optionFilterProp='children'
optionFilterProp="children"
getPopupContainer={getPopupContainer(this.props.isDynamic, uuid)}
onFocus={() => {
get === 'mobile' // 移动端取消输入键盘弹出
? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
: null;
}}
filterOption={(input, option) =>
option
? option.props.children.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false
}
{...otherProps}
>
{json.options && Array.isArray(json.options)
? json.options.map(r => {
return (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
);
})
return (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
);
})
: options && options instanceof Array
? options.map(r => (
? options.map(r => (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
: ''}
: ''}
</Select>,
);
if (
......@@ -3313,8 +3258,7 @@ ${obj[dataColumn.base52]}
}
const filterF = function filter(inputValue, path) {
return path.some(
option => option?.label?.toLowerCase()
?.indexOf(inputValue.toLowerCase()) > -1,
option => option?.label?.toLowerCase()?.indexOf(inputValue.toLowerCase()) > -1,
);
};
// if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){
......@@ -3331,11 +3275,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(
<Cascader // 这里的options 获取方式存在bug 公式会重复调用
options={options}
......@@ -3357,11 +3301,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json} />);
}
......@@ -3394,22 +3338,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
validator: (rule, value, callback) => {
let errors = [];
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
{
validator: (rule, value, callback) => {
let errors = [];
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
},
required: required,
},
required: required,
},
],
],
})(
<TableSelect
get={get}
......@@ -3467,15 +3411,13 @@ ${obj[dataColumn.base52]}
if (!isEdit) {
cm = (
<span>
{moment(parseInt(obj[begin.base52]))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{moment(parseInt(obj[begin.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '}
{moment(parseInt(obj[end.base52]))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
{moment(parseInt(obj[end.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
);
} else {
......@@ -3486,11 +3428,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择起止时间',
},
],
{
required: required,
message: '请选择起止时间',
},
],
})(
<MobileDate
disabled={disabled}
......@@ -3527,11 +3469,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择起止时间',
},
],
{
required: required,
message: '请选择起止时间',
},
],
})(<RangePickerDiy json={json} disabled={disabled} uuid={uuid} />);
}
if (json.label == null) title = '起止时间';
......@@ -3559,11 +3501,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择起止时间',
},
],
{
required: required,
message: '请选择起止时间',
},
],
})(
<DatePicker
disabled={disabled}
......@@ -3572,22 +3514,21 @@ ${obj[dataColumn.base52]}
onOpenChange={
get === 'mobile'
? () => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly');
setTimeout(() => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.removeAttribute('readonly');
});
}
});
}
: () => {
}
.setAttribute('readonly', 'readonly');
setTimeout(() => {
document
.querySelector('.ant-calendar-input ')
.removeAttribute('readonly');
});
}
});
}
: () => {}
}
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
{...otherProps}
......@@ -3624,11 +3565,11 @@ ${obj[dataColumn.base52]}
json?.vlds && json?.vlds.length > 0
? json.vlds
: [
{
required,
message: '请进行签章',
},
],
{
required,
message: '请进行签章',
},
],
})(
<SignArray // 签章组件 编辑模式
json={json}
......@@ -3713,22 +3654,25 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入',
},
],
{
required: required,
message: '请输入',
},
],
})(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid} />);
break;
case 'Steps':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
})(<StepDiy json={json}
dataColumn={dataColumn}
disabled={disabled}
uuid={uuid}
form={this.props.form}
/>);
})(
<StepDiy
json={json}
dataColumn={dataColumn}
disabled={disabled}
uuid={uuid}
partFormProps={this.partFormProps}
/>,
);
break;
case 'MobileCard':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -3740,7 +3684,8 @@ ${obj[dataColumn.base52]}
getArguments={this.functionArguments}
tableComProps={this.props}
dataColumn={dataColumn}
/>);
/>,
);
break;
case 'RichText':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -3749,11 +3694,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入',
},
],
{
required: required,
message: '请输入',
},
],
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled} />);
if (
get === 'mobile' &&
......@@ -3780,11 +3725,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入' + title,
},
],
{
required: required,
message: '请输入' + title,
},
],
})(<CronEditorDiy />);
break;
case 'LocationCom':
......@@ -3794,23 +3739,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required,
message: '请获取定位信息',
validator: (rule, valueThis, callback) => {
let errors = [];
console.log(valueThis);
if (
(!valueThis || !JSON.stringify(valueThis)
.includes('address')) &&
required
) {
errors.push(new Error('请获取定位信息', rule.field));
}
callback(errors);
{
required,
message: '请获取定位信息',
validator: (rule, valueThis, callback) => {
let errors = [];
console.log(valueThis);
if (
(!valueThis || !JSON.stringify(valueThis).includes('address')) &&
required
) {
errors.push(new Error('请获取定位信息', rule.field));
}
callback(errors);
},
},
},
],
],
})(
<LocationCom
get={get}
......@@ -3896,11 +3840,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请上传图片',
},
],
{
required: required,
message: '请上传图片',
},
],
})(<ImgUploadCom json={json} disabled={disabled} />);
if (
get === 'mobile' &&
......@@ -3927,11 +3871,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请上传视频',
},
],
{
required: required,
message: '请上传视频',
},
],
})(<VideoUploadCom json={json} disabled={disabled} />);
if (
get === 'mobile' &&
......@@ -3958,11 +3902,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请进行签名',
},
],
{
required: required,
message: '请进行签名',
},
],
})(<Signature width={json.width} height={json.height} get={get} />);
if (
get === 'mobile' &&
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论