xujunjie 1 سال پیش
والد
کامیت
6ea915d807

+ 7 - 3
src/components/PageTitle/index.js

@@ -3,15 +3,19 @@ import { history } from '@umijs/max';
 import styles from './index.less';
 
 export default (props) => {
-  const { children, returnable = false } = props;
+  const { children, returnable = false, onReturn } = props;
 
   const handleOnClick = () => {
-    returnable && history.back();
+    if (onReturn) {
+      onReturn();
+    } else if (returnable) {
+      history.back();
+    }
   };
 
   return (
     <div className={styles.titleBox} onClick={handleOnClick}>
-      {returnable ? (
+      {returnable || onReturn ? (
         <LeftOutlined style={{ fontSize: 22, cursor: 'pointer' }} />
       ) : (
         <span className={styles.titleBar} />

+ 3 - 1
src/pages/Home/ChemCostComparison.js

@@ -249,7 +249,9 @@ const CostComparison = (props) => {
 
   return (
     <PageContent closeable={false}>
-      <PageTitle returnable>能耗数据</PageTitle>
+      <PageTitle onReturn={() => UnityAction.sendMsg('menuItem', '首页')}>
+        能耗数据
+      </PageTitle>
 
       <div className="card-box" style={{ padding: 20, marginTop: 40 }}>
         <div

+ 3 - 1
src/pages/Home/EnergyCostComparison.js

@@ -222,7 +222,9 @@ const CostComparison = () => {
 
   return (
     <PageContent closeable={false}>
-      <PageTitle returnable>能耗数据</PageTitle>
+      <PageTitle onReturn={() => UnityAction.sendMsg('menuItem', '首页')}>
+        能耗数据
+      </PageTitle>
 
       <div className="card-box" style={{ padding: 20, marginTop: 40 }}>
         <div

+ 4 - 1
src/pages/Home/QualityMng.js

@@ -8,6 +8,7 @@ import {
   queryProcessSection,
   querySectionCode,
 } from '@/services/OperationManagement';
+import { UnityAction } from '@/utils/utils';
 import { useParams, useRequest } from '@umijs/max';
 import { Empty, Spin, Table } from 'antd';
 import dayjs from 'dayjs';
@@ -112,7 +113,9 @@ function Quality() {
 
   return (
     <PageContent closeable={false}>
-      <PageTitle returnable>水质监测</PageTitle>
+      <PageTitle onReturn={() => UnityAction.sendMsg('menuItem', '首页')}>
+        水质监测
+      </PageTitle>
       <div className="card-box" style={{ padding: 20, marginTop: 40 }}>
         <PageTitle>数据曲线</PageTitle>
         <Spin spinning={mainRes.loading}>

+ 3 - 1
src/pages/Home/WaterAmtMng.js

@@ -85,7 +85,9 @@ const WaterAmtMng = () => {
 
   return (
     <PageContent closeable={false}>
-      <PageTitle returnable>水量监测</PageTitle>
+      <PageTitle onReturn={() => UnityAction.sendMsg('menuItem', '首页')}>
+        水量监测
+      </PageTitle>
       <div className="card-box" style={{ padding: 20, marginTop: 40 }}>
         <PageTitle>数据曲线</PageTitle>
         <Spin spinning={loading}>