Commit eb698edb authored by manzhenhua's avatar manzhenhua

修噶爱

parent 253d1568
...@@ -33,6 +33,7 @@ const EditForm = (props: any) => { ...@@ -33,6 +33,7 @@ const EditForm = (props: any) => {
rules = [], rules = [],
validateFirst = true, validateFirst = true,
validateTrigger = 'onChange', validateTrigger = 'onChange',
renderLabel,
} = item; } = item;
let detailConfig: any; let detailConfig: any;
if (typeof renderEditForm === 'function') { if (typeof renderEditForm === 'function') {
...@@ -50,7 +51,7 @@ const EditForm = (props: any) => { ...@@ -50,7 +51,7 @@ const EditForm = (props: any) => {
<FormItem <FormItem
name={columnName} name={columnName}
key={columnName} key={columnName}
label={columnChsName} label={renderLabel ? renderLabel(columnChsName) : columnChsName}
rules={[{ required: !!item.requiredFlag }, ...rules]} rules={[{ required: !!item.requiredFlag }, ...rules]}
initialValue={getFormat(detailConfig, item, value)} initialValue={getFormat(detailConfig, item, value)}
validateFirst={validateFirst} validateFirst={validateFirst}
......
...@@ -89,7 +89,7 @@ class FormWrap extends Component { ...@@ -89,7 +89,7 @@ class FormWrap extends Component {
return ( return (
<span className={s.titleContainer}> <span className={s.titleContainer}>
{/* icon && <div className={s.colIcon}>{icon}</div> */} {/* icon && <div className={s.colIcon}>{icon}</div> */}
<span className={s.itemTitle}>{item.columnChsName}</span> <span className={s.itemTitle}>{item.renderLabel ? item.renderLabel(item.columnChsName) : item.columnChsName}</span>
{item.columnAttrObj?.remark && ( {item.columnAttrObj?.remark && (
<Tooltip title={item.columnAttrObj?.remark}> <Tooltip title={item.columnAttrObj?.remark}>
<IconFont type="iconwenhao" className={s.remarkIcon} /> <IconFont type="iconwenhao" className={s.remarkIcon} />
...@@ -131,6 +131,7 @@ class FormWrap extends Component { ...@@ -131,6 +131,7 @@ class FormWrap extends Component {
dynamicCellConfigDTO, dynamicCellConfigDTO,
cellRenderProps, cellRenderProps,
requiredFlag, requiredFlag,
renderLabel,
} = item; } = item;
let detailConfig: any; let detailConfig: any;
if (typeof renderEditForm === 'function') { if (typeof renderEditForm === 'function') {
...@@ -311,7 +312,7 @@ class FormWrap extends Component { ...@@ -311,7 +312,7 @@ class FormWrap extends Component {
} }
function mapPropsToFields(props) { function mapPropsToFields(props) {
const { data, rowData } = props; const { data, rowData } = props;
const returnObj:any = {}; const returnObj: any = {};
if (!data || typeof data !== 'object') return returnObj; if (!data || typeof data !== 'object') return returnObj;
Object.keys(data).forEach((key) => { Object.keys(data).forEach((key) => {
const col = data[key]; const col = data[key];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment