Explorar o código

feat: 合同管理目录初始化

lanjianrong %!s(int64=4) %!d(string=hai) anos
pai
achega
be63e6a0bb

+ 3 - 3
src/components/AsyncModuleLoader/index.tsx

@@ -24,9 +24,9 @@ export default function AyncModuleLoader(importComponent: any) {
             NProgress.done()
         }
 
-        componentWillUnmount() {
-            NProgress.start()
-        }
+        // componentWillUnmount() {
+        //     NProgress.done()
+        // }
         render() {
             const { asyncComponent:Component } = this.state
             return Component ? <Component {...this.props} /> : null

src/pages/Management/components/leftSide/index.scss → src/components/LeftSide/index.scss


src/pages/Management/components/leftSide/index.tsx → src/components/LeftSide/index.tsx


+ 9 - 0
src/pages/Contract/Income/index.tsx

@@ -0,0 +1,9 @@
+import React from 'react'
+
+export default function Income() {
+  return (
+    <div>
+
+    </div>
+  )
+}

+ 9 - 0
src/pages/Contract/Spending/index.tsx

@@ -0,0 +1,9 @@
+import React from 'react'
+
+export default function Spending() {
+  return (
+    <div>
+
+    </div>
+  )
+}

+ 9 - 0
src/pages/Contract/Summary/index.tsx

@@ -0,0 +1,9 @@
+import React from 'react'
+
+export default function Summary() {
+  return (
+    <div>
+
+    </div>
+  )
+}

+ 18 - 11
src/pages/Contract/index.tsx

@@ -1,13 +1,20 @@
-import React, { Component } from 'react'
-export default class index extends Component {
-
-
-  render() {
-    return (
-      <div className="pi-flex-row">
-        {/* <Meun/> */}
-        <h1>合同管理</h1>
+import LeftSide from '@/components/LeftSide'
+import Guards from '@/components/Navigation'
+import { NavigationGuardsProps } from '@/types/router'
+import React from 'react'
+import { Switch } from 'react-router-dom'
+const Contract:React.FC<NavigationGuardsProps> = props => {
+  const { routeConfig, match, location } = props
+  return (
+    <>
+      <LeftSide childRoutes={routeConfig} location={location}></LeftSide>
+      <div className="panel-content">
+        <Switch>
+            <Guards routeConfig={routeConfig} match={match} location={location}></Guards>
+        </Switch>
       </div>
-    )
-  }
+    </>
+  )
 }
+
+export default Contract

+ 1 - 1
src/pages/Management/index.tsx

@@ -1,8 +1,8 @@
+import LeftSide from '@/components/LeftSide'
 import Guards from '@/components/Navigation'
 import { NavigationGuardsProps } from '@/types/router'
 import React from 'react'
 import { Switch } from 'react-router-dom'
-import LeftSide from './components/leftSide'
 const Management:React.FC<NavigationGuardsProps> = props => {
   const { routeConfig, match, location } = props
   return (

+ 28 - 1
src/router/routes.ts

@@ -37,7 +37,34 @@ export const routeConfig: RouteModel[] = [
           title: '合同管理',
           isTop: true,
           sort: 2
-        }
+        },
+        childRoutes: [
+          {
+            path: 'summary',
+            component: AsyncModuleLoader(() => import('@/pages/Contract/Summary')),
+            auth: [ 'USER' ],
+            defaultChildRoute: true,
+            meta: {
+              title: '合同概况'
+            }
+          },
+          {
+            path: 'income',
+            component: AsyncModuleLoader(() => import('@/pages/Contract/Income')),
+            auth: [ 'USER' ],
+            meta: {
+              title: '收入合同'
+            }
+          },
+          {
+            path: 'spending',
+            component: AsyncModuleLoader(() => import('@/pages/Contract/Spending')),
+            auth: [ 'USER' ],
+            meta: {
+              title: '支出合同'
+            }
+          }
+        ]
       },
       {
         path: 'safe',