From a090abd355eff898a5704d99f8c47f0e63f56b14 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Fri, 31 Mar 2023 13:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/steps/postgre/stepOne.js | 14 ++++++--- .../containers/dataSourceManagement.js | 29 ++++++++++--------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/web/client/src/sections/metadataAcquisition/components/steps/postgre/stepOne.js b/web/client/src/sections/metadataAcquisition/components/steps/postgre/stepOne.js index 2f114d6..2d58a5a 100644 --- a/web/client/src/sections/metadataAcquisition/components/steps/postgre/stepOne.js +++ b/web/client/src/sections/metadataAcquisition/components/steps/postgre/stepOne.js @@ -1,5 +1,5 @@ -import React, { useEffect, useState } from 'react' -import { Button, Spin, Input, Row, Col } from 'antd'; +import React, { useRef } from 'react' +import { Button, Spin } from 'antd'; import { ProForm, ProFormSelect, @@ -12,7 +12,6 @@ import { push } from 'react-router-redux'; import '../../style.less'; function StepOne(props) { const { next, stepOneValues, stepOneValuesFinish, readOnly, treeData, dataSources, dispatch, refresh, loading, editData } = props; - const formRef = React.createRef(); const initialValues = stepOneValues ? stepOneValues : { adapterName: 'PostgreSQL采集适配器', adapterVersion: '9.x', @@ -42,8 +41,10 @@ function StepOne(props) { return treeData } const treeDataFilter = treeData && dataSources?.rows?.length > 0 ? getTreeNodeData(treeData, null, 'rc') : [] + const formRef = useRef(); return */} {treeDataFilter.length > 0 ? 新建 { + formRef?.current?.setFieldsValue({ + catalogKey: null + }) refresh() }}>刷新 } @@ -153,6 +158,7 @@ function StepOne(props) { options={[]} name="catalogKey" label="数据源挂载路径" + placeholder="请选择数据源挂载路径" disabled={editData} />} @@ -169,7 +175,7 @@ function StepOne(props) { - + } export default StepOne \ No newline at end of file diff --git a/web/client/src/sections/metadataAcquisition/containers/dataSourceManagement.js b/web/client/src/sections/metadataAcquisition/containers/dataSourceManagement.js index 0d2d30a..98bdd0a 100644 --- a/web/client/src/sections/metadataAcquisition/containers/dataSourceManagement.js +++ b/web/client/src/sections/metadataAcquisition/containers/dataSourceManagement.js @@ -146,7 +146,7 @@ function DataSourceManagement(props) { } } const refresh = () => { - queryData(); + // queryData(); setRefreshTree(refreshTree + 1) } @@ -171,6 +171,7 @@ function DataSourceManagement(props) { y: clientHeight - 260 } } + //1490 2256 pagination={{ size: 'large', total: dataSources?.count, @@ -180,19 +181,19 @@ function DataSourceManagement(props) { // pageSize: pageSize || 10, defaultPageSize: 10, pageSizeOptions: [10, 20, 50], - showTotal: (total) => { - return {`共${Math.ceil(total / pageSize)}页,${total}项`} - }, - onShowSizeChange: (currentPage, pageSize) => { - setCurrentPage(currentPage); - setPageSize(pageSize); - - }, - onChange: (page, pageSize) => { - setCurrentPage(page); - setPageSize(pageSize); - - } + // showTotal: (total) => { + // return {`共${Math.ceil(total / pageSize)}页,${total}项`} + // }, + // onShowSizeChange: (currentPage, pageSize) => { + // setCurrentPage(currentPage); + // setPageSize(pageSize); + + // }, + // onChange: (page, pageSize) => { + // setCurrentPage(page); + // setPageSize(pageSize); + + // } }} dataSource={dataSources?.rows || []} options={false}