xujunjie 1 rok temu
rodzic
commit
7d35805063

+ 13 - 8
.umirc.ts

@@ -88,15 +88,20 @@ export default defineConfig({
       component: './HardwareController',
     },
     {
-      name: '空调监控',
-      path: '/hardware-controller/air-conditioner/:projectId',
-      component: './HardwareController/AirConditioner',
-    },
-    {
-      name: '灯光监控',
-      path: '/hardware-controller/light/:projectId',
-      component: './HardwareController/Light',
+      name: '感知监控',
+      path: '/hardware/:projectId',
+      component: './HardwareController/Hardware',
     },
+    // {
+    //   name: '空调监控',
+    //   path: '/hardware-controller/air-conditioner/:projectId',
+    //   component: './HardwareController/AirConditioner',
+    // },
+    // {
+    //   name: '灯光监控',
+    //   path: '/hardware-controller/light/:projectId',
+    //   component: './HardwareController/Light',
+    // },
     {
       name: '系统自检',
       path: '/self-inspection/:projectId',

+ 8 - 8
src/components/ManagementPage/chartModule.js

@@ -205,10 +205,10 @@ const defaultOption = {
     boundaryGap: false,
     axisTick: { show: false },
     nameTextStyle: {
-      fontSize: 18,
+      fontSize: 24,
     },
     axisLabel: {
-      fontSize: 18,
+      fontSize: 24,
     },
     data: [
       '00:00',
@@ -227,12 +227,12 @@ const defaultOption = {
       name: '000',
       top: 20,
       nameTextStyle: {
-        fontSize: 18,
+        fontSize: 24,
         // align: 'left',
         padding: [0, 0, 20, 0],
       },
       axisLabel: {
-        fontSize: 18,
+        fontSize: 24,
       },
       axisLine: {
         show: false,
@@ -252,7 +252,7 @@ const defaultOption = {
       top: 20,
       position: 'right',
       nameTextStyle: {
-        fontSize: 18,
+        fontSize: 24,
         // align: 'left',
         padding: [0, 0, 20, 0],
       },
@@ -275,7 +275,7 @@ const defaultOption = {
       position: 'right',
       offset: 80,
       nameTextStyle: {
-        fontSize: 18,
+        fontSize: 24,
         // align: 'left',
         padding: [0, 0, 20, 0],
       },
@@ -401,7 +401,7 @@ const defaultOption = {
       },
       title: {
         offsetCenter: [0, '25%'],
-        fontSize: 18,
+        fontSize: 24,
       },
       detail: {
         show: false,
@@ -417,7 +417,7 @@ const defaultOption = {
     data: ['进水水量', '预测出水量', '实际出水量'],
     lineStyle: {},
     textStyle: {
-      fontSize: 18,
+      fontSize: 24,
     },
   },
   // toolbox: {

+ 6 - 2
src/components/PageContent/index.js

@@ -3,7 +3,7 @@ import { CloseOutlined } from '@ant-design/icons';
 import styles from './index.less';
 
 export default (props) => {
-  const { children, style, closeable = true } = props;
+  const { children, style, closeable = true, tabs = false } = props;
 
   const handleClose = () => {
     UnityAction.sendMsg('closePage');
@@ -12,7 +12,11 @@ export default (props) => {
   return (
     <div className={styles.page} style={style}>
       {closeable && (
-        <CloseOutlined onClick={handleClose} className={styles.close} />
+        <CloseOutlined
+          onClick={handleClose}
+          className={styles.close}
+          style={{ top: tabs ? 65 : '' }}
+        />
       )}
 
       {children}

+ 10 - 10
src/global.less

@@ -134,8 +134,8 @@ input[type='reset'] {
   }
   .tabs-item {
     flex: 1;
-    padding: 12px 20px;
-    font-size: 18px;
+    padding: 16px 24px;
+    font-size: 24px;
     font-weight: 400;
     color: #4a4a4a;
     border-right: 1px solid #979797;
@@ -152,15 +152,15 @@ input[type='reset'] {
 .section-title {
   display: flex;
   align-items: center;
-  font-size: 22px;
+  font-size: 28px;
   font-weight: 400;
   color: #4a4a4a;
-  line-height: 30px;
+  line-height: 40px;
   .section-line {
-    width: 3px;
-    height: 23px;
+    width: 4px;
+    height: 30px;
     background: #4a90e2;
-    margin-right: 6px;
+    margin-right: 8px;
   }
 }
 
@@ -209,10 +209,10 @@ input[type='reset'] {
 .ant-table-thead > tr > th,
 .ant-table-tbody > tr > td {
   border-radius: 0 !important;
-  padding: 8px 25px !important;
-  font-size: 20px !important;
+  padding: 16px 18px !important;
+  font-size: 24px !important;
   color: #4a4a4a !important;
-  line-height: 28px !important;
+  line-height: 32px !important;
   font-weight: normal !important;
   vertical-align: middle;
   border: none !important;

+ 1 - 1
src/pages/DeviceManager/index.js

@@ -34,7 +34,7 @@ const DeviceManager = () => {
     }
   };
   return (
-    <PageContent>
+    <PageContent tabs>
       <TabsContent
         defaultActiveKey="1"
         onChange={onChange}

+ 6 - 7
src/pages/HardwareController/AirConditioner.js

@@ -1,5 +1,3 @@
-import PageContent from '@/components/PageContent';
-import PageTitle from '@/components/PageTitle';
 import { queryIotList } from '@/services/HardwareController';
 import { useParams, useRequest } from '@umijs/max';
 import { Spin } from 'antd';
@@ -19,8 +17,7 @@ const Work = (props) => {
   };
 
   return (
-    <PageContent>
-      <PageTitle>空调控制</PageTitle>
+    <div>
       <div className={`card-box ${styles.top}`}>
         <div className={styles.left}>
           <img
@@ -37,10 +34,12 @@ const Work = (props) => {
             <i className={styles.icon}></i> 在线:{data?.online_count}
           </div>
           <div className={styles.row}>
-            <i className={`${styles.icon} ${styles.error}`}></i> 故障:{data?.fault_count}
+            <i className={`${styles.icon} ${styles.error}`}></i> 故障:
+            {data?.fault_count}
           </div>
           <div className={styles.row}>
-            <i className={`${styles.icon} ${styles.offline}`}></i> 离线:{data?.offline_count}
+            <i className={`${styles.icon} ${styles.offline}`}></i> 离线:
+            {data?.offline_count}
           </div>
         </div>
       </div>
@@ -52,7 +51,7 @@ const Work = (props) => {
           </div>
         ))}
       </Spin>
-    </PageContent>
+    </div>
   );
 };
 

+ 31 - 0
src/pages/HardwareController/Hardware.js

@@ -0,0 +1,31 @@
+import PageContent from '@/components/PageContent';
+import TabsContent from '@/components/TabsContent';
+import AirConditioner from './AirConditioner';
+import Light from './Light';
+
+function Hardware() {
+  const handleTabsChange = (tab) => {};
+  return (
+    <PageContent tabs>
+      <TabsContent
+        center={false}
+        defaultActiveKey="1"
+        onChange={handleTabsChange}
+        items={[
+          {
+            label: `空调控制`,
+            key: '1',
+            children: <AirConditioner />,
+          },
+          {
+            label: `照明控制`,
+            key: '2',
+            children: <Light />,
+          },
+        ]}
+      />
+    </PageContent>
+  );
+}
+
+export default Hardware;

+ 6 - 7
src/pages/HardwareController/Light.js

@@ -1,5 +1,3 @@
-import PageContent from '@/components/PageContent';
-import PageTitle from '@/components/PageTitle';
 import { queryLightList } from '@/services/HardwareController';
 import { useParams, useRequest } from '@umijs/max';
 import { Spin } from 'antd';
@@ -19,8 +17,7 @@ const Work = (props) => {
   };
 
   return (
-    <PageContent>
-      <PageTitle>照明控制</PageTitle>
+    <div>
       <div className={`card-box ${styles.top}`}>
         <div className={styles.left}>
           <img
@@ -37,10 +34,12 @@ const Work = (props) => {
             <i className={styles.icon}></i> 在线:{data?.online_count}
           </div>
           <div className={styles.row}>
-            <i className={`${styles.icon} ${styles.error}`}></i> 故障:{data?.fault_count}
+            <i className={`${styles.icon} ${styles.error}`}></i> 故障:
+            {data?.fault_count}
           </div>
           <div className={styles.row}>
-            <i className={`${styles.icon} ${styles.offline}`}></i> 离线:{data?.offline_count}
+            <i className={`${styles.icon} ${styles.offline}`}></i> 离线:
+            {data?.offline_count}
           </div>
         </div>
       </div>
@@ -52,7 +51,7 @@ const Work = (props) => {
           </div>
         ))}
       </Spin>
-    </PageContent>
+    </div>
   );
 };
 

+ 10 - 5
src/pages/HardwareController/index.js

@@ -1,5 +1,6 @@
 import PageContent from '@/components/PageContent';
 import PageTitle from '@/components/PageTitle';
+import { UnityAction } from '@/utils/utils';
 import { history, useParams } from '@umijs/max';
 import styles from './index.less';
 
@@ -10,22 +11,26 @@ const HardwareController = (props) => {
     <PageContent>
       <PageTitle>智能管控</PageTitle>
 
-      <div className={`card-box ${styles.item}`}>工艺监控</div>
+      <div
+        className={`card-box ${styles.item}`}
+        onClick={() => UnityAction.sendMsg('innerItem', 'scada')}
+      >
+        工艺监控
+      </div>
       <div
         className={`card-box ${styles.item}`}
         onClick={() =>
           history.push(`/hardware-controller/air-conditioner/${projectId}`)
         }
       >
-        空调监控
+        感知监控
       </div>
       <div
         className={`card-box ${styles.item}`}
-        onClick={() => history.push(`/hardware-controller/light/${projectId}`)}
+        onClick={() => UnityAction.sendMsg('innerItem', 'locate')}
       >
-        照明监控
+        室内定位
       </div>
-      <div className={`card-box ${styles.item}`}>室内定位</div>
     </PageContent>
   );
 };

+ 0 - 1
src/pages/HardwareController/index.less

@@ -7,7 +7,6 @@
 }
 .top {
   display: flex;
-  margin-top: 40px;
   padding: 20px;
   .left {
     width: 50%;

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

@@ -229,6 +229,7 @@ const CostComparison = (props) => {
       message.error('获取数据失败');
     });
     setChemList([...list]);
+    setCurrentChem(list[0])
     typeParams.forEach((item) => {
       item.chemical_agents = list[0];
     });
@@ -251,7 +252,7 @@ const CostComparison = (props) => {
   return (
     <PageContent closeable={false}>
       <PageTitle onReturn={() => UnityAction.sendMsg('menuItem', '首页')}>
-        能耗数据
+        药耗监测
         <div
           onClick={(e) => {
             e.stopPropagation();
@@ -262,7 +263,7 @@ const CostComparison = (props) => {
         ></div>
       </PageTitle>
 
-      <div className="card-box" style={{ padding: 20, marginTop: 40 }}>
+      <div className="card-box" style={{ padding: 20, marginTop: 10 }}>
         {/* 使用Tabs来展示所有药的标签 */}
         <div className="tabs">
           {chemList?.map((item) => (

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

@@ -107,7 +107,7 @@ function Quality() {
         水质监测
       </PageTitle>
 
-      <div className="card-box" style={{ padding: 20, marginTop: 26 }}>
+      <div className="card-box" style={{ padding: 20, marginTop: 10 }}>
         <div className="tabs" style={{ marginBottom: 20 }}>
           {codeList?.map((item) => (
             <div

+ 4 - 4
src/pages/Home/manage.less

@@ -73,18 +73,18 @@
       justify-content: center;
       align-items: flex-end;
       line-height: 1;
-      margin-bottom: 6px;
+      margin-bottom: 8px;
 
-      font-size: 30px;
+      font-size: 40px;
       font-weight: 500;
       color: #f5a623;
-      line-height: 42px;
+      line-height: 56px;
     }
     .name {
       margin-bottom: 4px;
       max-width: 80%;
 
-      font-size: 18px;
+      font-size: 24px;
       color: #4a4a4a;
       line-height: 26px;
     }

+ 1 - 1
src/pages/MessageCenter/index.js

@@ -59,7 +59,7 @@ const MessageCenter = () => {
     );
   };
   return (
-    <PageContent>
+    <PageContent tabs>
       <TabsContent
         center={false}
         defaultActiveKey="1"

+ 1 - 1
src/pages/SafetyManagement/index.js

@@ -62,7 +62,7 @@ const DeviceManager = () => {
     }
   };
   return (
-    <PageContent>
+    <PageContent tabs>
       <TabsContent
         defaultActiveKey="1"
         onChange={handleTabChange}