当前位置:网站首页>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>
边栏推荐
- Introduction to border border attribute
- [embedded explanation] key scanning based on finite state machine and stm32
- Vs code is not in its original position after being updated
- Ruan Bonan of Green Alliance Technology: cloud native security from the open source shooting range
- Automatic light sensing arm lamp touch chip-dlt8sa15b-jericho
- CTO of youhaoda, MVP of Huawei cloud, and Zhang Shanyou: build cloud native applications based on kubernetes and dapr
- 机器学习实战-逻辑回归-19
- Complete set of SSM framework online bookstore
- Li FuPan: application practice of kata safety container in ant group
- [FPGA] joint simulation of vivado and Modelsim
猜你喜欢

【C语言易错点】第4篇:结构体在内存中存储规则详讲
![[graduation design teaching] ultrasonic ranging system based on single chip microcomputer - Internet of things embedded stm32](/img/27/58fd175753b21dc21bd2d950cf5f15.png)
[graduation design teaching] ultrasonic ranging system based on single chip microcomputer - Internet of things embedded stm32

2020-12-13

Fundamentals of machine learning - principal component analysis pca-16

机器学习基础-集成学习-13

How many times can the WordPress user name be changed? Attach the method of changing user name

Machine learning practice - logistic regression-19
![[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

Chinese translation of pointnet:deep learning on point sets for 3D classification and segmentation

How to open the power saving mode of win11 system computer
随机推荐
What is C generic, generic cache, generic constraint
[FPGA] FIR filter - half band filter
Leetcode remove element & move zero
Stepless dimming colorful RGB mirror light touch chip-dlt8s12a-jericho
机器学习实战-决策树-22
[July 5 event preview] Flink Summit
Fundamentals of machine learning - principal component analysis pca-16
Bear market spread portfolio
03 pyechars rectangular coordinate system chart (example code + effect drawing)
Databinding+livedata can easily realize skin changing without restart
Chinese translation of pointnet:deep learning on point sets for 3D classification and segmentation
FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be depreca
Block reversal (summer vacation daily question 7)
2020-12-13
Summary: idea problem record
Code layered management of interface testing based on RF framework
[matlab]: FFT related problems
机器学习基础-贝叶斯分析-14
How to add PDF virtual printer in win11
Quick read in