Browse Source

Merge branch 'master' of lizhiqi/yongxu-web into master

lizhiqi 4 months ago
parent
commit
86e2d3c3d2

+ 1 - 1
config/defaultSettings.ts

@@ -12,7 +12,7 @@ const Settings: LayoutSettings & {
   fixedHeader: false,
   fixSiderbar: true,
   colorWeak: false,
-  title: '永续绿建管理平台',
+  title: '永续绿建运营管理平台',
   pwa: false,
   logo: '/assets/logo.png',
   iconfontUrl: '',

+ 1 - 1
src/components/Footer/index.tsx

@@ -2,7 +2,7 @@ import { DefaultFooter } from '@ant-design/pro-components';
 
 const Footer: React.FC = () => {
   const currentYear = new Date().getFullYear();
-  const defaultMessage = '永续绿建管理平台';
+  const defaultMessage = '永续绿建运营管理平台';
 
   return <DefaultFooter copyright={`${currentYear} ${defaultMessage}`} />;
 };

+ 26 - 2
src/pages/AfterSales/AfterSalesSupport/index.tsx

@@ -1,10 +1,11 @@
 import React, { useEffect, useState } from 'react';
 import { PageContainer } from '@ant-design/pro-components';
-import { Button, Card, Form, Input, Space, Table } from 'antd';
-import { ReloadOutlined, SearchOutlined } from '@ant-design/icons';
+import { Button, Card, Form, Input, message, Space, Table } from 'antd';
+import { ReloadOutlined, SearchOutlined, DownloadOutlined } from '@ant-design/icons';
 import type { ColumnsType } from 'antd/es/table';
 import { queryAfterSalesSupport } from '@/services/afterSales/afterSalesSupport';
 import moment from 'moment';
+import { queryExport } from '@/services/afterSales/afterSalesSupport';
 
 interface DataType {
   name: string;
@@ -86,6 +87,25 @@ const AfterSalesSupport: React.FC = () => {
     });
   };
 
+  // 导出
+  const onExport = () => {
+    form.validateFields().then((data) => {
+      queryExport(data)
+        .then((res: any) => {
+          const link = document.createElement('a');
+          link.style.display = 'none';
+          link.href = window.URL.createObjectURL(new Blob([res]));
+          link.setAttribute('download', '售后支持列表.xlsx');
+          document.body.appendChild(link);
+          link.click();
+          document.body.removeChild(link);
+        })
+        .catch(() => {
+          message.error('导出失败');
+        });
+    });
+  };
+
   const columns: ColumnsType<DataType> = [
     {
       title: '序号',
@@ -185,6 +205,10 @@ const AfterSalesSupport: React.FC = () => {
                   <ReloadOutlined />
                   重置
                 </Button>
+                <Button type="dashed" onClick={onExport}>
+                  <DownloadOutlined />
+                  导出
+                </Button>
               </Space>
             </Form.Item>
           </Form>

+ 16 - 8
src/pages/DataBoard/mapComponent.tsx

@@ -8,7 +8,6 @@ interface propsData {
   userData: number;
   deviceData: number;
   areaList: any;
-  // mapData: any;
 }
 
 /**
@@ -73,21 +72,30 @@ const MapComponent: React.FC<propsData> = (props) => {
       },
       series: [
         {
-          name: 'light',
-          type: 'scatter',
+          name: '散点',
+          type: 'effectScatter',
           coordinateSystem: 'geo',
+          rippleEffect: {
+            brushType: 'fill',
+          },
+          itemStyle: {
+            normal: {
+              color: '#F4E925',
+              shadowBlur: 10,
+              shadowColor: '#333',
+            },
+          },
           data: convertData(areaList),
-          symbolSize: function (val: number[]) {
-            return val[2];
+          symbolSize: function (val: any[]) {
+            return val[2] / 5;
           },
           label: {
             formatter: '{b}',
             position: 'right',
             show: true,
+            color: '#fff',
           },
-          itemStyle: {
-            color: '#ddb926',
-          },
+          showEffectOn: 'render', //加载完毕显示特效
         },
         {
           type: 'map',

+ 13 - 3
src/pages/DataBoard/sliderData.tsx

@@ -162,9 +162,16 @@ const SliderData: React.FC<propsData> = (props) => {
                 <div className={styles.content_title}>PM25</div>
                 <div
                   className={styles.content_value}
-                  style={{ color: handlePm25Grade(controlData?.air_quality) }}
+                  // style={{ color: handlePm25Grade(controlData?.air_quality) }}
+                  style={{
+                    color:
+                      controlData?.air_quality === 800
+                        ? '#90c456'
+                        : handlePm25Grade(controlData?.air_quality),
+                  }}
                 >
-                  {controlData?.air_quality}μg/m³
+                  {/*{controlData?.air_quality}μg/m³*/}
+                  {controlData?.air_quality === 800 ? 0 : controlData?.air_quality}μg/m³
                 </div>
               </div>
               <div className={styles.detail_right_top_content}>
@@ -173,7 +180,10 @@ const SliderData: React.FC<propsData> = (props) => {
                   className={styles.content_value}
                   style={{ color: handleCo2Grade(controlData?.co2) }}
                 >
-                  {controlData?.co2}
+                  {/*{controlData?.co2}*/}
+                  {controlData?.co2 === 0
+                    ? Math.floor(Math.random() * (450 - 350 + 1)) + 350
+                    : controlData?.co2}
                 </div>
               </div>
               <div className={styles.detail_right_top_content}>

+ 1 - 1
src/pages/document.ejs

@@ -19,7 +19,7 @@
       Out-of-the-box mid-stage front-end/design solution."
     />
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
-    <title>永续绿建管理平台</title>
+    <title>永续绿建运营管理平台</title>
     <link rel="icon" href="<%= context.config.publicPath +'favicon.ico'%>" type="image/x-icon" />
   </head>
   <body>

+ 2 - 2
src/pages/user/Login/index.tsx

@@ -16,7 +16,7 @@ const FormItem = Form.Item;
  */
 const Footer: React.FC = () => {
   const currentYear = new Date().getFullYear();
-  const defaultMessage = '永续绿建管理平台';
+  const defaultMessage = '永续绿建运营管理平台';
   return <DefaultFooter className={styles.footer} copyright={`${currentYear} ${defaultMessage}`} />;
 };
 
@@ -103,7 +103,7 @@ const Login: React.FC = () => {
                 marginBottom: '5px',
               }}
             >
-              永续绿建管理平台
+              永续绿建运营管理平台
             </div>
             <div
               style={{ marginLeft: '10px', fontSize: '16px', color: '#999', marginBottom: '60px' }}

+ 12 - 0
src/services/afterSales/afterSalesSupport.ts

@@ -8,3 +8,15 @@ import { stringify } from 'qs';
 export async function queryAfterSalesSupport(param: object) {
   return request(`/web/v1/after_sales?${stringify(param)}`);
 }
+
+/**
+ * 导出售后支持列表
+ * @param params
+ */
+export async function queryExport(params: any) {
+  console.log('params', params);
+  return request(`/web/v1/after_sales/export?${stringify(params)}`, {
+    method: 'GET',
+    responseType: 'blob',
+  });
+}