Skip to content

Commit

Permalink
feat: Add unifiedParams's Modal tips
Browse files Browse the repository at this point in the history
  • Loading branch information
Original-Recipe committed Nov 11, 2024
1 parent d50ae4e commit e964a87
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,95 +185,98 @@ const UnifyParamsModal = ({ id, visible, onCancel, config, imgList, imgIndex }:
onOk={onOk}
wrapClassName='labelbee-custom-modal'
>
<Form {...layout} form={form} onFinish={onFinish}>
<Form.Item name='id' label={t('UnifyTrackID')}>
{id}
</Form.Item>

<Form.Item label={t('UnifyAttributeRange')} required={true}>
<Form.Item
style={{ display: 'inline-block' }}
rules={defaultNumberRules}
name='prevPage'
noStyle={true}
initialValue={1} // First Page
>
<InputNumber
precision={0}
min={1}
style={{ width: '80px' }}
onChange={() => recalculateSize()}
/>
<>
<div style={{ marginBottom: '20px', color: '#f00' }}>{t('UnifyParamsTips')}</div>
<Form {...layout} form={form} onFinish={onFinish}>
<Form.Item name='id' label={t('UnifyTrackID')}>
{id}
</Form.Item>
<span
style={{
display: 'inline-block',
width: '24px',
textAlign: 'center',
}}
>
-
</span>
<Form.Item
style={{ display: 'inline-block' }}
rules={defaultNumberRules}
name='nextPage'
noStyle={true}
initialValue={imgList.length} // Last Page
>
<InputNumber
precision={0}
min={1}
style={{ width: '80px' }}
onChange={() => recalculateSize()}
/>

<Form.Item label={t('UnifyAttributeRange')} required={true}>
<Form.Item
style={{ display: 'inline-block' }}
rules={defaultNumberRules}
name='prevPage'
noStyle={true}
initialValue={1} // First Page
>
<InputNumber
precision={0}
min={1}
style={{ width: '80px' }}
onChange={() => recalculateSize()}
/>
</Form.Item>
<span
style={{
display: 'inline-block',
width: '24px',
textAlign: 'center',
}}
>
-
</span>
<Form.Item
style={{ display: 'inline-block' }}
rules={defaultNumberRules}
name='nextPage'
noStyle={true}
initialValue={imgList.length} // Last Page
>
<InputNumber
precision={0}
min={1}
style={{ width: '80px' }}
onChange={() => recalculateSize()}
/>
</Form.Item>
<span
style={{
display: 'inline-block',
width: '40x',
marginLeft: '10px',
textAlign: 'center',
}}
>
{t('Page')}
</span>
</Form.Item>
<span
style={{
display: 'inline-block',
width: '40x',
marginLeft: '10px',
textAlign: 'center',
}}
>
{t('Page')}
</span>
</Form.Item>

<Form.Item name='UnifySize' label={t('UnifySize')}>
{sizeShow()}
</Form.Item>
<Form.Item name='UnifySize' label={t('UnifySize')}>
{sizeShow()}
</Form.Item>

<Form.Item label={t('UnifyTag')} required={true}>
<div style={attributeStyle}>
<PrefixTag text={t('Attribute')} />
<Form.Item name='attribute' noStyle={true} rules={defaultSelectedAttribute}>
<Select style={selectStyle}>
{config.attributeList.map((v) => (
<Select.Option key={v.value} value={v.value}>
{v.key}
</Select.Option>
))}
</Select>
</Form.Item>
</div>
{config.secondaryAttributeConfigurable &&
config.inputList.map((v) => (
<div key={v.value} style={attributeStyle}>
<PrefixTag text={v.key} />
<Form.Item name={v.value} noStyle={true} required={false}>
<Select style={selectStyle} mode={v.isMulti ? 'multiple' : undefined}>
{v.subSelected?.map((subData) => (
<Select.Option key={subData.value} value={subData.value}>
{subData.key}
</Select.Option>
))}
</Select>
</Form.Item>
</div>
))}
</Form.Item>
</Form>
<Form.Item label={t('UnifyTag')} required={true}>
<div style={attributeStyle}>
<PrefixTag text={t('Attribute')} />
<Form.Item name='attribute' noStyle={true} rules={defaultSelectedAttribute}>
<Select style={selectStyle}>
{config.attributeList.map((v) => (
<Select.Option key={v.value} value={v.value}>
{v.key}
</Select.Option>
))}
</Select>
</Form.Item>
</div>
{config.secondaryAttributeConfigurable &&
config.inputList.map((v) => (
<div key={v.value} style={attributeStyle}>
<PrefixTag text={v.key} />
<Form.Item name={v.value} noStyle={true} required={false}>
<Select style={selectStyle} mode={v.isMulti ? 'multiple' : undefined}>
{v.subSelected?.map((subData) => (
<Select.Option key={subData.value} value={subData.value}>
{subData.key}
</Select.Option>
))}
</Select>
</Form.Item>
</div>
))}
</Form.Item>
</Form>
</>
</Modal>
);
};
Expand Down
2 changes: 2 additions & 0 deletions packages/lb-utils/src/i18n/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
"CancelText": "Cancel",
"UnifyParams": "Unify Params",
"UnifyAttributeRange": "Unify Range",
"UnifyParamsTips": "The size of 2D frames in non current page images will not be standardized temporarily",
"UnifyTrackID": "Unify TrackID",
"UnifySize": "Unify Size",
"UnifyTag": "Unify Tag",
Expand Down Expand Up @@ -585,6 +586,7 @@
"CancelText": "取消",
"UnifyParams": "统一参数",
"UnifyAttributeRange": "统一属性范围",
"UnifyParamsTips": "非当前页图片里的2D框尺寸暂时不做统一",
"UnifyTrackID": "统一标注框ID",
"UnifySize": "统一尺寸",
"UnifyTag": "统一标签",
Expand Down

0 comments on commit e964a87

Please sign in to comment.