diff --git a/web/client/src/sections/metadataManagement/components/metadataDatabModal.js b/web/client/src/sections/metadataManagement/components/metadataDatabModal.js
index 0f88ac6..4991dc8 100644
--- a/web/client/src/sections/metadataManagement/components/metadataDatabModal.js
+++ b/web/client/src/sections/metadataManagement/components/metadataDatabModal.js
@@ -19,15 +19,15 @@ const MetadataDatabaseModal = (props) => {
}
return Promise.resolve();
}
- const renderModel = () => {
+ const renderModelItems = () => {
const items = metadataModels.map(m => {
if (m.control === '文本框') {
- const rules = [{ required: m.nullable, message: '' },
- { max: m.length, message: `${m.attributeName}不超过${m.length}个字符` }]
- if (m.nullable) {
+ const rules = [{ required: !m.nullable, message: '' }]
+ if (!m.nullable) {
rules.push(({ getFieldValue, validateFields }) => ({
validator(_, value) { return validatorNull(_, value, getFieldValue, validateFields, m.attributeName) }
}))
+ rules.push({ max: m.length, message: `${m.attributeName}不超过${m.length}个字符` })
}
return
{
} else if (m.control === '数字输入框') {
+ const rules = [{ required: !m.nullable, message: `${m.attributeName}不可空` }]
+ let maxValue = '';
+ if (m.length) {
+ while (m.length > 0) {
+ maxValue += '9'
+ m.length--;
+ }
+ }
return
-
+ rules={rules}>
+
} else {
return
+ rules={[{ required: !m.nullable, message: `${m.attributeName}不可空` }]}>
{
rules={[{ max: 255, message: `描述不超过255个字符` }]}>
- {renderModel()}
+ {renderModelItems()}
)
diff --git a/web/client/src/sections/metadataManagement/containers/latestMetadata.js b/web/client/src/sections/metadataManagement/containers/latestMetadata.js
index d5e06fd..7c69470 100644
--- a/web/client/src/sections/metadataManagement/containers/latestMetadata.js
+++ b/web/client/src/sections/metadataManagement/containers/latestMetadata.js
@@ -29,6 +29,7 @@ const LatestMetadata = (props) => {
dispatch(metadataManagement.getResourceCatalog()).then(res => {
const { data } = res.payload;
if (res.success) {
+ allTreeNodeKeys = []
const resourceCatalogData = getTreeNodeData(data, null, 'rc');
setResourceCatalogData(resourceCatalogData);
if (data.length) {
@@ -39,7 +40,6 @@ const LatestMetadata = (props) => {
setSelectedKeys(expandedKeysData);
setExpandedKeys(expandedKeys);
expandedKeysData = [];
- allTreeNodeKeys = [];
}
} else {
setExpandedKeys([]);
@@ -81,16 +81,16 @@ const LatestMetadata = (props) => {
const setTreeNodeTitle = (name) => {
let content = {name}
- if (name.length > 10) {
+ if (name.length > 6) {
content =
- {name.substring(0, 10) + '...'}
+ {name.substring(0, 6) + '...'}
}
return content;
}
const renderTreeNode = (ds, dataSource) => {
- return
+ return
{setTreeNodeTitle(ds.name)}
{
let record = JSON.parse(JSON.stringify(ds));
@@ -164,7 +164,6 @@ const LatestMetadata = (props) => {
resourceCatalogKey={resourceCatalogKey}
resourceCatalogPath={resourceCatalogPath} history={history} />
}
- {/* {props.children} */}
{
diff --git a/web/client/src/sections/metadataManagement/containers/metadataTab.js b/web/client/src/sections/metadataManagement/containers/metadataTab.js
index b8cdc26..b27a8f6 100644
--- a/web/client/src/sections/metadataManagement/containers/metadataTab.js
+++ b/web/client/src/sections/metadataManagement/containers/metadataTab.js
@@ -4,7 +4,6 @@ import { Tabs } from 'antd';
import DatabaseTable from './databasesTable';
import FilesTable from './filesTable';
import RestapisTable from './restapisTable';
-import { push } from 'react-router-redux';
const MetadataTab = (props) => {
const { resourceCatalogId, resourceCatalogKey, resourceCatalogPath, actions, dispatch, history } = props;
diff --git a/web/client/src/sections/metadataManagement/routes.js b/web/client/src/sections/metadataManagement/routes.js
index a609bee..f700636 100644
--- a/web/client/src/sections/metadataManagement/routes.js
+++ b/web/client/src/sections/metadataManagement/routes.js
@@ -22,6 +22,7 @@ export default [{
{
path: '/detail/:id',
key: 'metadataDetail',
+ // component: MetadataDetails,
component: LatestMetadata,
breadcrumb: '元数据详情'
}