wzyyy 3 роки тому
батько
коміт
8f913f07e5

+ 2 - 3
src/pages/home/index.tsx

@@ -22,11 +22,10 @@ const Home = () => {
     service.queryView().then((resp) => {
     service.queryView().then((resp) => {
       if (resp.status === 200) {
       if (resp.status === 200) {
         if (resp.result.length == 0) {
         if (resp.result.length == 0) {
-          setCurrent('ops');
+          setCurrent('init');
         } else {
         } else {
-          // setCurrent(resp.result[0]?.content);
+          setCurrent(resp.result[0]?.content);
         }
         }
-        setCurrent('ops');
       }
       }
     });
     });
   }, []);
   }, []);

+ 17 - 0
src/pages/home/init/index.less

@@ -0,0 +1,17 @@
+.title {
+  margin-bottom: 10px;
+  font-weight: 400;
+  font-size: 26px;
+  text-align: center;
+}
+
+.item {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+
+  img {
+    width: 80%;
+    margin-bottom: 5px;
+  }
+}

+ 35 - 14
src/pages/home/init/index.tsx

@@ -1,30 +1,51 @@
-import { Button, Radio } from 'antd';
+import { Button, Col, Radio, Row } from 'antd';
 import { useState } from 'react';
 import { useState } from 'react';
 import { service } from '..';
 import { service } from '..';
+import styles from './index.less';
 
 
 interface Props {
 interface Props {
   changeView: (view: any) => void;
   changeView: (view: any) => void;
 }
 }
 
 
 const Init = (props: Props) => {
 const Init = (props: Props) => {
-  const options = [
-    { label: '设备接入视图', value: 'device' },
-    { label: '运维管理视图', value: 'ops' },
-    { label: '综合管理视图', value: 'comprehensive' },
-  ];
-
   const [value, setValue] = useState<string>('device');
   const [value, setValue] = useState<string>('device');
 
 
+  const viewMap = [
+    {
+      title: '设备接入视图',
+      img: require('/public/images/home/device.png'),
+      value: 'device',
+    },
+    {
+      title: '运维管理视图',
+      img: require('/public/images/home/ops.png'),
+      value: 'ops',
+    },
+    {
+      title: '综合管理视图',
+      img: require('/public/images/home/comprehensive.png'),
+      value: 'comprehensive',
+    },
+  ];
   return (
   return (
     <div>
     <div>
-      <Radio.Group
-        options={options}
-        value={value}
-        onChange={(e) => setValue(e.target.value)}
-        optionType="button"
-      />
-      <div>
+      <div className={styles.title}>请选择首页视图</div>
+      <Radio.Group value={value} onChange={(e) => setValue(e.target.value)}>
+        <Row gutter={24}>
+          {viewMap.map((item) => (
+            <Col span={8} key={item.value}>
+              <div className={styles.item}>
+                <img src={item.img} className={styles.item} />
+                <Radio value={item.value}>{item.title}</Radio>
+              </div>
+            </Col>
+          ))}
+        </Row>
+      </Radio.Group>
+
+      <div style={{ textAlign: 'center', marginTop: 30 }}>
         <Button
         <Button
+          type="primary"
           onClick={() => {
           onClick={() => {
             service
             service
               .setView({
               .setView({

+ 13 - 5
src/pages/rule-engine/Alarm/Configuration/Save/index.tsx

@@ -85,20 +85,28 @@ const Save = (props: Props) => {
   );
   );
 
 
   const getScene = () => {
   const getScene = () => {
+    const map = {
+      product: 'device',
+      device: 'device',
+      org: 'device',
+      other: undefined,
+    };
     return service
     return service
       .getScene(
       .getScene(
         encodeQuery({
         encodeQuery({
           terms: {
           terms: {
-            triggerType: form.getValuesIn('targetType'),
+            triggerType: map[form.getValuesIn('targetType')],
           },
           },
         }),
         }),
       )
       )
       .then((resp) => {
       .then((resp) => {
         Store.set('scene-data', resp.result);
         Store.set('scene-data', resp.result);
-        return resp.result.map((item: { id: string; name: string }) => ({
-          label: item.name,
-          value: item.id,
-        }));
+        return form.getValuesIn('targetType')
+          ? resp.result.map((item: { id: string; name: string }) => ({
+              label: item.name,
+              value: item.id,
+            }))
+          : [];
       });
       });
   };
   };
 
 

+ 1 - 2
src/pages/rule-engine/DashBoard/index.tsx

@@ -123,8 +123,7 @@ const Dashboard = observer(() => {
         series: [
         series: [
           {
           {
             name: '告警数',
             name: '告警数',
-            data: fifteenData.map((item, index) => index * 6),
-
+            data: fifteenData.map((item) => item.value),
             type: 'bar',
             type: 'bar',
             itemStyle: {
             itemStyle: {
               color: '#2F54EB',
               color: '#2F54EB',

+ 2 - 0
src/pages/system/Basis/index.less

@@ -1,5 +1,6 @@
 .content {
 .content {
   margin-left: 30px;
   margin-left: 30px;
+
   .text::before {
   .text::before {
     display: inline-block;
     display: inline-block;
     margin-right: 4px;
     margin-right: 4px;
@@ -9,6 +10,7 @@
     line-height: 1;
     line-height: 1;
     content: '*';
     content: '*';
   }
   }
+
   :global {
   :global {
     .ant-upload.ant-upload-select-picture-card {
     .ant-upload.ant-upload-select-picture-card {
       width: 205px;
       width: 205px;

+ 2 - 2
src/pages/system/Platforms/index.tsx

@@ -2,8 +2,8 @@ import { PageContainer } from '@ant-design/pro-layout';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
 import { useRef, useState } from 'react';
 import { useRef, useState } from 'react';
-import { useIntl, useHistory } from 'umi';
-import { BadgeStatus, PermissionButton, AIcon } from '@/components';
+import { useHistory, useIntl } from 'umi';
+import { AIcon, BadgeStatus, PermissionButton } from '@/components';
 import SearchComponent from '@/components/SearchComponent';
 import SearchComponent from '@/components/SearchComponent';
 import {
 import {
   DeleteOutlined,
   DeleteOutlined,