Browse Source

feat: 进入标段后leftSide左上角显示标段名称

lanjianrong 4 years ago
parent
commit
feeafde2ea

+ 2 - 3
src/assets/css/common.scss

@@ -354,7 +354,6 @@
   bottom: 0;
   z-index: 2;
 }
-verticalAlign
 .pi-vertical-baseline {
   vertical-align: baseline;
 }
@@ -393,8 +392,8 @@ verticalAlign
     width: calc(100vw - 55px);
   }
   .wrap-content {
-    // height: calc(100vh - 34px);
-    overflow-y: auto;
+    height: calc(100vh - 34px);
+    overflow: auto;
   }
 }
 

+ 6 - 5
src/components/LeftSide/index.tsx

@@ -1,14 +1,14 @@
 import SvgIcon from '@/components/SvgIcon'
-import { userStore } from '@/store/mobx'
+import { tenderStore, userStore } from '@/store/mobx'
 import { iNavSide } from '@/types/router'
 import { Tooltip } from 'antd'
 import { observer } from 'mobx-react'
 import React, { useEffect } from 'react'
 import { Link } from 'react-router-dom'
 import "./index.scss"
-const LeftSide:React.FC<iNavSide> = ({ childRoutes, location }) => {
+const LeftSide:React.FC<iNavSide> = ({ childRoutes, location, showBidsection = false }) => {
   useEffect(() => {
-    if (!userStore.projectInfo.id) {
+    if (!showBidsection && !userStore.projectInfo.id) {
       userStore.getProjectInfo()
     }
   }, [])
@@ -18,12 +18,13 @@ const LeftSide:React.FC<iNavSide> = ({ childRoutes, location }) => {
   if (route) {
     basePathname = pathname.substring(0, pathname.indexOf(route.path))
   }
+
   return (
     <div className={userStore.showLeftSide ? "panel-sidebar" : "scale-out-hor-left"}>
       <div>
-        <Tooltip title={userStore.projectName} placement="right">
+        <Tooltip title={!showBidsection ? userStore.projectName : tenderStore.bidsction_name} placement="right">
           <div className="pi-pd-10 pi-mg-bottom-10 sidebar-title ">
-            <span className="pi-ellipsis-2">{userStore.projectName}</span>
+            <span className="pi-ellipsis-2">{!showBidsection ? userStore.projectName : tenderStore.bidsction_name}</span>
           </div>
         </Tooltip>
         <div className="pi-flex-column pi-justify-start">

+ 1 - 1
src/pages/Contract/Content/Summary/components/Content/index.tsx

@@ -171,7 +171,7 @@ const Content: React.FC<iContentProps> = ({ data, type }) => {
           </div>
         </div>
       </div>
-      <div className="card-body card-border dual-axes-content pi-mg-bottom-32">
+      <div className="card-body card-border dual-axes-content">
         {/* <h5>{type === 'expenditure' ? '收入' : '支出'}合同结算趋势</h5> */}
         <DualAxes {...dualAxesConfig} />
       </div>

+ 1 - 1
src/pages/Contract/Content/index.tsx

@@ -7,7 +7,7 @@ const Content:React.FC<NavigationGuardsProps> = props => {
   const { routeConfig, match, location } = props
   return (
     <>
-      <LeftSide childRoutes={routeConfig} location={location} />
+      <LeftSide childRoutes={routeConfig} location={location} showBidsection={true}/>
       <div className="panel-content">
         <Switch>
               <Guards routeConfig={routeConfig} match={match} location={location} />

+ 1 - 1
src/pages/Quality/Content/index.tsx

@@ -7,7 +7,7 @@ const Content:React.FC<NavigationGuardsProps> = props => {
   const { routeConfig, match, location } = props
   return (
     <>
-      <LeftSide childRoutes={routeConfig} location={location} />
+      <LeftSide childRoutes={routeConfig} location={location} showBidsection={true}/>
       <div className="panel-content">
         <Switch>
               <Guards routeConfig={routeConfig} match={match} location={location} />

+ 1 - 1
src/pages/Safe/Content/index.tsx

@@ -7,7 +7,7 @@ const Content:React.FC<NavigationGuardsProps> = props => {
   const { routeConfig, match, location } = props
   return (
     <>
-      <LeftSide childRoutes={routeConfig} location={location} />
+      <LeftSide childRoutes={routeConfig} location={location} showBidsection={true}/>
       <div className="panel-content">
         <Switch>
               <Guards routeConfig={routeConfig} match={match} location={location} />

+ 11 - 0
src/store/mobx/tender/index.ts

@@ -56,10 +56,21 @@ class Tender {
   @computed get bid() {
     if (!this.tender.bidsectionId) {
       const tenderInfo = storage.get('tenderInfo')
+      this.tender = tenderInfo
+
       return tenderInfo.bidsectionId
     }
     return this.tender.bidsectionId
   }
+
+  @computed get bidsction_name() {
+    if (!this.tender.bidsectionId) {
+      const tenderInfo = storage.get('tenderInfo')
+      this.tender = tenderInfo
+      return tenderInfo.name
+    }
+    return this.tender.name
+  }
 }
 
 export default new Tender()

+ 1 - 0
src/types/router.d.ts

@@ -10,6 +10,7 @@ interface RouteModel {
 }
 
 interface iNavSide extends RouteProps {
+  showBidsection?: boolean
   childRoutes: RouteModel[]
   location: any
   history?: any

+ 0 - 1
src/utils/common/customHooks.ts

@@ -45,7 +45,6 @@ export const useTableExpand = (tree: ContractTree): [string[], (expanded: boolea
   const [ ids, setIds ] = useState<Array<string>>([])
   useEffect(() => {
     const newIds = expandTree(tree.children as ContractTree[])
-    console.log(newIds)
 
     setIds(newIds)
   }, [ tree ])