|
@@ -113,10 +113,24 @@ function ContentForm(props) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
//表选择
|
|
//表选择
|
|
- function tablechange(value, options) {
|
|
|
|
- colList[options.key] = list[options.key].getColumnNameDTOList
|
|
|
|
- seDisable(false)
|
|
|
|
- setColList([...colList])
|
|
|
|
|
|
+ function tablechange(i, value, options) {
|
|
|
|
+ console.log(value);
|
|
|
|
+ const formData = form.getFieldsValue();
|
|
|
|
+ if (value) {
|
|
|
|
+ colList[i] = list[options.key].getColumnNameDTOList
|
|
|
|
+ seDisable(false)
|
|
|
|
+ setColList([...colList])
|
|
|
|
+ }else{
|
|
|
|
+ colList[i] = []
|
|
|
|
+ setColList([...colList])
|
|
|
|
+ seDisable(true)
|
|
|
|
+ }
|
|
|
|
+ let columnList = formData.columnList;
|
|
|
|
+ columnList[i].columnCname = undefined
|
|
|
|
+ columnList[i].columnEname = undefined
|
|
|
|
+ form.setFieldsValue({
|
|
|
|
+ columnList: columnList
|
|
|
|
+ });
|
|
}
|
|
}
|
|
function colchange(value, options) {
|
|
function colchange(value, options) {
|
|
const formData = form.getFieldsValue();
|
|
const formData = form.getFieldsValue();
|
|
@@ -205,7 +219,6 @@ function ContentForm(props) {
|
|
arr.push(it.tit)
|
|
arr.push(it.tit)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- console.log(arr);
|
|
|
|
formData.standardValueList = arr
|
|
formData.standardValueList = arr
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
url = api.addColumnVerify
|
|
url = api.addColumnVerify
|
|
@@ -264,7 +277,7 @@ function ContentForm(props) {
|
|
<div className='item'>
|
|
<div className='item'>
|
|
<div className='item-box'>
|
|
<div className='item-box'>
|
|
<Form.Item label="表名称(中文)" rules={[{ required: true }]} style={{ width: '50%' }} name={['columnList', i, 'tableCname']} labelAlign="right" >
|
|
<Form.Item label="表名称(中文)" rules={[{ required: true }]} style={{ width: '50%' }} name={['columnList', i, 'tableCname']} labelAlign="right" >
|
|
- <Select allowClear showSearch onChange={tablechange} onSearch={cnameSearch} style={{ width: 160 }} placeholder="请选择">
|
|
|
|
|
|
+ <Select allowClear showSearch onChange={(value, option) => tablechange(i, value, option)} onSearch={cnameSearch} style={{ width: 160 }} placeholder="请选择">
|
|
{tableList.map((item) => {
|
|
{tableList.map((item) => {
|
|
return (
|
|
return (
|
|
<Option value={item.tableCname} key={item.index}>{item.tableCname}</Option>
|
|
<Option value={item.tableCname} key={item.index}>{item.tableCname}</Option>
|
|
@@ -273,7 +286,7 @@ function ContentForm(props) {
|
|
</Select>
|
|
</Select>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item label="表名称(英文)" rules={[{ required: true }]} name={['columnList', i, 'tableEname']} labelAlign="right">
|
|
<Form.Item label="表名称(英文)" rules={[{ required: true }]} name={['columnList', i, 'tableEname']} labelAlign="right">
|
|
- <Select allowClear showSearch onChange={tablechange} onSearch={enameSearch} style={{ width: 160 }} placeholder="请选择" >
|
|
|
|
|
|
+ <Select allowClear showSearch onChange={(value, option) => tablechange(i, value, option)} onSearch={enameSearch} style={{ width: 160 }} placeholder="请选择" >
|
|
{tableList.map((item) => {
|
|
{tableList.map((item) => {
|
|
return (
|
|
return (
|
|
<Option value={item.tableEname} key={item.index}>{item.tableEname}</Option>
|
|
<Option value={item.tableEname} key={item.index}>{item.tableEname}</Option>
|
|
@@ -352,7 +365,7 @@ function ContentForm(props) {
|
|
<TextArea
|
|
<TextArea
|
|
autoSize={{ minRows: 3, maxRows: 5 }}
|
|
autoSize={{ minRows: 3, maxRows: 5 }}
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
-
|
|
|
|
|
|
+
|
|
/>
|
|
/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Form>
|
|
</Form>
|