xujunjie 1 年之前
父节点
当前提交
78dab2a8da

二进制
src/assets/arr-right.png


二进制
src/assets/circle-error.png


二进制
src/assets/circle-success.png


二进制
src/assets/icon-setting.png


二进制
src/assets/icon-success.png


二进制
src/assets/iconDiffFilled.png


二进制
src/assets/iconFundFilled.png


+ 4 - 2
src/components/PageContent/index.less

@@ -6,9 +6,11 @@
 
   .close {
     position: absolute;
-    top: 20px;
+    top: 22px;
     right: 20px;
-    font-size: 24px;
+    font-size: 28px;
+
+    color: #4a4a4a;
     cursor: pointer;
   }
 }

+ 13 - 0
src/global.less

@@ -192,6 +192,14 @@ input[type='reset'] {
 .ant-table-placeholder {
   background: transparent !important;
 }
+.ant-table,
+.ant-table-container,
+.ant-table-wrapper table {
+  border-radius: 0 !important;
+}
+.ant-table-container {
+  border: none !important;
+}
 .ant-table-cell::before {
   display: none;
 }
@@ -200,10 +208,15 @@ 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;
   color: #4a4a4a !important;
   line-height: 28px !important;
   font-weight: normal !important;
   vertical-align: middle;
+  border: none !important;
+}
+.ant-table-tbody > tr:nth-child(even) {
+  background: rgba(145, 192, 238, 0.16);
 }

+ 16 - 137
src/pages/EqSelfInspection/List/index.js

@@ -2,24 +2,14 @@ import PageContent from '@/components/PageContent';
 import PageTitle from '@/components/PageTitle';
 import { GetTokenFromUrl, UnityAction } from '@/utils/utils';
 import { connect, history, useParams } from '@umijs/max';
-import { Button, Col, DatePicker, Form, Row, Select, Table } from 'antd';
+import { Table } from 'antd';
 import dayjs from 'dayjs';
-import { Fragment, useEffect, useState } from 'react';
-
-const FormItem = Form.Item;
-const { Option } = Select;
-const statusList = [
-  { key: 1, value: '0', label: '正常' },
-  { key: 2, value: '1', label: '异常' },
-];
+import { Fragment, useEffect } from 'react';
 
 function List(props) {
   const { loading, list, processList = [], dispatch } = props;
 
   const { projectId } = useParams();
-  const [form] = Form.useForm();
-  const [pagination, setPagination] = useState({ pageSize: 10, current: 1 });
-  const [groupId, setGroupId] = useState('');
 
   const getColumns = () => {
     return [
@@ -77,149 +67,38 @@ function List(props) {
     ];
   };
 
-  const getRecord = async (pagination) => {
-    form.validateFields().then((fieldsValue) => {
-      fieldsValue.projectId = projectId;
-      fieldsValue.auto = 1;
-      fieldsValue.startDate = dayjs(fieldsValue.startDate).format('YYYY-MM-DD');
-      fieldsValue.endDate = dayjs(fieldsValue.endDate).format('YYYY-MM-DD');
-      fieldsValue.pageSize = pagination.pageSize;
-      fieldsValue.currentPage = pagination.current;
-      dispatch({
-        type: 'patrolArtificialRecord/queryPatrol',
-        payload: { ...fieldsValue },
-        callback: (data) => {
-          setPagination(data.pagination);
-        },
-      });
-    });
-  };
-
-  const handleSearch = (e) => {
-    e?.preventDefault();
-    getRecord(pagination);
-  };
-  const TableOnChange = (tempPagination) => {
-    getRecord(tempPagination);
-  };
   const goToDetail = (record, e) => {
     e.stopPropagation();
     UnityAction.sendMsg('reportDetail', '');
     history.push(
-      `/self-inspection/detail/${projectId}/${record.Id}?JWT-TOKEN=${GetTokenFromUrl()}`,
+      `/self-inspection/detail/${projectId}/${
+        record.Id
+      }?JWT-TOKEN=${GetTokenFromUrl()}`,
     );
   };
 
   useEffect(() => {
-    UnityAction.sendMsg('type', 2);
-    handleSearch();
-
-    dispatch({
-      type: 'patrolArtificialRecord/queryRouteInfoList',
-      payload: { ProjectId: projectId },
-    });
+    let params = {};
+    params.projectId = projectId;
+    params.auto = 1;
+    params.startDate = dayjs().subtract(1).format('YYYY-MM-DD');
+    params.endDate = dayjs().format('YYYY-MM-DD');
+    params.pageSize = 100;
+    params.currentPage = 1;
     dispatch({
-      type: 'patrolArtificialRecord/queryProcessSection',
-      payload: projectId,
+      type: 'patrolArtificialRecord/queryPatrol',
+      payload: params,
     });
-
-    UnityAction.addEventListener('group_id', (e) => {
-      setGroupId(e);
-    });
-
-    return () => {
-      UnityAction.off('group_id');
-    };
   }, []);
   return (
     <PageContent closeable={false}>
       <PageTitle returnable>自检记录</PageTitle>
-      <Form
-        layout="vertical"
-        labelAlign="left"
-        labelCol={{ span: 8 }}
-        wrapperCol={{ span: 16 }}
-        onSubmit={handleSearch}
-        form={form}
-      >
-        <Row gutter={16}>
-          <Col span={12}>
-            <FormItem
-              label="开始时间"
-              name="startDate"
-              initialValue={dayjs().subtract(1, 'M')}
-            >
-              <div style={{ width: '95%' }}>
-                <DatePicker allowClear={false} placeholder="选择开始日期" />
-              </div>
-            </FormItem>
-          </Col>
-          <Col span={12}>
-            <FormItem label="结束时间" name="endDate" initialValue={dayjs()}>
-              <div style={{ width: '95%' }}>
-                <DatePicker allowClear={false} placeholder="选择结束日期" />
-              </div>
-            </FormItem>
-          </Col>
-        </Row>
-        <Row gutter={16}>
-          <Col span={12}>
-            <FormItem label="状态" name="status">
-              <Select
-                placeholder="选择状态"
-                allowClear
-                style={{ width: '95%' }}
-              >
-                {statusList.map((item) => {
-                  return (
-                    <Option key={item.key} value={item.value}>
-                      {item.label}
-                    </Option>
-                  );
-                })}
-              </Select>
-            </FormItem>
-          </Col>
-          <Col span={12}>
-            <FormItem label="工艺段" name="groupId">
-              <Select
-                placeholder="选择工艺段"
-                allowClear
-                style={{ width: '95%' }}
-              >
-                {processList?.map((item) => {
-                  return (
-                    <Option key={item.id} value={item.group_id}>
-                      {item.name}
-                    </Option>
-                  );
-                })}
-              </Select>
-            </FormItem>
-          </Col>
-        </Row>
-        <div style={{ overflow: 'hidden' }}>
-          <Button
-            type="primary"
-            htmlType="submit"
-            style={{ float: 'right', marginBottom: 10 }}
-          >
-            查询
-          </Button>
-        </div>
-      </Form>
-      <div className="table-total">当前列表总数 {pagination?.total || 0}</div>
+
       <Table
         bordered
         loading={loading}
         columns={getColumns()}
-        dataSource={list.filter((item) => {
-          if (!groupId) return true;
-          if (groupId == item.RouteInfo.GroupID) return true;
-          return false;
-        })}
-        pagination={pagination}
-        onChange={TableOnChange}
+        dataSource={list}
       />
     </PageContent>
   );

+ 65 - 82
src/pages/EqSelfInspection/index.js

@@ -1,7 +1,6 @@
 import PageContent from '@/components/PageContent';
 import PageTitle from '@/components/PageTitle';
 import { GetTokenFromUrl, UnityAction } from '@/utils/utils';
-import { DiffFilled, FundFilled } from '@ant-design/icons';
 import { connect, history, useLocation, useParams } from '@umijs/max';
 import { Button, Form, Modal, Select, Spin, message } from 'antd';
 import dayjs from 'dayjs';
@@ -112,46 +111,49 @@ const EqSelfInspection = (props) => {
     <PageContent>
       <PageTitle>系统自检</PageTitle>
       <Spin spinning={loading} tip="正在自检中...">
-        <div className={`${styles.itemMain} card-box`} style={{ padding: 20 }}>
-          <div style={{ position: 'relative', display: 'flex' }}>
-            <div style={{ fontSize: 24 }}>
-              自检间隔:{autoReport?.RouteInfo?.PlanDur}h
-            </div>
-            <div className={styles.icon}>
-              <DiffFilled
-                style={{ cursor: 'pointer', marginRight: 20 }}
-                onClick={() => {
-                  history.push(
-                    `/self-inspection/list/${projectId}`,
-                  );
-                }}
-              />
-              <FundFilled
-                onClick={() => {
-                  history.push(
-                    `/self-inspection/statistics/${projectId}?JWT-TOKEN=${GetTokenFromUrl()}`,
-                  );
-                }}
-              />
-            </div>
+        <div
+          className={`${styles.itemMain} card-box`}
+          style={{ padding: '10px 20px' }}
+        >
+          <div style={{ fontSize: 20, color: 'rgba(110, 110, 110, 1)' }}>
+            自检间隔:{autoReport?.RouteInfo?.PlanDur}h
+          </div>
+
+          <div className={styles.icon}>
+            <div
+              className={styles.iconDiffFilled}
+              onClick={() => {
+                history.push(`/self-inspection/list/${projectId}`);
+              }}
+            ></div>
+            <div
+              className={styles.iconFundFilled}
+              onClick={() => {
+                history.push(
+                  `/self-inspection/statistics/${projectId}?JWT-TOKEN=${GetTokenFromUrl()}`,
+                );
+              }}
+            ></div>
           </div>
           <div className={styles.logoInfo}>
             <div className={styles.logo} />
-            <div style={{ display: 'flex', fontSize: 20 }}>
+            <div className={styles.logoTitle}>
               <div>系统自检发现</div>
               <div
                 style={{
-                  color: autoReport?.warningTotalNum === 0 ? '#333' : '#FE5850',
-                  margin: '0 6px 0 6px',
+                  color:
+                    autoReport?.warningTotalNum === 0
+                      ? '#333'
+                      : 'rgba(254, 88, 80, 1)',
+                  margin: '0 6px',
                 }}
               >
                 {autoReport?.warningTotalNum === 0
                   ? '暂无'
-                  : autoReport?.warningTotalNum || 0}
+                  : autoReport?.warningTotalNum + '项异常'}
               </div>
-              <div>项异常</div>
             </div>
-            <div style={{ fontSize: 20 }}>
+            <div className={styles.logoTime}>
               {autoReport?.CreatedTime
                 ? dayjs(autoReport?.CreatedTime).format('YYYY-MM-DD HH:mm')
                 : ''}
@@ -160,17 +162,10 @@ const EqSelfInspection = (props) => {
               <Button type="primary" onClick={HandleInspection}>
                 一键自检
               </Button>
-              <div
-                style={{
-                  position: 'absolute',
-                  display: 'flex',
-                  alignItems: 'flex-end',
-                  right: 0,
-                  height: '100%',
-                }}
-              >
-                <div>系统自检中</div>
-              </div>
+            </div>
+            <div className={styles.logoFont}>
+              系统自检中
+              <div className={styles.iconSetting}></div>
             </div>
           </div>
         </div>
@@ -192,20 +187,19 @@ const EqSelfInspection = (props) => {
             <WarningItem label={item.label} status={item.status} />
           ))}
         </Item>
-        <div className={styles.reportBtn}>
-          <Button
-            type="primary"
-            onClick={() => {
-              history.push(
-                `/self-inspection/detail/${projectId}/${
-                  autoReport?.Id
-                }?JWT-TOKEN=${GetTokenFromUrl()}`,
-              );
-            }}
-          >
-            查看自检报告
-          </Button>
-        </div>
+        <Button
+          className={styles.reportBtn}
+          type="primary"
+          onClick={() => {
+            history.push(
+              `/self-inspection/detail/${projectId}/${
+                autoReport?.Id
+              }?JWT-TOKEN=${GetTokenFromUrl()}`,
+            );
+          }}
+        >
+          查看自检报告
+        </Button>
 
         <Modal
           title="选择巡检路线"
@@ -253,11 +247,7 @@ const Item = (props) => {
   const renderRight = (status) => {
     switch (status) {
       case 0:
-        return (
-          <div className={styles.right} style={{ color: '#52c41a' }}>
-            正常
-          </div>
-        );
+        return <div className={`${styles.iconSuccess} ${styles.right}`}></div>;
       case 1:
         return (
           <div className={styles.right} style={{ color: '#FE5850' }}>
@@ -268,22 +258,13 @@ const Item = (props) => {
         return;
       // return <SyncOutlined className={styles.right} spin />;
       default:
-        return (
-          <div className={styles.right} style={{ color: '#52c41a' }}>
-            正常
-          </div>
-        );
+        return <div className={`${styles.iconSuccess} ${styles.right}`}></div>;
     }
   };
   return (
-    <div
-      className={`${styles.itemMain} card-box`}
-      style={{
-        paddingBottom: children ? 20 : 0,
-      }}
-    >
-      <div className={styles.item}>
-        <span>{name}</span>
+    <div className={`${styles.itemMain} card-box`}>
+      <div className={styles.item} style={{ height: children ? 60 : '' }}>
+        <span className={styles.itemName}>{name}</span>
         <span className={styles.warningText}>{warningText}</span>
         {renderRight(status)}
       </div>
@@ -297,16 +278,18 @@ const WarningItem = (props) => {
   return (
     <div className={styles.warningItem}>
       <span>{label}</span>
-      <div
-        style={{
-          color: status === 1 ? '#FE5850' : '#52c41a',
-          fontSize: 20,
-          position: 'absolute',
-          right: 20,
-        }}
-      >
-        {status === 0 ? '正常' : '异常'}
-      </div>
+
+      {status === 0 ? (
+        <div className={styles.iconSuccess}></div>
+      ) : (
+        <span
+          style={{
+            color: '#FE5850',
+          }}
+        >
+          异常
+        </span>
+      )}
     </div>
   );
 };

+ 78 - 19
src/pages/EqSelfInspection/index.less

@@ -1,10 +1,18 @@
 .icon {
   position: absolute;
-  right: 0;
-  font-size: 24px;
-  color: #40a9ff;
-  i {
-    margin-left: 10px;
+  top: 10px;
+  right: 18px;
+  display: flex;
+  .iconDiffFilled,
+  .iconFundFilled {
+    width: 28px;
+    height: 31px;
+    cursor: pointer;
+    background: url('@/assets/iconDiffFilled.png') no-repeat;
+  }
+  .iconFundFilled {
+    margin-left: 20px;
+    background-image: url('@/assets/iconFundFilled.png');
   }
 }
 .logoInfo {
@@ -12,11 +20,44 @@
   flex-direction: column;
   justify-content: center;
   align-items: center;
+  position: relative;
   .logo {
     background: url('@/assets/defense.png') no-repeat center;
     background-size: 100% 100%;
     width: 144px;
     height: 159px;
+    margin-bottom: 6px;
+  }
+  .logoTitle {
+    font-size: 20px;
+    font-weight: 400;
+    color: #6e6e6e;
+    line-height: 28px;
+    display: flex;
+  }
+  .logoTime {
+    font-size: 16px;
+    font-weight: 400;
+    color: #6e6e6e;
+    line-height: 22px;
+    margin-top: 6px;
+  }
+  .logoFont {
+    position: absolute;
+    display: flex;
+    align-items: center;
+    right: 0;
+    bottom: 0;
+    font-size: 20px;
+    font-weight: 400;
+    color: #6e6e6e;
+    line-height: 28px;
+    .iconSetting {
+      margin-left: 8px;
+      width: 20px;
+      height: 20px;
+      background: url('@/assets/icon-setting.png') no-repeat;
+    }
   }
 }
 .insbtn {
@@ -35,27 +76,30 @@
   }
 }
 .item {
-  // border: 2px;
-  // border-radius: 12px;
-  // background-color: rgba(240, 248, 255, 0.549);
-  min-height: 60px;
+  height: 80px;
   display: flex;
   align-items: center;
   position: relative;
-  span:first-child {
-    margin-left: 10px;
-    font-size: 22px;
-  }
+  padding: 0 20px;
   .right {
     position: absolute;
     right: 0;
     margin-right: 10px;
-    font-size: 24px;
+    font-size: 20px;
   }
   .warningText {
+    margin-left: 40px;
     font-size: 20px;
+    font-weight: 400;
     color: #fe5850;
-    margin-left: 40px;
+    line-height: 28px;
+  }
+  .itemName {
+    font-size: 20px;
+    font-weight: 500;
+    color: #4a4a4a;
+    line-height: 28px;
+    font-weight: bold;
   }
 }
 .warningItem {
@@ -63,14 +107,29 @@
   height: 60px;
   display: flex;
   align-items: center;
-  margin: 0 60px 0 60px;
+  justify-content: space-between;
+  padding: 0 20px;
+  border-bottom: 1px solid rgba(219, 219, 219, 1);
+  &:last-child {
+    border-bottom: none;
+  }
   span {
     font-size: 20px;
   }
 }
+.iconSuccess {
+  width: 28px;
+  height: 22px;
+  background: url('@/assets/icon-success.png') no-repeat;
+}
 .reportBtn {
-  display: flex;
-  justify-content: center;
+  margin-top: 40px;
+  width: 100%;
+  height: 70px;
+  display: block;
+  font-size: 22px;
+  font-weight: 400;
+  color: #ffffff;
 }
 .itemMain {
   background-size: 100% 100%;
@@ -92,7 +151,7 @@
   flex: 1;
   font-size: 26px;
   .num {
-    color: #F5AF3A;
+    color: #f5af3a;
     font-size: 30px;
     margin-bottom: 14px;
     font-weight: bold;

+ 7 - 1
src/pages/Smart/OptimizationTasks.js

@@ -125,6 +125,7 @@ const Produce = ({ projectId, queryMandate }) => {
               style={{ width: '100%' }}
               columns={columns}
               dataSource={data}
+              pagination={false}
             />
           </div>
         </>
@@ -207,7 +208,12 @@ const Cost = ({ projectId }) => {
           >
             <h3 className={styles.left}>任务内容</h3>
 
-            <Table className="table2" columns={columns} dataSource={data} />
+            <Table
+              className="table2"
+              columns={columns}
+              dataSource={data}
+              pagination={false}
+            />
           </div>
         </>
       )}

+ 5 - 3
src/pages/Smart/OptimizationTasks.less

@@ -79,8 +79,10 @@
   text-align: center;
   float: right;
 }
-:global {
-  .table2 .ant-table-thead {
-    background: rgba(245, 166, 35, 0.14);
+.table2 {
+  :global {
+    .ant-table-thead {
+      background: rgba(245, 166, 35, 0.14);
+    }
   }
 }