nameRequired
This commit is contained in:
parent
425d250ea2
commit
ff282ccaa1
|
|
@ -118,7 +118,7 @@ export default OakComponent({
|
|||
});
|
||||
},
|
||||
confirm() {
|
||||
const { entityId, entity, redirectTo, relation, multiple, nameRequired } =
|
||||
const { entityId, entity, redirectTo, relation, multiple, nameRequired, nameLabel } =
|
||||
this.props;
|
||||
const { period, userId, searchValue } = this.state;
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ export default OakComponent({
|
|||
if (!userId && !searchValue) {
|
||||
this.setMessage({
|
||||
type: 'error',
|
||||
content: '请输入名称',
|
||||
content: `请输入${nameLabel || '名称'}`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ export default function Render(
|
|||
parasiteId: string;
|
||||
options: { value: string }[];
|
||||
nameLabel: string;
|
||||
nameRequired: boolean;
|
||||
},
|
||||
{
|
||||
search: (value: string) => void;
|
||||
|
|
@ -47,6 +48,7 @@ export default function Render(
|
|||
parasiteId,
|
||||
options,
|
||||
nameLabel,
|
||||
nameRequired,
|
||||
} = props.data;
|
||||
const { setPeriod, confirm, setInit, onSelect, onSearch, setSearchValue } =
|
||||
methods;
|
||||
|
|
@ -83,7 +85,7 @@ export default function Render(
|
|||
<>
|
||||
<div className={Style.container}>
|
||||
<Form labelCol={{ span: 4 }} wrapperCol={{ span: 8 }}>
|
||||
<Form.Item label={nameLabel || '名称'} required>
|
||||
<Form.Item label={nameLabel || '名称'} required={nameRequired}>
|
||||
<>
|
||||
<AutoComplete
|
||||
options={options}
|
||||
|
|
|
|||
Loading…
Reference in New Issue