Browse Source

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

ZhaoJun 1 year ago
parent
commit
0fa2983534

+ 2 - 2
.umirc.ts

@@ -28,8 +28,8 @@ export default defineConfig({
   proxy: {
     '/api': {
       // target: 'http://47.96.12.136:8888/',
-      target: 'http://47.96.12.136:8788/',
-      // target: 'http://120.55.44.4:8903/',
+      // target: 'http://47.96.12.136:8788/',
+      target: 'http://120.55.44.4:8900/',
       //target: 'https://metawant.greentech.com.cn/',
       changeOrigin: true,
     },

BIN
src/assets/message/warning.png


+ 2 - 1
src/components/ManagementPage/chartModule.js

@@ -209,7 +209,8 @@ const defaultOption = {
   tooltip: {
     trigger: 'axis',
     textStyle: {
-      fontSize: '0.24rem',
+      fontSize: 24,
+      // color: 
     },
   },
   grid: {

+ 1 - 0
src/components/PageContent/index.less

@@ -12,6 +12,7 @@
     font-size: 0.34rem;
     color: #bcbaba;
     cursor: pointer;
+    z-index: 999;
   }
   .return {
     position: absolute;

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

@@ -28,6 +28,9 @@ export default (props) => {
             cursor: 'pointer',
             marginRight: '0.15rem',
             color: '#0139F1',
+            position: 'absolute',
+            left: '-0.34rem',
+            top: '0.09rem',
           }}
           onClick={handleOnClick}
         />

+ 13 - 3
src/pages/Center/MyTask/index.js

@@ -2,7 +2,7 @@ import PageContent from '@/components/PageContent';
 import TabsContent from '@/components/TabsContent';
 import { MandateType, OrderType } from '@/pages/TaskManage/constent';
 import { getMandateList } from '@/services/TaskManage';
-import { CaretRightFilled } from '@ant-design/icons';
+import { CaretLeftFilled, CaretRightFilled } from '@ant-design/icons';
 import {
   connect,
   history,
@@ -13,7 +13,6 @@ import {
 import { List, Spin } from 'antd';
 import { useEffect, useState } from 'react';
 import styles from './index.less';
-import PageTitle from '@/components/PageTitle';
 
 const MyTask = (props) => {
   const { userList, dispatch } = props;
@@ -132,7 +131,18 @@ const MyTask = (props) => {
 
   return (
     <PageContent closeable={false}>
-      <PageTitle tabs onReturn={() => history.back()}></PageTitle>
+      <CaretLeftFilled
+        style={{
+          fontSize: '0.3rem',
+          cursor: 'pointer',
+          marginRight: '0.15rem',
+          color: '#0139F1',
+          position: 'absolute',
+          left: '0.5rem',
+          top: '0.5rem',
+        }}
+        onClick={() => history.back()}
+      />
       <TabsContent
         defaultActiveKey={tab}
         onChange={onTabChange}

+ 2 - 2
src/pages/Home/EnergyCostDetail.js

@@ -87,8 +87,8 @@ export const EnergyDetail = () => {
       queryChartList({
         project_id: Number(projectId),
         metric_code: 'plant_electricity',
-        start_time: dayjs().startOf('day').format('YYYY-MM-DD 00:00:00'),
-        end_time: dayjs().format('YYYY-MM-DD 23:59:59'),
+        start_time: dayjs().subtract(2,"day").startOf('day').format('YYYY-MM-DD 00:00:00'),
+        end_time: dayjs().subtract(1,"day").format('YYYY-MM-DD 23:59:59'),
       }),
     {
       pollingInterval: TIMER,

+ 43 - 3
src/pages/MessageCenter/index.js

@@ -9,15 +9,24 @@ import { useState } from 'react';
 import styles from './index.less';
 const icon1 = require('@/assets/message/work.png');
 const icon2 = require('@/assets/message/check.png');
+const icon3 = require('@/assets/message/warning.png');
 
 const MessageCenter = () => {
   const { projectId } = useParams();
   const [tab, setTab] = useState('2');
-  //, msgType: 工况:11, 自检:12
+  //, msgType: 工况:11, 自检:12,  预警:13
   const { data, run, loading } = useRequest(() =>
     getNotificationList({ projectId, msgType: 11 }, { manual: true }),
   );
 
+  const {
+    data: dataWarning,
+    run: runWarning,
+    loading: loadingWarning,
+  } = useRequest(() =>
+    getNotificationList({ projectId, msgType: 13 }, { manual: true }),
+  );
+
   const {
     data: dataSelf,
     run: runSelf,
@@ -26,7 +35,17 @@ const MessageCenter = () => {
 
   const handleTabsChange = (tab) => {
     setTab(tab);
-    tab == '1' ? run() : runSelf();
+    switch (tab) {
+      case '1':
+        run();
+        break;
+      case '2':
+        runSelf();
+        break;
+      case '3':
+        runWarning();
+        break;
+    }
   };
 
   const handleReadClick = () => {
@@ -47,10 +66,22 @@ const MessageCenter = () => {
     const time = item?.CreatedOn
       ? dayjs(item.CreatedOn).format('YYYY-MM-DD HH:mm')
       : '';
+    let icon = '';
+    switch (tab) {
+      case '1':
+        icon = icon1;
+        break;
+      case '2':
+        icon = icon2;
+        break;
+      case '3':
+        icon = icon3;
+        break;
+    }
     return (
       <div className={`card-box ${styles.itemContent}`}>
         <div className={styles.left}>
-          <img className={styles.img} src={tab == '1' ? icon1 : icon2} />
+          <img className={styles.img} src={icon} />
           <div>
             <div className={styles.text}>{item.MsgBody}</div>
             <div className={styles.time}>{time}</div>
@@ -88,6 +119,15 @@ const MessageCenter = () => {
               </Spin>
             ),
           },
+          {
+            label: `预警数据`,
+            key: '3',
+            children: (
+              <Spin spinning={loadingWarning}>
+                {dataWarning?.list?.map((item) => renderItem(item))}
+              </Spin>
+            ),
+          },
           {
             label: `水厂工况`,
             key: '1',

+ 5 - 2
src/pages/SafetyManagement/index.js

@@ -137,7 +137,7 @@ const Video = ({ data, dataOnline, loading, selected, setSelected }) => {
           className={item.Online ? styles.onlinePoint : styles.outlinePoint}
         />
         <span className={styles.name}>{item.Name}</span>
-        <div className={styles.redLight}></div>
+        {item.EventPath && <div className={styles.redLight}></div>}
       </div>
     );
   };
@@ -173,7 +173,10 @@ const Video = ({ data, dataOnline, loading, selected, setSelected }) => {
               <div
                 id={item.Name}
                 key={`video_${idx}`}
-                onClick={() => setSelected(idx, item.Name)}
+                onClick={() => {
+                  localStorage.preview = item.EventPath;
+                  setSelected(idx, item.Name);
+                }}
                 className={`card-box ${styles.listItem} ${
                   selected == item.Name || selected == idx ? 'card-select' : ''
                 }`}

+ 5 - 2
src/pages/Smart/OptimizationTasks.js

@@ -55,10 +55,12 @@ const Produce = ({ projectId }) => {
     },
     {
       title: '参数',
+      width: '50%',
       dataIndex: 'Title',
     },
     {
       title: '任务内容',
+      width: '24%',
       dataIndex: 'Content',
     },
   ];
@@ -169,7 +171,7 @@ const Produce = ({ projectId }) => {
             handleLoadData={(current) =>
               run({ project_id: projectId, currentPage: current, class: 1 })
             }
-            height="3rem"
+            height="4rem"
           >
             <Table
               rowKey={'id'}
@@ -205,6 +207,7 @@ const Cost = ({ projectId }) => {
     },
     {
       title: '参数',
+      width: '24%',
       dataIndex: 'Title',
     },
     {
@@ -323,7 +326,7 @@ const Cost = ({ projectId }) => {
           handleLoadData={(current) =>
             run({ project_id: projectId, currentPage: current, class: 2 })
           }
-          height="3rem"
+          height="4rem"
         >
           <Table
             rowKey={'id'}

+ 14 - 31
src/pages/Smart/components/EvaluationReport.js

@@ -1,6 +1,7 @@
-import {  Table, Tooltip } from 'antd';
+import { Table, Tooltip } from 'antd';
 import { useMemo } from 'react';
 import { current, indicators } from './mock';
+import styles from '../OptimizationTasks.less';
 // import styles from './WorkConditionAssessment.less';
 
 /**
@@ -38,7 +39,7 @@ const EvaluationReport = (props) => {
         indicator: '总结',
         delta1: (
           <div>
-            【2023年4月】 <span style={error}>异常</span>
+            【2024年1月】 <span style={error}>异常</span>
             <br />
             (1)生产安全评估: <span style={success}>正常</span>
             <br />
@@ -115,38 +116,20 @@ const EvaluationReport = (props) => {
         };
       },
     },
-  
   ];
   // return null
   return (
-    <div style={{ fontSize: 18, color: '#fff' }}>
-      <Table
-        columns={columns}
-        dataSource={dataSource}
-        pagination={false}
-        // footer={() => (
-        //   <>
-        //     <Table.Row>
-        //       <Table.Cell>总结</Table.Cell>
-        //       <Table.Cell colSpan={3}>
-        //         【2023年4月】异常 <br />
-        //         (1)生产安全评估:正常
-        //         <br />
-        //         实时工况与仿真、最优和标准工况对比皆在偏差范围内,正常
-        //         <br />
-        //         (2)经济评估:异常
-        //         <br />
-        //         实时工况电耗同比增长/下降 ,环比增长/下降 ; 与仿真、最优和标准工况对比
-        //         实施工况药耗同比增长/下降 ,环比增长/下降 ; 与仿真、最优和标准工况对比
-        //       </Table.Cell>
-        //     </Table.Row>
-        //     <Table.Row>
-        //       <Table.Cell>优化建议</Table.Cell>
-        //       <Table.Cell colSpan={3}>根据评估结果,我们建议检查...工艺段</Table.Cell>
-        //     </Table.Row>
-        //   </>
-        // )}
-      />
+    <div className={styles.pageCard}>
+      <h3 className={styles.title} style={{ justifyContent: 'space-between' }}>
+        <div>
+          <i />
+          评估报告
+        </div>
+      </h3>
+
+      <div style={{ fontSize: 18, color: '#fff' }}>
+        <Table columns={columns} dataSource={dataSource} pagination={false} />
+      </div>
     </div>
   );
 };

+ 4 - 1
src/pages/SmartOps/HistoryRecord.js

@@ -19,7 +19,7 @@ const HistoryRecord = (props) => {
   const convertObject2FormData = (params) => {
     const formData = new FormData();
     Object.entries(params).forEach(([key, value]) => {
-      if (value !== null && value !== undefined && !isNaN(value)) {
+      if (value !== null && value !== undefined) {
         formData.append(key, value);
       }
     });
@@ -168,6 +168,7 @@ const HistoryRecord = (props) => {
       default:
         break;
     }
+    // console.log(tempParams)
     setQueryParams(tempParams);
   };
 
@@ -176,11 +177,13 @@ const HistoryRecord = (props) => {
       getList(params);
       return;
     }
+    console.log(formData);
     getList(formData);
   };
 
   useEffect(() => {
     const tempFormData = convertObject2FormData(queryParams);
+    console.log(queryParams);
     // page变更自动请求接口
     setFormData(tempFormData);
   }, [queryParams]);

+ 1 - 1
src/pages/SmartOps/OperationRecord.js

@@ -18,7 +18,7 @@ const OperationRecord = (props) => {
   const convertObject2FormData = (params) => {
     const formData = new FormData();
     Object.entries(params).forEach(([key, value]) => {
-      if (value !== null && value !== undefined && !isNaN(value)) {
+      if (value !== null && value !== undefined) {
         formData.append(key, value);
       }
     });

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

@@ -391,7 +391,7 @@ function SmartOps(props) {
 const convertObject2FormData = (params) => {
   const formData = new FormData();
   Object.entries(params).forEach(([key, value]) => {
-    if (value !== null && value !== undefined && !isNaN(value)) {
+    if (value !== null && value !== undefined) {
       formData.append(key, value);
     }
   });

+ 1 - 1
src/pages/TaskManage/Detail/WorkOrderList/WorkOrderList.less

@@ -11,7 +11,7 @@
     justify-content: space-around;
     width: 100%;
     .ant-tabs-tab-btn {
-      font-size: 0.24rem;
+      font-size: 0.28rem;
       font-weight: 600;
     }
   }

+ 18 - 1
src/services/safety.js

@@ -11,12 +11,29 @@ export async function queryGateOverView(params = {}) {
 }
 //视频列表
 export async function queryMonitorList(projectId) {
-  return request(`/api/v1/monitor/list/${projectId}`);
+  const res = await queryExceptionList(projectId);
+  const res2 = await request(`/api/v1/monitor/list/${projectId}`);
+  console.log(res, res2);
+  res2.data.list?.forEach((item) => {
+    let err = res.data.find((img) => img.device_name == item.Name);
+    if (err) {
+      item.EventPath = err.path;
+      item.MandateId = err.mandate_id;
+    } else {
+      item.EventPath = '';
+      item.MandateId = 0;
+    }
+  });
+  return res2;
 }
 //视频状态
 export async function queryMonitorOnlineCount(projectId) {
   return request(`/api/v1/monitor/online_count/${projectId}`);
 }
+//视频状态
+export async function queryExceptionList(projectId) {
+  return request(`/api/v1/dumu/exception-list?project_id=${projectId}`);
+}
 export const checkPW = async (data) => {
   return await request(`/api/v1/user/check_automationPw`, {
     method: 'POST',