wzyyy 3 лет назад
Родитель
Сommit
6b1188e6f5

+ 2 - 1
src/components/FBraftEditor/index.tsx

@@ -19,7 +19,8 @@ const FBraftEditor = connect((props: Props) => {
       {
         // @ts-ignore
         <BraftEditor
-          style={{ height: 350 }}
+          style={{ border: '1px solid #dbd8d8' }}
+          contentStyle={{ height: 300 }}
           placeholder={props.placeholder}
           value={editorState}
           onChange={(state) => {

+ 3 - 3
src/pages/device/Instance/Detail/Parsing/index.tsx

@@ -166,7 +166,7 @@ const Parsing = (props: Props) => {
       <div>
         <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 10 }}>
           <div style={{ display: 'flex', alignItems: 'center' }}>
-            <div>
+            <div style={{ color: '#a6a6a6' }}>
               {props.tag === 'device' ? (
                 <>
                   <ExclamationCircleOutlined style={{ marginRight: 5 }} />
@@ -283,7 +283,7 @@ const Parsing = (props: Props) => {
             backgroundColor: '#f7f7f7',
           }}
         >
-          <div style={{ width: '49%' }}>
+          <div style={{ width: '49.5%' }}>
             <div>
               <div style={{ display: 'flex', justifyContent: 'space-between' }}>
                 <div style={{ fontWeight: 600, fontSize: 14, marginTop: 10 }}>模拟输入</div>
@@ -331,7 +331,7 @@ const Parsing = (props: Props) => {
               />
             </div>
           </div>
-          <div style={{ width: '49%' }}>
+          <div style={{ width: '49.5%' }}>
             <div>
               <div style={{ fontWeight: 600, fontSize: 14, marginTop: 10 }}>运行结果</div>
               <Input.TextArea

+ 1 - 1
src/pages/device/Product/Detail/index.tsx

@@ -140,7 +140,7 @@ const ProductDetail = observer(() => {
   };
 
   const initMetadata = () => {
-    service.getProductDetail(param?.id).subscribe((data) => {
+    service.getProductDetail(param?.id).subscribe((data: any) => {
       if (data.metadata) {
         const metadata: DeviceMetadata = JSON.parse(data.metadata);
         MetadataAction.insert(metadata);

+ 1 - 1
src/pages/home/components/GuideHome.tsx

@@ -47,7 +47,7 @@ const GuideItem = (props: GuideItemProps) => {
           <img src={props.img} />
         </div>
         <div>
-          <div className={'item-english'}>{`STP${props.index}`}</div>
+          <div className={'item-english'}>{`STEP${props.index}`}</div>
           <div
             className={'item-title'}
             style={{

+ 4 - 2
src/pages/home/components/Statistics.tsx

@@ -10,6 +10,8 @@ type StatisticsItem = {
 
 interface StatisticsProps {
   extra?: React.ReactNode | string;
+  style?: any;
+  height?: any;
   data: StatisticsItem[];
   title: string;
 }
@@ -18,9 +20,9 @@ const defaultImage = require('/public/images/home/top-1.png');
 
 const Statistics = (props: StatisticsProps) => {
   return (
-    <div className={'home-statistics'}>
+    <div className={'home-statistics'} style={{ height: props.height }}>
       <Title title={props.title} extra={props.extra} />
-      <div className={'home-statistics-body'}>
+      <div className={'home-statistics-body'} style={props.style}>
         {props.data.map((item) => (
           <div className={'home-guide-item'} key={item.name}>
             <div className={'item-english'}>{item.name}</div>

+ 87 - 79
src/pages/home/device/index.tsx

@@ -1,6 +1,6 @@
 import { Col, message, Row, Tooltip } from 'antd';
 import { PermissionButton } from '@/components';
-import { Body, Guide } from '../components';
+import { Body } from '../components';
 import Statistics from '../components/Statistics';
 import Steps from '../components/Steps';
 import { getMenuPathByCode, MENUS_CODE } from '@/utils/menu';
@@ -14,7 +14,7 @@ import DeviceChoose from '../components/DeviceChoose';
 const Device = () => {
   const productPermission = PermissionButton.usePermission('device/Product').permission;
   const devicePermission = PermissionButton.usePermission('device/Instance').permission;
-  const rulePermission = PermissionButton.usePermission('rule-engine/Instance').permission;
+  // const rulePermission = PermissionButton.usePermission('rule-engine/Instance').permission;
 
   const [productCount, setProductCount] = useState<number>(0);
   const [deviceCount, setDeviceCount] = useState<number>(0);
@@ -44,86 +44,41 @@ const Device = () => {
   const history = useHistory();
   // // 跳转
 
-  const guideList = [
-    {
-      key: 'product',
-      name: '创建产品',
-      english: 'STP 1',
-      auth: !!productPermission.add,
-      url: 'device/Product',
-      param: {
-        save: true,
-      },
-    },
-    {
-      key: 'device',
-      name: '创建设备',
-      english: 'STP 2',
-      auth: !!devicePermission.add,
-      url: 'device/Instance',
-      param: {
-        save: true,
-      },
-    },
-    {
-      key: 'rule-engine',
-      name: '规则引擎',
-      english: 'STP 3',
-      auth: !!rulePermission.add,
-      url: 'rule-engine/Instance',
-      param: {
-        save: true,
-      },
-    },
-  ];
+  // const guideList = [
+  //   {
+  //     key: 'product',
+  //     name: '创建产品',
+  //     english: 'STEP1',
+  //     auth: !!productPermission.add,
+  //     url: 'device/Product',
+  //     param: {
+  //       save: true,
+  //     },
+  //   },
+  //   {
+  //     key: 'device',
+  //     name: '创建设备',
+  //     english: 'STEP2',
+  //     auth: !!devicePermission.add,
+  //     url: 'device/Instance',
+  //     param: {
+  //       save: true,
+  //     },
+  //   },
+  //   {
+  //     key: 'rule-engine',
+  //     name: '规则引擎',
+  //     english: 'STEP3',
+  //     auth: !!rulePermission.add,
+  //     url: 'rule-engine/Instance',
+  //     param: {
+  //       save: true,
+  //     },
+  //   },
+  // ];
 
   return (
     <Row gutter={24}>
-      <Col span={14}>
-        <Guide
-          title="物联网引导"
-          data={guideList}
-          // jump={(auth: boolean, url: string, param: string) => {
-          //   pageJump(auth, url, param);
-          // }}
-        />
-      </Col>
-      <Col span={10}>
-        <Statistics
-          data={[
-            {
-              name: '产品数量',
-              value: productCount,
-              children: '',
-            },
-            {
-              name: '设备数量',
-              value: deviceCount,
-              children: '',
-            },
-          ]}
-          title="设备统计"
-          extra={
-            <div style={{ fontSize: 14, fontWeight: 400 }}>
-              <a
-                onClick={() => {
-                  const url = getMenuPathByCode(MENUS_CODE['device/DashBoard']);
-                  if (!!url) {
-                    history.push(`${url}`);
-                  } else {
-                    message.warning('暂无权限,请联系管理员');
-                  }
-                }}
-              >
-                详情
-              </a>
-            </div>
-          }
-        />
-      </Col>
-      <Col span={24}>
-        <Body title={'平台架构图'} english={'PLATFORM ARCHITECTURE DIAGRAM'} />
-      </Col>
       <Col span={24}>
         <Steps
           title={
@@ -204,6 +159,59 @@ const Device = () => {
           ]}
         />
       </Col>
+      <Col span={18} style={{ marginTop: 24 }}>
+        <Body
+          title={'平台架构图'}
+          english={'PLATFORM ARCHITECTURE DIAGRAM'}
+          url={require('/public/images/home/content1.png')}
+        />
+        {/* <Guide
+          title="物联网引导"
+          data={guideList}
+        // jump={(auth: boolean, url: string, param: string) => {
+        //   pageJump(auth, url, param);
+        // }}
+        /> */}
+      </Col>
+      <Col span={6} style={{ marginTop: 24 }}>
+        <Statistics
+          style={{ gridTemplateColumns: 'repeat(1, 1fr)' }}
+          height={448}
+          data={[
+            {
+              name: '产品数量',
+              value: productCount,
+              children: '',
+            },
+            {
+              name: '设备数量',
+              value: deviceCount,
+              children: '',
+            },
+          ]}
+          title="设备统计"
+          extra={
+            <div style={{ fontSize: 14, fontWeight: 400 }}>
+              <a
+                onClick={() => {
+                  const url = getMenuPathByCode(MENUS_CODE['device/DashBoard']);
+                  if (!!url) {
+                    history.push(`${url}`);
+                  } else {
+                    message.warning('暂无权限,请联系管理员');
+                  }
+                }}
+              >
+                详情
+              </a>
+            </div>
+          }
+        />
+      </Col>
+      {/* <Col span={24}>
+        <Body title={'平台架构图'} english={'PLATFORM ARCHITECTURE DIAGRAM'} />
+      </Col> */}
+
       <ProductChoose
         visible={productVisible}
         close={() => {

+ 78 - 72
src/pages/home/ops/index.tsx

@@ -1,5 +1,5 @@
 import { Col, message, Row, Tooltip } from 'antd';
-import Guide from '../components/Guide';
+// import Guide from '../components/Guide';
 import Statistics from '../components/Statistics';
 import Pie from '@/pages/home/components/Pie';
 import { getMenuPathByCode, MENUS_CODE } from '@/utils/menu';
@@ -15,9 +15,9 @@ const Ops = () => {
   const [subscribeTopic] = useSendWebsocketMessage();
   const history = useHistory();
 
-  const accessPermission = getMenuPathByCode(MENUS_CODE['link/AccessConfig']);
-  const logPermission = getMenuPathByCode(MENUS_CODE['Log']);
-  const linkPermission = getMenuPathByCode(MENUS_CODE['link/DashBoard']);
+  // const accessPermission = getMenuPathByCode(MENUS_CODE['link/AccessConfig']);
+  // const logPermission = getMenuPathByCode(MENUS_CODE['Log']);
+  // const linkPermission = getMenuPathByCode(MENUS_CODE['link/DashBoard']);
 
   const [cpuValue, setCpuValue] = useState<number>(0);
   const [jvmValue, setJvmValue] = useState<number>(0);
@@ -57,76 +57,37 @@ const Ops = () => {
     };
   }, []);
 
-  const guideOpsList = [
-    {
-      key: 'access',
-      name: '设备接入配置',
-      english: 'DEVICE ACCESS CONFIGURATION',
-      auth: !!accessPermission,
-      url: accessPermission,
-    },
-    {
-      key: 'logger',
-      name: '日志排查',
-      english: 'LOG SCREEN',
-      auth: !!logPermission,
-      url: logPermission,
-      param: {
-        key: 'system',
-      },
-    },
-    {
-      key: 'realtime',
-      name: '实时监控',
-      english: 'REAL-TIME MONITORING',
-      auth: !!linkPermission,
-      url: linkPermission,
-      param: {
-        save: true,
-      },
-    },
-  ];
+  // const guideOpsList = [
+  //   {
+  //     key: 'access',
+  //     name: '设备接入配置',
+  //     english: 'DEVICE ACCESS CONFIGURATION',
+  //     auth: !!accessPermission,
+  //     url: accessPermission,
+  //   },
+  //   {
+  //     key: 'logger',
+  //     name: '日志排查',
+  //     english: 'LOG SCREEN',
+  //     auth: !!logPermission,
+  //     url: logPermission,
+  //     param: {
+  //       key: 'system',
+  //     },
+  //   },
+  //   {
+  //     key: 'realtime',
+  //     name: '实时监控',
+  //     english: 'REAL-TIME MONITORING',
+  //     auth: !!linkPermission,
+  //     url: linkPermission,
+  //     param: {
+  //       save: true,
+  //     },
+  //   },
+  // ];
   return (
     <Row gutter={24}>
-      <Col span={14}>
-        <Guide title="运维引导" data={guideOpsList} />
-      </Col>
-      <Col span={10}>
-        <Statistics
-          data={[
-            {
-              name: 'CPU使用率',
-              value: String(cpuValue) + '%',
-              children: <Pie value={cpuValue} />,
-            },
-            {
-              name: 'JVM内存',
-              value: String(jvmValue) + '%',
-              children: <Pie value={jvmValue} />,
-            },
-          ]}
-          title="基础统计"
-          extra={
-            <div style={{ fontSize: 14, fontWeight: 400 }}>
-              <a
-                onClick={() => {
-                  const url = getMenuPathByCode(MENUS_CODE['device/DashBoard']);
-                  if (!!url) {
-                    history.push(`${url}`);
-                  } else {
-                    message.warning('暂无权限,请联系管理员');
-                  }
-                }}
-              >
-                详情
-              </a>
-            </div>
-          }
-        />
-      </Col>
-      <Col span={24}>
-        <Body title={'平台架构图'} english={'PLATFORM ARCHITECTURE DIAGRAM'} />
-      </Col>
       <Col span={24}>
         <Steps
           title={
@@ -208,6 +169,51 @@ const Ops = () => {
           ]}
         />
       </Col>
+      <Col span={18} style={{ marginTop: 24 }}>
+        <Body
+          title={'平台架构图'}
+          english={'PLATFORM ARCHITECTURE DIAGRAM'}
+          url={require('/public/images/home/content1.png')}
+        />
+      </Col>
+      <Col span={6} style={{ marginTop: 24 }}>
+        <Statistics
+          style={{ gridTemplateColumns: 'repeat(1, 1fr)' }}
+          height={448}
+          data={[
+            {
+              name: 'CPU使用率',
+              value: String(cpuValue) + '%',
+              children: <Pie value={cpuValue} />,
+            },
+            {
+              name: 'JVM内存',
+              value: String(jvmValue) + '%',
+              children: <Pie value={jvmValue} />,
+            },
+          ]}
+          title="基础统计"
+          extra={
+            <div style={{ fontSize: 14, fontWeight: 400 }}>
+              <a
+                onClick={() => {
+                  const url = getMenuPathByCode(MENUS_CODE['device/DashBoard']);
+                  if (!!url) {
+                    history.push(`${url}`);
+                  } else {
+                    message.warning('暂无权限,请联系管理员');
+                  }
+                }}
+              >
+                详情
+              </a>
+            </div>
+          }
+        />
+      </Col>
+      {/* <Col span={24}>
+        <Body title={'平台架构图'} english={'PLATFORM ARCHITECTURE DIAGRAM'} />
+      </Col> */}
     </Row>
   );
 };

+ 3 - 3
src/pages/media/Home/index.tsx

@@ -68,7 +68,7 @@ export default () => {
     {
       key: 'EQUIPMENT',
       name: '添加视频设备',
-      english: 'STP 1',
+      english: 'STEP1',
       auth: !!devicePermission.add,
       url: deviceUrl,
       param: { save: true },
@@ -76,14 +76,14 @@ export default () => {
     {
       key: 'SCREEN',
       name: '分屏展示',
-      english: 'STP 2',
+      english: 'STEP2',
       auth: !!splitScreenUrl,
       url: splitScreenUrl,
     },
     {
       key: 'CASCADE',
       name: '国标级联',
-      english: 'STP 3',
+      english: 'STEP3',
       auth: !!cascadeUrl,
       url: cascadeUrl,
     },

+ 1 - 1
src/pages/notice/Template/Detail/index.tsx

@@ -124,7 +124,7 @@ const Detail = observer(() => {
               field.setComponent(FBraftEditor, {
                 placeholder:
                   '变量格式:${name};\n 示例:尊敬的${name},${time}有设备触发告警,请注意处理',
-                height: '100px',
+                // height: '100px',
               });
             }
             const _provider = field.query('provider').value();

+ 18 - 13
src/pages/user/Login/index.tsx

@@ -44,14 +44,14 @@ const Login: React.FC = () => {
   const [loading, setLoading] = useState<boolean>(false);
 
   /** 此方法会跳转到 redirect 参数所在的位置 */
-  const goto = () => {
-    setTimeout(() => {
-      // history.push(redirect || '/');
-      // 用于触发app中的render,生成路由
-      window.location.href = '/';
-      setLoading(false);
-    }, 10);
-  };
+  // const goto = () => {
+  //   setTimeout(() => {
+  //     // history.push(redirect || '/');
+  //     // 用于触发app中的render,生成路由
+  //     window.location.href = '/';
+  //     setLoading(false);
+  //   }, 10);
+  // };
 
   const getCode = () => {
     delete loginForm.values?.verifyCode;
@@ -62,7 +62,10 @@ const Login: React.FC = () => {
         mergeMap(Service.getCaptcha),
         catchError(() => message.error('系统开小差,请稍后重试')),
       )
-      .subscribe(setCaptcha);
+      .subscribe((res) => {
+        setCaptcha(res);
+        setLoading(false);
+      });
   };
 
   useEffect(getCode, []);
@@ -141,7 +144,9 @@ const Login: React.FC = () => {
         next: async (userInfo) => {
           Token.set(userInfo.token);
           await fetchUserInfo();
-          goto();
+          // goto();
+          window.location.href = '/';
+          setLoading(false);
         },
         error: () => {
           message.error(
@@ -151,17 +156,17 @@ const Login: React.FC = () => {
             }),
           );
           getCode();
-          setLoading(false);
+          // setLoading(false);
         },
         complete: () => {
           getCode();
-          setLoading(false);
+          // setLoading(false);
         },
       },
     );
   };
   return (
-    <Spin spinning={loading}>
+    <Spin spinning={loading} delay={500}>
       <div className={styles.container}>
         <div className={styles.left}>
           <div className={styles.lang} data-lang="">