Browse Source

Merge branch 'develop' of http://120.55.44.4:10080/xujunjie/gt_client_pad into develop

Renxy 1 year ago
parent
commit
f90873718b

+ 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}>

+ 7 - 8
src/pages/Home/index.js

@@ -1,5 +1,6 @@
 import { getComparisonData } from '@/services/OperationManagement';
 import { queryConditionSnapshot } from '@/services/SmartOps';
+import { UnityAction } from '@/utils/utils';
 import { LoadingOutlined } from '@ant-design/icons';
 import { connect, history, useParams, useRequest } from '@umijs/max';
 import dayjs from 'dayjs';
@@ -49,7 +50,7 @@ const SmartWork = (props) => {
   return (
     <Box
       title="水厂工况"
-      onClick={() => history.push(`/smart/work/${projectId}`)}
+      onClick={() => UnityAction.sendMsg('menuItem', '工况管理')}
     >
       <div className={styles.scoreBox}>
         <CircleScore>
@@ -72,7 +73,7 @@ const WaterAmt = (props) => {
   return (
     <Box
       title="水量监测"
-      onClick={() => history.push(`/home/water-amt-mng/${projectId}`)}
+      onClick={() => UnityAction.sendMsg('menuItem', '水量监测')}
     >
       <ul>
         <li>
@@ -95,7 +96,7 @@ const WaterQuality = (props) => {
   return (
     <Box
       title="水质监测"
-      onClick={() => history.push(`/home/water-quality-mng/${projectId}`)}
+      onClick={() => UnityAction.sendMsg('menuItem', '水质监测')}
     >
       <ul>
         <li>
@@ -145,9 +146,7 @@ const SelfInspection = connect(({ eqSelfInspection, loading }) => ({
   return (
     <Box
       title="系统自检"
-      onClick={() =>
-        history.push(`/self-inspection/detail/${projectId}/${autoReport?.Id}`)
-      }
+      onClick={() => UnityAction.sendMsg('menuItem', '系统自检')}
     >
       <div className={styles.insTag}>自检中</div>
 
@@ -164,7 +163,7 @@ const Electric = (props) => {
   return (
     <Box
       title="能耗监测"
-      onClick={() => history.push(`/home/energy/${projectId}`)}
+      onClick={() => UnityAction.sendMsg('menuItem', '能耗监测')}
     >
       <ul>
         <li>
@@ -197,7 +196,7 @@ const Medicine = () => {
   return (
     <Box
       title="药耗监测"
-      onClick={() => history.push(`/home/chem-cost/${projectId}`)}
+      onClick={() => UnityAction.sendMsg('menuItem', '药耗监测')}
     >
       <ul>
         <li>