refactor: refactor create instance
refact create instance code Change-Id: Ib8ca4af068bd7377c82bee9d0b01df9f1c0ace42
This commit is contained in:
parent
cfe389dd39
commit
29c4030d0c
@ -518,9 +518,9 @@ export class StepCreate extends StepAction {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderFooterLeft() {
|
getCountInputConfig() {
|
||||||
const { data } = this.state;
|
const { data } = this.state;
|
||||||
const { count = 1, source: { value: sourceValue } = {} } = data;
|
const { source: { value: sourceValue } = {} } = data;
|
||||||
const configs = {
|
const configs = {
|
||||||
min: 1,
|
min: 1,
|
||||||
max:
|
max:
|
||||||
@ -533,9 +533,14 @@ export class StepCreate extends StepAction {
|
|||||||
onChange: this.onCountChange,
|
onChange: this.onCountChange,
|
||||||
formatter: (value) => `$ ${value}`.replace(/\D/g, ''),
|
formatter: (value) => `$ ${value}`.replace(/\D/g, ''),
|
||||||
};
|
};
|
||||||
|
return configs;
|
||||||
|
}
|
||||||
|
|
||||||
|
renderCountInput() {
|
||||||
|
const { data } = this.state;
|
||||||
|
const { count = 1 } = data || {};
|
||||||
|
const configs = this.getCountInputConfig();
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex' }}>
|
|
||||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
||||||
<div className={styles['number-input']}>
|
<div className={styles['number-input']}>
|
||||||
<span>{t('Count')}</span>
|
<span>{t('Count')}</span>
|
||||||
<InputNumber
|
<InputNumber
|
||||||
@ -544,6 +549,14 @@ export class StepCreate extends StepAction {
|
|||||||
className={classnames(styles.input, 'instance-count')}
|
className={classnames(styles.input, 'instance-count')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderFooterLeft() {
|
||||||
|
return (
|
||||||
|
<div style={{ display: 'flex' }}>
|
||||||
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||||
|
{this.renderCountInput()}
|
||||||
{this.renderExtra()}
|
{this.renderExtra()}
|
||||||
</div>
|
</div>
|
||||||
{this.renderBadge()}
|
{this.renderBadge()}
|
||||||
|
Loading…
Reference in New Issue
Block a user