Browse Source

(*)面包屑属性调用完善

master
peng.peng 2 years ago
parent
commit
2bd0e37978
  1. 31
      web/client/src/layout/containers/layout/breadcrumb.js
  2. 25
      web/client/src/sections/metadataAcquisition/containers/adapter.js
  3. 7
      web/client/src/sections/metadataAcquisition/containers/adapterDetail.js
  4. 3
      web/client/src/sections/metadataAcquisition/containers/index.js
  5. 11
      web/client/src/sections/metadataAcquisition/routes.js

31
web/client/src/layout/containers/layout/breadcrumb.js

@ -3,19 +3,25 @@ import { Breadcrumb } from 'antd';
import withBreadcrumbs from 'react-router-breadcrumbs-hoc';
import { Link } from 'react-router-dom';
const Breadcrumbs = (props) => {
const excludePaths = ['/'];
const extRoutes = [{ path: '/project-monitor/things/struct/:id/configuration/station', breadcrumb: '测点' }];
function Breadcrumbs(props) {
const excludePaths = [
'/',
'/metadataManagement/latestMetadata/detail',
'/metadataAcquisition/adapter/detail',
];
const { routes } = props;
const Bread = withBreadcrumbs(routes, { excludePaths })(({ breadcrumbs }) => {
return (
const Bread = withBreadcrumbs(routes.concat(extRoutes), { excludePaths })(({ breadcrumbs }) => (
<Breadcrumb separator="/" style={{ height: 25 }}>
{
breadcrumbs.filter(bc => bc.key != '/metadataManagement/latestMetadata/detail').map((bc, index) => {
return (
breadcrumbs.map((bc, index) => (
<Breadcrumb.Item key={index}>
{
bc.component ?
bc.component
? (
<Link
to={{
pathname: bc.match.url,
@ -24,16 +30,15 @@ const Breadcrumbs = (props) => {
}}
>
{bc.breadcrumb}
</Link> :
bc.breadcrumb
</Link>
)
: bc.breadcrumb
}
</Breadcrumb.Item>
)
})
))
}
</Breadcrumb>
)
});
));
return (
<Bread />

25
web/client/src/sections/metadataAcquisition/containers/adapter.js

@ -1,7 +1,24 @@
import React, { useEffect, useState } from 'react'
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Button, } from 'antd'
function Adapter (props) {
return <>适配器管理</>
const LatestMetadata = (props) => {
const { user, dispatch, actions, history } = props;
useEffect(() => {
}, [])
return <>
<Button type="primary" onClick={() => { history.push(`/metadataAcquisition/adapter/detail/1`) }} >查看详情</Button>
</>
}
export default Adapter
function mapStateToProps(state) {
const { global, auth } = state;
return {
clientHeight: global.clientHeight,
user: auth.user,
actions: global.actions,
};
}
export default connect(mapStateToProps)(LatestMetadata)

7
web/client/src/sections/metadataAcquisition/containers/adapterDetail.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function AdapterDetail(props) {
return <>适配器详情</>
}
export default AdapterDetail

3
web/client/src/sections/metadataAcquisition/containers/index.js

@ -4,5 +4,6 @@ import Adapter from './adapter';
import DataSourceManagement from './dataSourceManagement';
import AcquisitionTask from './acquisitionTask';
import AcquisitionLog from './acquisitionLog';
import AdapterDetail from './adapterDetail';
export { Adapter, DataSourceManagement, AcquisitionTask, AcquisitionLog };
export { Adapter, DataSourceManagement, AcquisitionTask, AcquisitionLog, AdapterDetail };

11
web/client/src/sections/metadataAcquisition/routes.js

@ -1,5 +1,5 @@
'use strict';
import { Adapter, DataSourceManagement, AcquisitionTask, AcquisitionLog } from './containers';
import { Adapter, DataSourceManagement, AcquisitionTask, AcquisitionLog, AdapterDetail } from './containers';
export default [{
type: 'inner',
route: {
@ -11,7 +11,14 @@ export default [{
path: '/adapter',
key: 'adapter',
component: Adapter,
breadcrumb: '适配器管理'
breadcrumb: '适配器管理',
childRoutes: [{
breadcrumb: '适配器详情',
path: '/detail/:id',
key: 'detail',
exact: false,
component: AdapterDetail,
}]
}, {
path: '/dataSourceManagement',
key: 'dataSourceManagement',

Loading…
Cancel
Save