sun-chaochao пре 3 година
родитељ
комит
c4de4cae73

BIN
public/images/login.png


BIN
public/images/login2.png


+ 5 - 8
src/components/DashBoard/echarts.tsx

@@ -1,24 +1,21 @@
 import { useEffect, useRef } from 'react';
 import * as echarts from 'echarts/core';
-import type { ECharts } from 'echarts';
+import type { ECharts, EChartsOption } from 'echarts';
 import {
-  TitleComponent,
-  ToolboxComponent,
-  TooltipComponent,
   GridComponent,
   LegendComponent,
   MarkLineComponent,
+  TitleComponent,
+  ToolboxComponent,
+  TooltipComponent,
 } from 'echarts/components';
 
-import { LineChart } from 'echarts/charts';
-import { PieChart } from 'echarts/charts';
-import { BarChart } from 'echarts/charts';
+import { BarChart, LineChart, PieChart } from 'echarts/charts';
 
 import { UniversalTransition } from 'echarts/features';
 import { CanvasRenderer } from 'echarts/renderers';
 
 import Style from './index.less';
-import type { EChartsOption } from 'echarts';
 import classNames from 'classnames';
 
 export interface EchartsProps {

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

@@ -5,6 +5,7 @@
   padding: 24px;
   background-color: #fff;
 }
+
 .header {
   display: flex;
   gap: 20px;

+ 4 - 0
src/pages/home/device/index.tsx

@@ -0,0 +1,4 @@
+const Device = () => {
+  return <div>设备接入视图</div>;
+};
+export default Device;

+ 24 - 0
src/pages/home/index.tsx

@@ -0,0 +1,24 @@
+import { PageContainer } from '@ant-design/pro-layout';
+import { Button } from 'antd';
+import { useState } from 'react';
+import Device from './device';
+import Init from './init';
+import Ops from './ops';
+
+const ViewMap = {
+  init: <Init />,
+  device: <Device />,
+  ops: <Ops />,
+};
+
+const Home = () => {
+  const [current, setCurrent] = useState<'init' | 'device' | 'ops'>('init');
+
+  return (
+    <PageContainer>
+      <Button onClick={() => setCurrent('device')}>切换视图</Button>
+      {ViewMap[current]}
+    </PageContainer>
+  );
+};
+export default Home;

+ 4 - 0
src/pages/home/init/index.tsx

@@ -0,0 +1,4 @@
+const Init = () => {
+  return <div>初始化视图</div>;
+};
+export default Init;

+ 4 - 0
src/pages/home/ops/index.tsx

@@ -0,0 +1,4 @@
+const Ops = () => {
+  return <div>运维管理视图</div>;
+};
+export default Ops;

+ 4 - 4
src/pages/rule-engine/Alarm/Config/index.tsx

@@ -355,18 +355,18 @@ const Config = () => {
     const outputConfig: IOConfigItem = await outputForm.submit();
     const inputResp = await service.saveOutputData({
       config: {
-        config: inputConfig,
+        config: outputConfig,
       },
-      id: inputConfig.id,
+      id: outputConfig.id,
       sourceType: 'kafka',
       exchangeType: 'producer',
     });
     const outputResp = await service.saveOutputData({
       config: {
         sourceType: 'kafka',
-        config: outputConfig,
+        config: inputConfig,
       },
-      id: outputConfig.id,
+      id: inputConfig.id,
       sourceType: 'kafka',
       exchangeType: 'consume',
     });

+ 38 - 0
src/pages/rule-engine/DashBoard/index.less

@@ -0,0 +1,38 @@
+.media-dash-board {
+  .top-card-items {
+    margin-bottom: 12px;
+
+    .top-card-item {
+      width: 25%;
+      padding: 6px 24px;
+      border: 1px solid #e3e3e3;
+
+      .top-card-top {
+        display: flex;
+        padding: 12px 0;
+
+        .top-card-top-left {
+          width: 80px;
+        }
+
+        .top-card-top-right {
+          .top-card-total {
+            font-weight: bold;
+            font-size: 20px;
+          }
+        }
+      }
+
+      .top-card-bottom {
+        display: flex;
+        justify-content: space-between;
+        padding: 12px 0;
+        border-top: 1px solid #e3e3e3;
+      }
+    }
+  }
+
+  .media-dash-board-body {
+    border: 1px solid #f0f0f0;
+  }
+}

+ 0 - 37
src/pages/rule-engine/Dashboard/index.tsx

@@ -1,37 +0,0 @@
-import { PageContainer } from '@ant-design/pro-layout';
-// import {EChartsOption} from "echarts";
-// import {useState} from "react";
-
-const Dashboard = () => {
-  // const [options, setOptions] = useState<EChartsOption>({});
-  //
-  // const getEcharts = async (data: any) => {
-  //
-  // };
-  return (
-    <PageContainer>
-      123
-      {/*<StatisticCard*/}
-      {/*  title="今日告警"*/}
-      {/*  statistic={{*/}
-      {/*    value: 75,*/}
-      {/*    suffix: "次"*/}
-      {/*  }}*/}
-      {/*  chart={*/}
-      {/*    <img*/}
-      {/*      src="https://gw.alipayobjects.com/zos/alicdn/PmKfn4qvD/mubiaowancheng-lan.svg"*/}
-      {/*      width="100%"*/}
-      {/*      alt="进度条"*/}
-      {/*    />*/}
-      {/*  }*/}
-      {/*  footer={*/}
-      {/*    <>*/}
-      {/*      <Statistic value={15.1} title="当月告警" suffix="次" layout="horizontal"/>*/}
-      {/*    </>*/}
-      {/*  }*/}
-      {/*  style={{width: 250}}*/}
-      {/*/>*/}
-    </PageContainer>
-  );
-};
-export default Dashboard;

+ 1 - 1
src/pages/system/DataSource/Management/DataRow.tsx

@@ -1,4 +1,4 @@
-import { Form, FormGrid, FormItem, Input, Password, NumberPicker, Radio } from '@formily/antd';
+import { Form, FormGrid, FormItem, Input, NumberPicker, Password, Radio } from '@formily/antd';
 import { createForm } from '@formily/core';
 import type { ISchema } from '@formily/react';
 import { createSchemaField } from '@formily/react';

+ 1 - 1
src/pages/system/DataSource/Management/EditTable.tsx

@@ -1,4 +1,4 @@
-import { FormItem, Input, ArrayTable, Editable, Form, NumberPicker, Radio } from '@formily/antd';
+import { ArrayTable, Editable, Form, FormItem, Input, NumberPicker, Radio } from '@formily/antd';
 import { createForm } from '@formily/core';
 import { createSchemaField } from '@formily/react';
 import { Button } from 'antd';

+ 1 - 1
src/pages/system/DataSource/Management/index copy.tsx

@@ -4,11 +4,11 @@ import { useEffect, useRef, useState } from 'react';
 import { service } from '@/pages/system/DataSource';
 import { useIntl, useLocation } from 'umi';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
+import ProTable from '@jetlinks/pro-table';
 import PermissionButton from '@/components/PermissionButton';
 import { DeleteOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons';
 import usePermissions from '@/hooks/permission';
 import SearchComponent from '@/components/SearchComponent';
-import ProTable from '@jetlinks/pro-table';
 import DataTable from './DataTable';
 import styles from './index.less';
 import DataRow from './DataRow';

+ 1 - 0
src/pages/system/DataSource/Management/index.less

@@ -6,6 +6,7 @@
 
   .left {
     width: 280px;
+
     .tables {
       :global {
         .ant-tree-treenode .ant-tree-node-selected {

+ 1 - 0
src/utils/menu/router.ts

@@ -1,5 +1,6 @@
 /** 路由Code */
 export enum MENUS_CODE {
+  'home' = 'home',
   'Analysis/CPU' = 'Analysis/CPU',
   'Analysis/DeviceChart' = 'Analysis/DeviceChart',
   'Analysis/DeviceMessage' = 'Analysis/DeviceMessage',