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

27865 招生模板设置----必填项验证有误

上级 3d1b5c09
import { Switch } from 'antd';
import React, { useEffect } from 'react';
export default function SwitchWeb(props) {
const {
value,
onChange,
json,
disabled,
} = props;
const changeSw = (v) => {
onChange(v);
};
useEffect(() => {
if (typeof value !== 'boolean') {
if (value && value === 'true') {
onChange(true);
} else {
console.log(value);
onChange(false);
}
}
}, [value]);
return (
<Switch
disabled={disabled}
onChange={changeSw}
checkedChildren={json.checkedChildren}
unCheckedChildren={json.unCheckedChildren}
/>
);
}
......@@ -72,6 +72,7 @@ import { noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/r
import RangePickerDiy, { getMomentArr } from '@/webPublic/one_stop_public/tableCompon/Split_Index/RangePickerDiy';
import getActiveJson from '@/webPublic/one_stop_public/Table/getActiveJson';
import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUploadUrl';
import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb';
const {
MonthPicker,
......@@ -2642,6 +2643,11 @@ ${obj[dataColumn.base52]}
break;
case 'Switch':
if (initValue === 'true' || initValue === true) {
initValue = true;
} else{
initValue = false;
}
if (get === 'mobile') {
if (dataColumn == null || json.formula != null) {
cm = this.props.form.getFieldsValue()[uuid];
......@@ -2680,11 +2686,6 @@ ${obj[dataColumn.base52]}
);
break;
}
if (initValue === 'true') {
initValue = true;
} else if (initValue === 'false') {
initValue = false;
}
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
valuePropName: 'checked',
......@@ -2698,11 +2699,7 @@ ${obj[dataColumn.base52]}
},
],
})(
<Switch
disabled={disabled}
checkedChildren={json.checkedChildren}
unCheckedChildren={json.unCheckedChildren}
/>,
<SwitchWeb json={json} disabled={disabled}/>
);
break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论