|
@@ -11,8 +11,6 @@ const { RangePicker } = DatePicker;
|
|
|
const { Option } = Select;
|
|
|
|
|
|
function FieldRules() {
|
|
|
-
|
|
|
-
|
|
|
const [addVisible, setAddVisible] = useState(false); //新增页面显示
|
|
|
const [logList, setLogList] = useState([]);
|
|
|
const [total, setTotal] = useState(0);
|
|
@@ -122,13 +120,12 @@ function FieldRules() {
|
|
|
post(api.delColumnVerify, { ids: selectedRowKeys }).then((res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
//刷新列表
|
|
|
- const totalPage = Math.ceil((total - 1) / 15);
|
|
|
+ const totalPage = Math.ceil((total - selectedRowKeys.length) / 15);
|
|
|
//将当前页码与删除数据之后的总页数进行比较,避免当前页码不存在
|
|
|
const pagenum =
|
|
|
params.current > totalPage ? totalPage : params.current;
|
|
|
//避免pagenum变为0
|
|
|
params.current = pagenum < 1 ? 1 : pagenum;
|
|
|
- console.log(pagenum < 1 ? 1 : pagenum);
|
|
|
setParams(params)
|
|
|
getColumnVerifyPage()
|
|
|
message.success(res.data.message);
|
|
@@ -137,9 +134,11 @@ function FieldRules() {
|
|
|
}
|
|
|
});
|
|
|
showDelModal(false);
|
|
|
+ setSelectedRowKeys([])
|
|
|
}
|
|
|
//删除弹窗确认
|
|
|
function showDelModal(flag) {
|
|
|
+ console.log(selectedRowKeys.length);
|
|
|
if (flag && !selectedRowKeys.length) {
|
|
|
message.warning("请先选择要删除的记录~", 1);
|
|
|
return;
|
|
@@ -226,9 +225,7 @@ function FieldRules() {
|
|
|
setSelectedRowKeys(selectedRowKeys);
|
|
|
};
|
|
|
function tableCnameChange(value, option) {
|
|
|
- const formData = form.getFieldsValue();
|
|
|
setTableCname(value)
|
|
|
-
|
|
|
getColumnName('', '', value, '')
|
|
|
if (value) {
|
|
|
form.setFieldsValue({
|
|
@@ -242,6 +239,7 @@ function FieldRules() {
|
|
|
columnEname: undefined,
|
|
|
})
|
|
|
setDisable(true)
|
|
|
+ getTableName()
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -260,6 +258,7 @@ function FieldRules() {
|
|
|
columnEname: undefined,
|
|
|
})
|
|
|
setDisable(true)
|
|
|
+ getTableName()
|
|
|
}
|
|
|
}
|
|
|
function colchange(value, option, ins) {
|
|
@@ -272,6 +271,7 @@ function FieldRules() {
|
|
|
form.setFieldsValue({
|
|
|
columnEname: undefined
|
|
|
})
|
|
|
+ getColumnName('', '', '', '')
|
|
|
}
|
|
|
} else {
|
|
|
if (value) {
|
|
@@ -282,6 +282,7 @@ function FieldRules() {
|
|
|
form.setFieldsValue({
|
|
|
columnCname: undefined
|
|
|
})
|
|
|
+ getColumnName('', '', '', '')
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -370,7 +371,7 @@ function FieldRules() {
|
|
|
<Row gutter={24}>
|
|
|
<Col span={6} key={0}>
|
|
|
<Form.Item label="表名称(中文)" name="tableCname">
|
|
|
- <Select showSearch allowClear onChange={(value, option) => tableCnameChange(value, option)} onSearch={cnameSearch} placeholder="请选择">
|
|
|
+ <Select showSearch allowClear onChange={(value, option) => tableCnameChange(value, option)} onSearch={cnameSearch} style={{ maxWidth: '159px' }} placeholder="请选择">
|
|
|
{tableList.map((item) => {
|
|
|
return (
|
|
|
<Option value={item.tableCname} val={item.tableEname} key={item.tableCname}>{item.tableCname}</Option>
|
|
@@ -381,7 +382,7 @@ function FieldRules() {
|
|
|
</Col>
|
|
|
<Col span={6} key={1}>
|
|
|
<Form.Item label="表名称(英文)" name="tableEname">
|
|
|
- <Select showSearch allowClear onChange={(value, option) => tableEnameChange(value, option)} onSearch={enameSearch} placeholder="请选择">
|
|
|
+ <Select showSearch allowClear onChange={(value, option) => tableEnameChange(value, option)} onSearch={enameSearch} style={{ maxWidth: '159px' }} placeholder="请选择">
|
|
|
{tableList.map((item) => {
|
|
|
return (
|
|
|
<Option value={item.tableEname} val={item.tableCname} key={item.tableEname}>{item.tableEname}</Option>
|
|
@@ -392,7 +393,7 @@ function FieldRules() {
|
|
|
</Col>
|
|
|
<Col span={6} key={2}>
|
|
|
<Form.Item label="字段名称(中文)" name="columnCname">
|
|
|
- <Select showSearch allowClear onChange={(value, option) => colchange(value, option, 1)} onSearch={colmeSearch} placeholder="请选择" disabled={disable}>
|
|
|
+ <Select showSearch allowClear onChange={(value, option) => colchange(value, option, 1)} onSearch={colmeSearch} style={{ maxWidth: '159px' }} placeholder="请选择" disabled={disable}>
|
|
|
{colList.map((item, i) => {
|
|
|
return (
|
|
|
<Option value={item.columnCname} val={item.columnEname} key={item.columnCname}>{item.columnCname}</Option>
|
|
@@ -403,7 +404,7 @@ function FieldRules() {
|
|
|
</Col>
|
|
|
<Col span={6} key={3}>
|
|
|
<Form.Item label="字段名称(英文)" name="columnEname">
|
|
|
- <Select showSearch allowClear onChange={(value, option) => colchange(value, option, 2)} onSearch={coleneSearch} placeholder="请选择" disabled={disable}>
|
|
|
+ <Select showSearch allowClear onChange={(value, option) => colchange(value, option, 2)} onSearch={coleneSearch} placeholder="请选择" style={{ maxWidth: '159px' }} disabled={disable}>
|
|
|
{colList.map((item, i) => {
|
|
|
return (
|
|
|
<Option value={item.columnEname} val={item.columnCname} key={item.columnEname}>{item.columnEname}</Option>
|
|
@@ -493,7 +494,7 @@ function FieldRules() {
|
|
|
onCancel={() => showDelModal(false)}
|
|
|
maskClosable={false}
|
|
|
>
|
|
|
- <p>字段校验规则删除后将无法恢复,确认删除这{selectedRowKeys.length}条变更记录?</p>
|
|
|
+ <p>字段校验规则删除后将无法恢复,确认删除这{selectedRowKeys.length}条数据?</p>
|
|
|
</Modal>
|
|
|
</div >
|
|
|
)
|