xujunjie 2 anos atrás
pai
commit
dcaaf30044

BIN
src/assets/home-box-bg.png


BIN
src/assets/self-empty.png


+ 0 - 1
src/global.less

@@ -68,7 +68,6 @@ ol {
 // Remove link styles
 a {
   text-decoration: none;
-  color: inherit;
 }
 
 // Remove table border

+ 9 - 103
src/pages/EqSelfInspection/PatrolArtificialRecord/index.js → src/pages/EqSelfInspection/List/index.js

@@ -1,11 +1,10 @@
 import PageContent from '@/components/PageContent';
 import PageTitle from '@/components/PageTitle';
-import { UnityAction } from '@/utils/utils';
+import { GetTokenFromUrl, UnityAction } from '@/utils/utils';
 import { connect, history, useParams } from '@umijs/max';
 import { Button, Col, DatePicker, Form, Row, Select, Table } from 'antd';
 import dayjs from 'dayjs';
 import { Fragment, useEffect, useState } from 'react';
-import style from './index.less';
 
 const FormItem = Form.Item;
 const { Option } = Select;
@@ -14,81 +13,16 @@ const statusList = [
   { key: 2, value: '1', label: '异常' },
 ];
 
-function PatrolArtificialRecord(props) {
+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 [rowId, setRowId] = useState();
 
   const getColumns = () => {
-    var arr = [
-      {
-        title: '巡检时间',
-        dataIndex: 'CreatedTime',
-        width: '26%',
-        render: (text) => {
-          return text ? dayjs(text).format('YYYY-MM-DD HH:mm') : null;
-        },
-      },
-      {
-        title: '巡检路线',
-        dataIndex: 'RouteInfo',
-        width: '24%',
-        render: (record) => {
-          return record.Name;
-        },
-      },
-      {
-        title: '工艺段',
-        // dataIndex: 'RouteInfo',
-        width: '24%',
-        render: (record) => {
-          // GroupID
-          const name = processList?.find(
-            (item) => item.group_id == record?.RouteInfo?.GroupID,
-          )?.name;
-          return name || '-';
-        },
-      },
-      {
-        title: '状态',
-        width: '10%',
-        dataIndex: 'Status',
-        render: (text) => {
-          return text == 0 ? (
-            '正常'
-          ) : (
-            <div style={{ color: '#FF8600' }}>异常</div>
-          );
-        },
-      },
-    ];
-    arr.push({
-      title: '操作',
-      width: '16%',
-      render: (text, record) => {
-        return (
-          <Fragment>
-            {
-              <>
-                <a
-                  style={{ color: '#7BFFFB' }}
-                  onClick={(e) => {
-                    goToDetail(record, e);
-                  }}
-                >
-                  详情
-                </a>
-              </>
-            }
-          </Fragment>
-        );
-      },
-    });
-    arr = [
+    return [
       {
         title: '自检时间',
         dataIndex: 'CreatedTime',
@@ -99,10 +33,8 @@ function PatrolArtificialRecord(props) {
       },
       {
         title: '工艺段',
-        // dataIndex: 'RouteInfo',
         width: '24%',
         render: (record) => {
-          // GroupID
           const name = processList?.find(
             (item) => item.group_id == record?.RouteInfo?.GroupID,
           )?.name;
@@ -130,7 +62,6 @@ function PatrolArtificialRecord(props) {
               {
                 <>
                   <a
-                    style={{ color: '#7BFFFB' }}
                     onClick={(e) => {
                       goToDetail(record, e);
                     }}
@@ -144,13 +75,10 @@ function PatrolArtificialRecord(props) {
         },
       },
     ];
-    return arr;
   };
 
-  const getRecord = (pagination) => {
-    setRowId(null);
-    form.validateFields((err, fieldsValue) => {
-      if (err) return;
+  const getRecord = async (pagination) => {
+    form.validateFields().then((fieldsValue) => {
       fieldsValue.projectId = projectId;
       fieldsValue.auto = 1;
       fieldsValue.startDate = dayjs(fieldsValue.startDate).format('YYYY-MM-DD');
@@ -178,23 +106,9 @@ function PatrolArtificialRecord(props) {
     e.stopPropagation();
     UnityAction.sendMsg('reportDetail', '');
     history.push(
-      `/unity/eq-self-ins-statistics/detail/${projectId}/${record.Id}?JWT-TOKEN=`,
+      `/self-inspection/detail/${projectId}/${record.Id}?JWT-TOKEN=${GetTokenFromUrl()}`,
     );
   };
-  const setRowClassName = (record) => {
-    return record.Id === rowId ? style.clickRow : '';
-  };
-
-  const onRowClick = (event, record) => {
-    setRowId(record.Id);
-    dispatch({
-      type: 'patrolArtificialRecord/queryPatrolRecord',
-      payload: { recordId: record.Id },
-      callback: (data) => {
-        UnityAction.sendMsg('recordData', data);
-      },
-    });
-  };
 
   useEffect(() => {
     UnityAction.sendMsg('type', 2);
@@ -218,8 +132,8 @@ function PatrolArtificialRecord(props) {
     };
   }, []);
   return (
-    <PageContent>
-      <PageTitle></PageTitle>
+    <PageContent closeable={false}>
+      <PageTitle returnable>自检记录</PageTitle>
       <Form
         layout="vertical"
         labelAlign="left"
@@ -306,14 +220,6 @@ function PatrolArtificialRecord(props) {
         })}
         pagination={pagination}
         onChange={TableOnChange}
-        onRow={(record) => {
-          return {
-            onClick: (event) => {
-              onRowClick(event, record);
-            }, // 点击行
-          };
-        }}
-        rowClassName={setRowClassName}
       />
     </PageContent>
   );
@@ -324,4 +230,4 @@ export default connect(({ patrolArtificialRecord, loading }) => ({
   routeInfoList: patrolArtificialRecord.routeInfoList,
   loading: loading.models.patrolArtificialRecord,
   processList: patrolArtificialRecord.processList,
-}))(PatrolArtificialRecord);
+}))(List);

+ 0 - 0
src/pages/EqSelfInspection/PatrolArtificialRecord/index.less → src/pages/EqSelfInspection/List/index.less


+ 0 - 0
src/pages/EqSelfInspection/PatrolArtificialRecord/models/patrolRecord.js → src/pages/EqSelfInspection/List/models/patrolRecord.js


+ 6 - 3
src/pages/EqSelfInspection/components/Detail.js

@@ -885,9 +885,12 @@ function base64ToImageUrl(base64String) {
 
 function Empty() {
   return (
-    <div style={{}}>
-      {/* <img src={require('@/assets/empty.png')} style={{ margin: '20px 0' }} /> */}
-      <p style={{ textAlign: 'center' }}>自检正常</p>
+    <div>
+      <img
+        src={require('@/assets/self-empty.png')}
+        style={{ margin: '20px 0' }}
+      />
+      <p style={{ textAlign: 'center', color: '#555' }}>自检正常</p>
     </div>
   );
 }

+ 31 - 0
src/pages/Home/index.js

@@ -0,0 +1,31 @@
+
+import { useRequest,useParams } from '@umijs/max';
+import styles from "./index.less"
+
+const HomePage= (props) => {
+  return (
+    <div>
+      
+    </div>
+    
+  );
+};
+
+const LeftContent = (props) => {
+  return (
+    <div>
+      <div className={styles.box}></div>
+    </div>
+    
+  );
+};
+const rightContent = (props) => {
+  return (
+    <div>
+      
+    </div>
+    
+  );
+};
+
+export default HomePage;

+ 3 - 2
src/pages/Home/index.less

@@ -1,3 +1,4 @@
-.container {
-  padding-top: 80px;
+.box {
+  background: url("@/assets/home-box-bg.png") no-repeat center;
+  background-size: 100% 100%;
 }

+ 0 - 18
src/pages/Home/index.tsx

@@ -1,18 +0,0 @@
-import Guide from '@/components/Guide';
-import { trim } from '@/utils/format';
-import { PageContainer } from '@ant-design/pro-components';
-import { useModel } from '@umijs/max';
-import styles from './index.less';
-
-const HomePage: React.FC = () => {
-  const { name } = useModel('global');
-  return (
-    <PageContainer ghost>
-      <div className={styles.container}>
-        <Guide name={trim(name)} />
-      </div>
-    </PageContainer>
-  );
-};
-
-export default HomePage;

+ 1 - 1
src/services/eqSelfInspection.js

@@ -17,7 +17,7 @@ export async function queryUserList(param) {
   return request(`/api/v1/user/project/${param.projectId}`)
 }
 export async function queryPatrol(params) {
-  return request(`/patrol/data/${params.projectId}?${stringify(params)}`);
+  return request(`/api/v1/patrol/data/${params.projectId}?${stringify(params)}`);
 }
 
 export async function queryAnalysisDict() {

+ 1 - 1
src/utils/utils.js

@@ -53,7 +53,7 @@ export function IsVedio(fileName) {
 
 export function GetTokenFromUrl() {
   const params = GetRequest(window.location.href);
-  if (params['JWT-TOKEN'] == 'undefined') return '';
+  if (!params['JWT-TOKEN'] || params['JWT-TOKEN'] == 'undefined') return '';
   return params['JWT-TOKEN'];
 }