|
@@ -61,7 +61,7 @@ function ContentForm(props) {
|
|
|
const [tableList, setTableList] = useState([]);//表名称
|
|
|
const [colList, setColList] = useState([[]]);//字段名称
|
|
|
const [list, setList] = useState([]);
|
|
|
- const [disable, seDisable] = useState(true);
|
|
|
+ const [disable, seDisable] = useState([true]);
|
|
|
const { type, detail } = useContext(FiledContext);
|
|
|
const { back, form, cancel } = props;
|
|
|
const initialValues = detail
|
|
@@ -118,12 +118,14 @@ function ContentForm(props) {
|
|
|
const formData = form.getFieldsValue();
|
|
|
if (value) {
|
|
|
colList[i] = list[options.key].getColumnNameDTOList
|
|
|
- seDisable(false)
|
|
|
+ disable[i] = false
|
|
|
+ seDisable([...disable])
|
|
|
setColList([...colList])
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
colList[i] = []
|
|
|
+ disable[i] = true
|
|
|
+ seDisable([...disable])
|
|
|
setColList([...colList])
|
|
|
- seDisable(true)
|
|
|
}
|
|
|
let columnList = formData.columnList;
|
|
|
columnList[i].columnCname = undefined
|
|
@@ -174,8 +176,11 @@ function ContentForm(props) {
|
|
|
form.setFieldsValue({
|
|
|
columnList: columnList
|
|
|
});
|
|
|
+ const index = columnList.length - 1
|
|
|
colList.push(...[[]])
|
|
|
setColList([...colList])
|
|
|
+ disable[index] = true
|
|
|
+ seDisable([...disable])
|
|
|
}
|
|
|
//标准值维护
|
|
|
function modifyStand(i) {
|
|
@@ -255,7 +260,7 @@ function ContentForm(props) {
|
|
|
});
|
|
|
}
|
|
|
if (type == 2) {
|
|
|
- seDisable(false)
|
|
|
+ seDisable([false])
|
|
|
}
|
|
|
}, []);
|
|
|
|
|
@@ -297,7 +302,7 @@ function ContentForm(props) {
|
|
|
</div>
|
|
|
<div className='item-box'>
|
|
|
<Form.Item label="字段名称(中文)" rules={[{ required: true }]} style={{ width: '50%' }} name={['columnList', i, 'columnCname']} labelAlign="right">
|
|
|
- <Select allowClear showSearch onChange={colchange} onSearch={colmeSearch} style={{ width: 160 }} placeholder="请选择" disabled={disable}>
|
|
|
+ <Select allowClear showSearch onChange={colchange} onSearch={colmeSearch} style={{ width: 160 }} placeholder="请选择" disabled={disable[i]}>
|
|
|
{colList[i].map((item) => {
|
|
|
return (
|
|
|
<Option value={item.columnCname} key={item.id} index={i}>{item.columnCname}</Option>
|
|
@@ -306,7 +311,7 @@ function ContentForm(props) {
|
|
|
</Select>
|
|
|
</Form.Item>
|
|
|
<Form.Item label="字段名称(英文)" rules={[{ required: true }]} name={['columnList', i, 'columnEname']} labelAlign="right">
|
|
|
- <Select allowClear showSearch onChange={colchange} onSearch={coleneSearch} style={{ width: 160 }} placeholder="请选择" disabled={disable}>
|
|
|
+ <Select allowClear showSearch onChange={colchange} onSearch={coleneSearch} style={{ width: 160 }} placeholder="请选择" disabled={disable[i]}>
|
|
|
{colList[i].map((item) => {
|
|
|
return (
|
|
|
<Option value={item.columnEname} key={item.id} index={i}>{item.columnEname}</Option>
|