当前位置:网站首页>Form for real-time custom verification
Form for real-time custom verification
2022-07-28 13:13:00 【Pig Xiaoyong】
Form Conduct real-time custom verification
After selecting a company , Interface , Verify in real time whether the company can join 
<Form ref={form => this.form = form} initialValues={form}>
<FormRow styleName='shop'>
<FormElement width={550} label=" Add a shared company " >
<Form.List name="companyInfo">
{(fields, { add, remove }) => (
<>
{fields.map(({ key, name, fieldKey }) => (
<div key={key} style={
{
display: 'flex' }} align="baseline">
<Form.Item
name={[name, 'companyId']}
fieldKey={[fieldKey, 'fieldKey']}
rules={[
{ required: true, message: " Please add a sharing company " },
() => ({
async validator(_, value) {
if (value === undefined) {
return
}
const d = { companyId: value } // Change the structure
if (JSON.stringify(oldData).indexOf(JSON.stringify(d)) !== -1) {
return
} else {
await that.props.ajax.get('/admin/platformCompanyShareConfig/searchByCompanyId', { companyId: value?.value, type: 1 }).then(res => {
if (res.data?.companyInfo !== null) {
return Promise.reject(new Error(' The company has joined other sharing , Unable to join '));
} else {
return Promise.resolve();
}
})
return Promise.resolve();
}
},
}),
]}
>
<Select
showSearch
placeholder=" Please enter the company name and select "
onSearch={this.onSearch}
defaultActiveFirstOption={false}
showArrow={false}
filterOption={false}
labelInValue={true}
disabled={type === "check" ? true : false}
style={
{ width: 400 }}
>
{
options?.map(item => <Option value={item.id}>{item.companyName}</Option>)
}
</Select>
</Form.Item>
{
fields.length === 1 || type == 'check' ?
<div styleName="buttonContent">{type !== "check" ? <PlusCircleOutlined styleName="dynamic-button" onClick={() => add()} /> : null} </div>
: fields.length !== name + 1 ?
<div styleName="buttonContent"><MinusCircleOutlined styleName="dynamic-button" onClick={() => remove(name)} /></div>
: fields.length === name + 1 ?
<div styleName="buttonContent">
<PlusCircleOutlined styleName="dynamic-button" onClick={() => add()} />
<MinusCircleOutlined styleName="dynamic-button" onClick={() => remove(name)} />
</div>
: null
}
</div>
)
)}
</>
)
}
</Form.List>
</FormElement>
</FormRow>
</Form>
边栏推荐
- 10、 Kubernetes scheduling principle
- 【嵌入式C基础】第5篇:原码/反码/补码
- Black cat takes you to learn UFS agreement part 2: Interpretation of UFS related terms
- A brief introduction to the for loop. Some of the code involves arrays
- Android engineers, how to use kotlin to provide productivity?
- Complete set of SSM framework online bookstore
- 管理区解耦架构见过吗?能帮客户搞定大难题的
- Problem solving during copilot trial
- 2020jenkins study notes
- 机器学习实战-集成学习-23
猜你喜欢
![[embedded explanation] key scanning based on finite state machine and stm32](/img/ce/cc3f959a4e4f5b22e2c711ea887ad7.png)
[embedded explanation] key scanning based on finite state machine and stm32

Machine learning practice - decision tree-22

How to use databricks for data analysis on tidb cloud | tidb cloud User Guide

2020-12-13

Huawei cloud Gao Hongxia: CBC microservice code Reconstruction & independent release practice

04 pyechars geographic chart (example code + effect diagram)

Which big model is better? Openbmb releases bmlist to give you the answer!

【嵌入式C基础】第4篇:运算符的使用

Flexpro software: measurement data analysis in production, research and development

Machine learning practice - integrated learning-23
随机推荐
Android engineers, how to use kotlin to provide productivity?
[error prone points of C language] Part 4: detailed rules for storing structures in memory
[graduation design] smart home system based on ZigBee - single chip microcomputer Internet of things stm32
Installation and reinstallation of win11 system graphic version tutorial
Dimming and color matching cool light touch chip-dlt8ma12ts-jericho
What if the win11 folder cannot be opened
Le transaction
【嵌入式C基础】第9篇:C语言指针的基本用法
Vs code is not in its original position after being updated
Fundamentals of machine learning Bayesian analysis-14
Databinding+LiveData轻松实现无重启换肤
Ruan Bonan of Green Alliance Technology: cloud native security from the open source shooting range
Block reversal (summer vacation daily question 7)
BiliBili Yang Zhou: above efficiency, efficient delivery
黑猫带你学eMMC协议第24篇:eMMC的总线测试程序详解(CMD19 & CMD14)
Complete set of SSM framework online bookstore
MySQL is always installed unsuccessfully. Just do it like this
Change the document type in endnode and import it in word
[embedded C foundation] Part 8: explanation of C language array
Machine learning practice - decision tree-22