Selaa lähdekoodia

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

xujunjie 1 vuosi sitten
vanhempi
commit
7f51a09281

+ 5 - 1
src/app.ts

@@ -2,8 +2,12 @@
 
 // import { RequestConfig, history } from '@umijs/max';
 import { getToken, GetTokenFromUrl } from '@/utils/utils';
-import { history, RequestConfig } from '@umijs/max';
+import { RequestConfig } from '@umijs/max';
 import { message } from 'antd';
+import dayjs from 'dayjs';
+import 'dayjs/locale/zh-cn';
+
+dayjs.locale('zh-cn');
 
 // 全局初始化数据配置,用于 Layout 用户信息和权限初始化
 // 更多信息见文档:https://umijs.org/docs/api/runtime-config#getinitialstate

BIN
src/assets/smartOps/icon01.png


BIN
src/assets/smartOps/icon02.png


BIN
src/assets/smartOps/icon03.png


+ 14 - 10
src/components/PageContent/index.js

@@ -1,5 +1,7 @@
 import { UnityAction } from '@/utils/utils';
 import { CloseOutlined } from '@ant-design/icons';
+import { ConfigProvider } from 'antd';
+import locale from 'antd/es/locale/zh_CN';
 import styles from './index.less';
 
 export default (props) => {
@@ -10,16 +12,18 @@ export default (props) => {
   };
 
   return (
-    <div className={styles.page} style={style}>
-      {closeable && (
-        <CloseOutlined
-          onClick={handleClose}
-          className={styles.close}
-          style={{ top: tabs ? 65 : '' }}
-        />
-      )}
+    <ConfigProvider locale={locale}>
+      <div className={styles.page} style={style}>
+        {closeable && (
+          <CloseOutlined
+            onClick={handleClose}
+            className={styles.close}
+            style={{ top: tabs ? 65 : '' }}
+          />
+        )}
 
-      {children}
-    </div>
+        {children}
+      </div>
+    </ConfigProvider>
   );
 };

+ 27 - 21
src/pages/SmartOps/Analysis.js

@@ -1,3 +1,4 @@
+import TabsContent from '@/components/TabsContent';
 import { UnityAction } from '@/utils/utils';
 import { connect } from '@umijs/max';
 import { Button, Spin, Table, Tabs } from 'antd';
@@ -164,27 +165,32 @@ const Analysis = (props) => {
 
   return (
     <Spin spinning={loading}>
-      <Tabs defaultActiveKey="1" onChange={onTabChange}>
-        {data?.map((item) => (
-          <TabPane
-            tab={`${item.name}(${item.data?.length || 0})`}
-            key={item.type}
-          >
-            <Table
-              dataSource={item.data}
-              columns={columns}
-              // rowKey={'DeviceCode'}
-              // rowSelection={rowSelection}
-              rowClassName={setRowClassName}
-              onRow={(record, index) => ({
-                onClick: () => onSelectRow(record, index),
-              })}
-              pagination={false}
-              scroll={{ y: document.body.clientHeight - 542 }}
-            />
-          </TabPane>
-        ))}
-      </Tabs>
+      <TabsContent
+        small={true}
+        center={false}
+        defaultActiveKey="1"
+        items={data?.map((item) => {
+          return {
+            label: `${item.name}(${item.data?.length || 0})`,
+            key: item.type,
+            children: (
+              <Table
+                dataSource={item.data}
+                columns={columns}
+                // rowKey={'DeviceCode'}
+                // rowSelection={rowSelection}
+                rowClassName={setRowClassName}
+                onRow={(record, index) => ({
+                  onClick: () => onSelectRow(record, index),
+                })}
+                pagination={false}
+                scroll={{ y: document.body.clientHeight - 542 }}
+              />
+            ),
+          };
+        })}
+        onChange={onTabChange}
+      />
     </Spin>
   );
 };

+ 15 - 15
src/pages/SmartOps/HistoryRecord.js

@@ -163,27 +163,27 @@ const HistoryRecord = (props) => {
     <PageContent>
       <Spin spinning={loading}>
         <div className={styles.searchContent}>
-          <Button
+          {/* <Button
             className={[styles.marginBottom, styles.marginRight].join(' ')}
             type="primary"
             onClick={() => navigate(-1)}
           >
             返回
+          </Button> */}
+          {/* <div className={styles.searchContent}> */}
+          日期:
+          <RangePicker
+            className={styles.timePicker}
+            onChange={(value) => handleParamsChange('date', value)}
+          />
+          <Button
+            className={styles.marginLeft}
+            type="primary"
+            onClick={() => handleSearch()}
+          >
+            查询
           </Button>
-          <div className={styles.searchContent}>
-            日期:
-            <RangePicker
-              className={styles.timePicker}
-              onChange={(value) => handleParamsChange('date', value)}
-            />
-            <Button
-              className={styles.marginLeft}
-              type="primary"
-              onClick={() => handleSearch()}
-            >
-              查询
-            </Button>
-          </div>
+          {/* </div> */}
         </div>
         <Table
           dataSource={data?.list}

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

@@ -183,13 +183,13 @@ const OperationRecord = (props) => {
     <PageContent>
       <Spin spinning={loading}>
         <div className={styles.searchContent}>
-          <Button
+          {/* <Button
             className={styles.marginRight}
             type="primary"
             onClick={() => navigate(-1)}
           >
             返回
-          </Button>
+          </Button> */}
           日期:
           <RangePicker
             className={[styles.timePicker, styles.marginRight].join(' ')}

+ 3 - 2
src/pages/SmartOps/index.js

@@ -1,5 +1,6 @@
 import PageContent from '@/components/PageContent';
 import PageTitle from '@/components/PageTitle';
+import TabsContent from '@/components/TabsContent';
 import {
   getHistoryRecord,
   queryProjectConfig,
@@ -323,7 +324,7 @@ function SmartOps(props) {
         <div className={styles.text}>通过智慧分析预计可省{profitData}元</div>
       </div>
       <div className={styles.tabContent}>
-        <Tabs
+        <TabsContent
           defaultActiveKey="1"
           items={[
             {
@@ -352,7 +353,7 @@ function SmartOps(props) {
             },
           ]}
           onChange={onChangeTab}
-        ></Tabs>
+        />
       </div>
     </PageContent>
   );

+ 19 - 15
src/pages/SmartOps/index.less

@@ -1,18 +1,19 @@
 .topContent {
   padding: 8px 12px;
   margin: 16px 0;
-  color: #f8f8f8;
+  color: #1c50b3;
+  font-size: 28px;
   .titleContent {
     display: flex;
     align-items: center;
     justify-content: space-between;
     .time {
-      font-size: 20px;
+      // font-size: 20px;
       color: #6e6e6e;
     }
     .iconLeft {
-      width: 27px;
-      height: 27px;
+      width: 38px;
+      height: 38px;
       background: url('@/assets/smartOps/icon06.png') no-repeat center;
       background-size: 100% 100%;
     }
@@ -24,6 +25,7 @@
     }
   }
   .middle {
+    margin: 10px 0;
     display: flex;
     align-items: center;
     justify-content: center;
@@ -58,8 +60,8 @@
       flex-direction: column;
       align-items: flex-end;
       .item1 {
-        width: 475px;
-        height: 60px;
+        width: 585px;
+        height: 72px;
         padding-left: 64px;
         white-space: nowrap;
         line-height: 60px;
@@ -68,8 +70,8 @@
         background-size: 100% 100%;
       }
       .item2 {
-        width: 427px;
-        height: 60px;
+        width: 527px;
+        height: 72px;
         padding-left: 24px;
         white-space: nowrap;
         line-height: 60px;
@@ -80,7 +82,7 @@
       .item3 {
         background: url('@/assets/smartOps/icon03.png') no-repeat center;
         background-size: 100% 100%;
-        width: 471px;
+        width: 581px;
         height: 60px;
         padding-left: 64px;
         white-space: nowrap;
@@ -89,9 +91,11 @@
     }
   }
   .text {
-    padding: 8px 54px;
+    padding: 8px 20px;
     line-height: 24px;
-    text-align: center;
+    font-size: 24px;
+    color: #4a90e2;
+    // text-align: center;
   }
 }
 
@@ -139,18 +143,18 @@
   display: flex;
   align-items: center;
   margin-bottom: 20px;
-  color: #ffffff;
-  font-size: 18px;
+  color: #4a4a4a;
+  font-size: 24px;
   white-space: nowrap;
   :global {
     .ant-select {
       margin: 0 40px 0 10px;
-      background-color: #284e83;
+      // background-color: #284e83;
     }
   }
 }
 .timePicker {
-  background-color: #284e83;
+  // background-color: #284e83;
 }
 
 .form {