100011797 před 3 roky
rodič
revize
d3d142ebf6

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 57
public/icons/iconfont.js


+ 3 - 2
src/components/FMonacoEditor/index.tsx

@@ -1,9 +1,10 @@
 import MonacoEditor from 'react-monaco-editor';
 import MonacoEditor from 'react-monaco-editor';
 import { connect, mapProps } from '@formily/react';
 import { connect, mapProps } from '@formily/react';
-import { useState } from 'react';
+import { useRef, useState } from 'react';
 
 
 export const JMonacoEditor = (props: any) => {
 export const JMonacoEditor = (props: any) => {
   const [loading, setLoading] = useState(false);
   const [loading, setLoading] = useState(false);
+  const monacoRef = useRef<any>();
 
 
   return (
   return (
     <div
     <div
@@ -14,7 +15,7 @@ export const JMonacoEditor = (props: any) => {
       }}
       }}
       style={{ height: '100%', width: '100%' }}
       style={{ height: '100%', width: '100%' }}
     >
     >
-      {loading && <MonacoEditor {...props} />}
+      {loading && <MonacoEditor ref={monacoRef} {...props} />}
     </div>
     </div>
   );
   );
 };
 };

+ 5 - 4
src/pages/Northbound/DuerOS/Detail/index.tsx

@@ -15,7 +15,7 @@ import {
   PreviewText,
   PreviewText,
   Select,
   Select,
 } from '@formily/antd';
 } from '@formily/antd';
-import { PermissionButton } from '@/components';
+import { PermissionButton, TitleComponent } from '@/components';
 import { useEffect, useMemo, useState } from 'react';
 import { useEffect, useMemo, useState } from 'react';
 import {
 import {
   createForm,
   createForm,
@@ -693,8 +693,9 @@ const Save = () => {
   return (
   return (
     <PageContainer>
     <PageContainer>
       <Card>
       <Card>
-        <Row>
-          <Col span={12}>
+        <Row gutter={24}>
+          <Col span={14}>
+            <TitleComponent data={'基本信息'} />
             <Form layout="vertical" form={form}>
             <Form layout="vertical" form={form}>
               <SchemaField
               <SchemaField
                 schema={schema}
                 schema={schema}
@@ -717,7 +718,7 @@ const Save = () => {
               </FormButtonGroup.Sticky>
               </FormButtonGroup.Sticky>
             </Form>
             </Form>
           </Col>
           </Col>
-          <Col span={10} push={2}>
+          <Col span={10}>
             <Doc />
             <Doc />
           </Col>
           </Col>
         </Row>
         </Row>

+ 2 - 2
src/pages/link/DashBoard/index.tsx

@@ -237,9 +237,9 @@ export default () => {
 
 
   const networkValueRender = (value: number) => {
   const networkValueRender = (value: number) => {
     if (value >= 1024 && value < 1024 * 1024) {
     if (value >= 1024 && value < 1024 * 1024) {
-      return `${Number((value / 1024).toFixed(2))}M`;
+      return `${Number((value / 1024).toFixed(2))}KB`;
     } else if (value >= 1024 * 1024) {
     } else if (value >= 1024 * 1024) {
-      return `${Number((value / 1024 / 1024).toFixed(2))}KB`;
+      return `${Number((value / 1024 / 1024).toFixed(2))}M`;
     } else {
     } else {
       return `${value}B`;
       return `${value}B`;
     }
     }

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

@@ -310,7 +310,7 @@ const Config = () => {
   const level = (
   const level = (
     <Row>
     <Row>
       <Col span={14}>
       <Col span={14}>
-        <Card>
+        <Card style={{ height: 650 }}>
           <TitleComponent data={'告警级别配置'} />
           <TitleComponent data={'告警级别配置'} />
           <Form form={levelForm}>
           <Form form={levelForm}>
             <SchemaField schema={levelSchema} />
             <SchemaField schema={levelSchema} />
@@ -327,7 +327,7 @@ const Config = () => {
         </Card>
         </Card>
       </Col>
       </Col>
       <Col span={10}>
       <Col span={10}>
-        <div style={{ marginLeft: 20 }} className={styles.doc}>
+        <div style={{ marginLeft: 20, height: 650 }} className={styles.doc}>
           <h1>功能说明</h1>
           <h1>功能说明</h1>
           <div>1、告警级别用于描述告警的严重程度,请根据业务管理方式进行自定义。</div>
           <div>1、告警级别用于描述告警的严重程度,请根据业务管理方式进行自定义。</div>
           <div>2、告警级别将会在告警配置中被引用。</div>
           <div>2、告警级别将会在告警配置中被引用。</div>
@@ -340,7 +340,7 @@ const Config = () => {
     <Row>
     <Row>
       <Col span={14}>
       <Col span={14}>
         <div>
         <div>
-          <Card>
+          <Card style={{ height: 650 }}>
             <TitleComponent
             <TitleComponent
               data={
               data={
                 <span>
                 <span>
@@ -370,7 +370,13 @@ const Config = () => {
                 </span>
                 </span>
               }
               }
             />
             />
-            <Descriptions key={'output'} bordered column={2} labelStyle={{ width: 112 }}>
+            <Descriptions
+              key={'output'}
+              bordered
+              column={2}
+              labelStyle={{ width: 112 }}
+              contentStyle={{ minWidth: 100 }}
+            >
               <Descriptions.Item label="kafka地址" contentStyle={{ minWidth: 200 }}>
               <Descriptions.Item label="kafka地址" contentStyle={{ minWidth: 200 }}>
                 {output?.data?.config?.config?.address && (
                 {output?.data?.config?.config?.address && (
                   <Badge
                   <Badge
@@ -421,7 +427,13 @@ const Config = () => {
                 </span>
                 </span>
               }
               }
             />
             />
-            <Descriptions key={'input'} bordered column={2} labelStyle={{ width: 112 }}>
+            <Descriptions
+              key={'input'}
+              bordered
+              column={2}
+              labelStyle={{ width: 112 }}
+              contentStyle={{ minWidth: 150 }}
+            >
               <Descriptions.Item label="kafka地址">
               <Descriptions.Item label="kafka地址">
                 {input?.data?.config?.config?.address && (
                 {input?.data?.config?.config?.address && (
                   <Badge
                   <Badge
@@ -446,7 +458,7 @@ const Config = () => {
         </div>
         </div>
       </Col>
       </Col>
       <Col span={10}>
       <Col span={10}>
-        <div style={{ height: 650, marginLeft: 20, paddingBottom: 24 }}>
+        <div style={{ height: 650, marginLeft: 20, paddingBottom: 24, backgroundColor: '#fff' }}>
           <div className={styles.doc}>
           <div className={styles.doc}>
             <h1>功能图示</h1>
             <h1>功能图示</h1>
             <div className={styles.image}>
             <div className={styles.image}>

+ 7 - 0
src/pages/rule-engine/Alarm/Configuration/Save/Log/index.less

@@ -0,0 +1,7 @@
+.alarm-configuration-log-box {
+  :global {
+    .ant-card-body {
+      padding-top: 10px;
+    }
+  }
+}

+ 6 - 1
src/pages/rule-engine/Alarm/Configuration/Save/Log/index.tsx

@@ -1,10 +1,15 @@
 import TabComponent from '@/pages/rule-engine/Alarm/Log/TabComponent';
 import TabComponent from '@/pages/rule-engine/Alarm/Log/TabComponent';
 import useLocation from '@/hooks/route/useLocation';
 import useLocation from '@/hooks/route/useLocation';
 import { Empty } from '@/components';
 import { Empty } from '@/components';
+import styles from './index.less';
 
 
 export default () => {
 export default () => {
   const location = useLocation();
   const location = useLocation();
   const id = location?.query?.id || '';
   const id = location?.query?.id || '';
 
 
-  return <div>{id ? <TabComponent type={'detail'} id={id} /> : <Empty />}</div>;
+  return (
+    <div className={styles['alarm-configuration-log-box']}>
+      {id ? <TabComponent type={'detail'} id={id} /> : <Empty />}
+    </div>
+  );
 };
 };

+ 6 - 1
src/pages/rule-engine/Alarm/Log/TabComponent/index.tsx

@@ -334,7 +334,12 @@ const TabComponent = observer((props: Props) => {
         />
         />
       )}
       )}
 
 
-      <Card bordered={false} style={{ minHeight, position: 'relative' }} className={'alarmLog'}>
+      <Card
+        bordered={false}
+        bodyStyle={{ paddingTop: props.type === 'detail' ? 0 : 24 }}
+        style={{ minHeight, position: 'relative' }}
+        className={'alarmLog'}
+      >
         <div className="alarm-log-card">
         <div className="alarm-log-card">
           <div style={{ height: '100%', paddingBottom: 48 }}>
           <div style={{ height: '100%', paddingBottom: 48 }}>
             {dataSource?.data.length ? (
             {dataSource?.data.length ? (

+ 24 - 24
src/pages/system/Menu/Setting/baseMenu.ts

@@ -17,7 +17,7 @@ export default [
         //parentId: '1',
         //parentId: '1',
         //id: '1-1',
         //id: '1-1',
         url: '/iot/home',
         url: '/iot/home',
-        icon: 'icon-keshihua',
+        icon: 'icon-zhihuishequ',
         sortIndex: 1,
         sortIndex: 1,
         showPage: ['dashboard', 'device-instance', 'device-product'],
         showPage: ['dashboard', 'device-instance', 'device-product'],
         permissions: [
         permissions: [
@@ -50,7 +50,7 @@ export default [
         //parentId: '1',
         //parentId: '1',
         //id: '1-2',
         //id: '1-2',
         url: '/iot/notice/Type',
         url: '/iot/notice/Type',
-        icon: 'icon-shebei',
+        icon: 'icon-tongzhiguanli',
         sortIndex: 2,
         sortIndex: 2,
         showPage: ['template', 'notifier'],
         showPage: ['template', 'notifier'],
         permissions: [],
         permissions: [],
@@ -630,7 +630,7 @@ export default [
             //id: '1-3-4',
             //id: '1-3-4',
             sortIndex: 4,
             sortIndex: 4,
             url: '/iot/device/Category',
             url: '/iot/device/Category',
-            icon: 'icon-chanpinfenlei1',
+            icon: 'icon-chanpinfenlei',
             accessSupport: 'support',
             accessSupport: 'support',
             assetType: 'deviceCategory',
             assetType: 'deviceCategory',
             showPage: ['device-category'],
             showPage: ['device-category'],
@@ -1022,7 +1022,7 @@ export default [
             //id: '1-4-6',
             //id: '1-4-6',
             sortIndex: 6,
             sortIndex: 6,
             url: '/iot/link/Certificate',
             url: '/iot/link/Certificate',
-            icon: 'icon-rizhifuwu',
+            icon: 'icon-zhengshuguanli',
             showPage: ['certificate'],
             showPage: ['certificate'],
             permissions: [],
             permissions: [],
             buttons: [
             buttons: [
@@ -1258,7 +1258,7 @@ export default [
             //id: '1-4-9',
             //id: '1-4-9',
             sortIndex: 9,
             sortIndex: 9,
             url: '/iot/link/firmware',
             url: '/iot/link/firmware',
-            icon: 'icon-wangluozujian',
+            icon: 'icon-yuanchengshengji',
             showPage: ['firmware-manager'],
             showPage: ['firmware-manager'],
             permissions: [],
             permissions: [],
             buttons: [
             buttons: [
@@ -1370,7 +1370,7 @@ export default [
         owner: 'iot',
         owner: 'iot',
         sortIndex: 10,
         sortIndex: 10,
         url: '/iot/link/DataCollect',
         url: '/iot/link/DataCollect',
-        icon: 'icon-shuxingpeizhi',
+        icon: 'icon-analytics',
         showPage: [],
         showPage: [],
         permissions: [],
         permissions: [],
         children: [
         children: [
@@ -1380,7 +1380,7 @@ export default [
             owner: 'iot',
             owner: 'iot',
             sortIndex: 1,
             sortIndex: 1,
             url: '/iot/DataCollect/Dashboard',
             url: '/iot/DataCollect/Dashboard',
-            icon: 'icon-shujumoni',
+            icon: 'icon-keshihua',
             showPage: [
             showPage: [
               'dashboard',
               'dashboard',
               'data-collect-channel',
               'data-collect-channel',
@@ -1534,7 +1534,7 @@ export default [
             owner: 'iot',
             owner: 'iot',
             sortIndex: 3,
             sortIndex: 3,
             url: '/iot/DataCollect/IntegratedQuery',
             url: '/iot/DataCollect/IntegratedQuery',
-            icon: 'icon-zhilianshebei',
+            icon: 'icon-yingyongguanli',
             showPage: [
             showPage: [
               'data-collect-channel',
               'data-collect-channel',
               'data-collect-opc',
               'data-collect-opc',
@@ -1669,7 +1669,7 @@ export default [
         //id: '1-5',
         //id: '1-5',
         sortIndex: 5,
         sortIndex: 5,
         url: '/iot/Alarm',
         url: '/iot/Alarm',
-        icon: 'icon-zidingyiguize',
+        icon: 'icon-shebeigaojing',
         permissions: [],
         permissions: [],
         buttons: [],
         buttons: [],
         showPage: [],
         showPage: [],
@@ -1682,7 +1682,7 @@ export default [
             //id: '1-5-1',
             //id: '1-5-1',
             sortIndex: 1,
             sortIndex: 1,
             url: '/iot/Alarm/dashboard',
             url: '/iot/Alarm/dashboard',
-            icon: 'icon-shujumoni',
+            icon: 'icon-keshihua',
             showPage: ['dashboard', 'alarm-record', 'alarm-config'],
             showPage: ['dashboard', 'alarm-record', 'alarm-config'],
             permissions: [
             permissions: [
               { permission: 'dashboard', actions: ['query'] },
               { permission: 'dashboard', actions: ['query'] },
@@ -1721,7 +1721,7 @@ export default [
             //id: '1-5-2',
             //id: '1-5-2',
             sortIndex: 3,
             sortIndex: 3,
             url: '/iot/Alarm/Configuration',
             url: '/iot/Alarm/Configuration',
-            icon: 'icon-chajianguanli',
+            icon: 'icon-warning_amber',
             showPage: ['alarm-config'],
             showPage: ['alarm-config'],
             permissions: [],
             permissions: [],
             buttons: [
             buttons: [
@@ -1888,7 +1888,7 @@ export default [
             //id: '1-6-1',
             //id: '1-6-1',
             sortIndex: 1,
             sortIndex: 1,
             url: '/iot/northbound/DuerOS',
             url: '/iot/northbound/DuerOS',
-            icon: 'icon-yunyunjieru',
+            icon: 'icon-zhineng',
             permissions: [],
             permissions: [],
             showPage: ['dueros-product'],
             showPage: ['dueros-product'],
             buttons: [
             buttons: [
@@ -1964,7 +1964,7 @@ export default [
             //id: '1-6-2',
             //id: '1-6-2',
             sortIndex: 2,
             sortIndex: 2,
             url: '/iot/northbound/AliCloud',
             url: '/iot/northbound/AliCloud',
-            icon: 'icon-yunyunjieru',
+            icon: 'icon-aliyun',
             permissions: [],
             permissions: [],
             showPage: ['aliyun-bridge'],
             showPage: ['aliyun-bridge'],
             buttons: [
             buttons: [
@@ -2324,7 +2324,7 @@ export default [
         owner: 'iot',
         owner: 'iot',
         sortIndex: 8,
         sortIndex: 8,
         url: '/iot/edge',
         url: '/iot/edge',
-        icon: 'icon-zidingyiguize',
+        icon: 'icon-bianyuanwangguan',
         permissions: [],
         permissions: [],
         buttons: [],
         buttons: [],
         children: [
         children: [
@@ -2525,7 +2525,7 @@ export default [
         //id: '2-3',
         //id: '2-3',
         sortIndex: 3,
         sortIndex: 3,
         url: '/media/device',
         url: '/media/device',
-        icon: 'icon-keshihua',
+        icon: 'icon-shipinwangguan',
         showPage: ['media-device'],
         showPage: ['media-device'],
         permissions: [
         permissions: [
           { permission: 'file', actions: ['upload-static'] },
           { permission: 'file', actions: ['upload-static'] },
@@ -3322,7 +3322,7 @@ export default [
         //id: '3-8',
         //id: '3-8',
         sortIndex: 8,
         sortIndex: 8,
         url: '/system/Relationship',
         url: '/system/Relationship',
-        icon: 'icon-renyuan',
+        icon: 'icon-shuxingpeizhi',
         showPage: ['relation'],
         showPage: ['relation'],
         permissions: [],
         permissions: [],
         buttons: [
         buttons: [
@@ -3458,7 +3458,7 @@ export default [
         //id: '3-10',
         //id: '3-10',
         sortIndex: 10,
         sortIndex: 10,
         url: '/system/Api',
         url: '/system/Api',
-        icon: 'icon-rizhifuwu',
+        icon: 'icon-chakanAPI',
         showPage: ['open-api'],
         showPage: ['open-api'],
         permissions: [{ permission: 'open-api', actions: ['query', 'save'] }],
         permissions: [{ permission: 'open-api', actions: ['query', 'save'] }],
         buttons: [],
         buttons: [],
@@ -3471,7 +3471,7 @@ export default [
         //id: '3-11',
         //id: '3-11',
         sortIndex: 11,
         sortIndex: 11,
         url: '/system/Apply',
         url: '/system/Apply',
-        icon: 'icon-wangguanzishebei',
+        icon: 'icon-yingyongguanli',
         showPage: ['application'],
         showPage: ['application'],
         permissions: [],
         permissions: [],
         buttons: [
         buttons: [
@@ -3622,7 +3622,7 @@ export default [
     name: '物联卡',
     name: '物联卡',
     code: 'iot-card',
     code: 'iot-card',
     url: '/iot-card',
     url: '/iot-card',
-    icon: 'icon-yunyunjieru',
+    icon: 'icon-wulianka',
     permissions: [],
     permissions: [],
     children: [
     children: [
       {
       {
@@ -3633,7 +3633,7 @@ export default [
         name: '首页',
         name: '首页',
         code: 'iot-card/Home',
         code: 'iot-card/Home',
         url: '/iot-card/Home',
         url: '/iot-card/Home',
-        icon: 'icon-shujumoni',
+        icon: 'icon-zhihuishequ',
         status: 1,
         status: 1,
         showPage: ['network-flow'],
         showPage: ['network-flow'],
         permissions: [{ permission: 'network-flow', actions: ['query'] }],
         permissions: [{ permission: 'network-flow', actions: ['query'] }],
@@ -3662,7 +3662,7 @@ export default [
         name: '物联卡管理',
         name: '物联卡管理',
         code: 'iot-card/CardManagement',
         code: 'iot-card/CardManagement',
         url: '/iot-card/CardManagement',
         url: '/iot-card/CardManagement',
-        icon: 'icon-chanpinfenlei',
+        icon: 'icon-wuliankaguanli',
         status: 1,
         status: 1,
         showPage: ['network-card'],
         showPage: ['network-card'],
         permissions: [
         permissions: [
@@ -3783,7 +3783,7 @@ export default [
         showPage: ['network-card'],
         showPage: ['network-card'],
         code: 'iot-card/Recharge',
         code: 'iot-card/Recharge',
         url: '/iot-card/Recharge',
         url: '/iot-card/Recharge',
-        icon: 'icon-caidanguanli',
+        icon: 'icon-chongzhiguanli',
         status: 1,
         status: 1,
         permissions: [
         permissions: [
           {
           {
@@ -3812,7 +3812,7 @@ export default [
         name: '平台接入',
         name: '平台接入',
         code: 'iot-card/Platform',
         code: 'iot-card/Platform',
         url: '/iot-card/Platform',
         url: '/iot-card/Platform',
-        icon: 'icon-wangguanzishebei',
+        icon: 'icon-pingtaiduijie',
         status: 1,
         status: 1,
         showPage: ['platform'],
         showPage: ['platform'],
         permissions: [
         permissions: [
@@ -3882,7 +3882,7 @@ export default [
         name: '操作记录',
         name: '操作记录',
         code: 'iot-card/Record',
         code: 'iot-card/Record',
         url: '/iot-card/Record',
         url: '/iot-card/Record',
-        icon: 'icon-rizhifuwu',
+        icon: 'icon-tongzhijilu',
         status: 1,
         status: 1,
         showPage: ['network-card'],
         showPage: ['network-card'],
         permissions: [
         permissions: [

+ 27 - 3
src/pages/system/Permission/Save/index.tsx

@@ -76,18 +76,42 @@ const Save = (props: Props) => {
         'x-component-props': {
         'x-component-props': {
           placeholder: '请输入标识(ID)',
           placeholder: '请输入标识(ID)',
         },
         },
+        'x-disabled': model === 'edit',
         name: 'id',
         name: 'id',
         'x-decorator-props': {
         'x-decorator-props': {
           tooltip: <div>标识ID需与代码中的标识ID一致</div>,
           tooltip: <div>标识ID需与代码中的标识ID一致</div>,
         },
         },
         'x-validator': [
         'x-validator': [
           {
           {
+            required: true,
+            message: '请输入标识(ID)',
+          },
+          {
             max: 64,
             max: 64,
             message: '最多可输入64个字符',
             message: '最多可输入64个字符',
           },
           },
           {
           {
-            required: true,
-            message: '请输入标识(ID)',
+            triggerType: 'onBlur',
+            validator: (value: string) => {
+              return new Promise((resolve) => {
+                if (!value) resolve('');
+                service
+                  .validateField({ id: value })
+                  .then((resp) => {
+                    if (resp.status === 200) {
+                      if (resp.result.passed) {
+                        resolve('');
+                      } else {
+                        resolve(model === 'edit' ? '' : resp.result.reason);
+                      }
+                    }
+                    resolve('');
+                  })
+                  .catch(() => {
+                    return '验证失败!';
+                  });
+              });
+            },
           },
           },
         ],
         ],
       },
       },
@@ -253,7 +277,7 @@ const Save = (props: Props) => {
   };
   };
 
 
   const save = async () => {
   const save = async () => {
-    const value = await form.submit<UserItem>();
+    const value = await form.submit<PermissionItem>();
     let response = undefined;
     let response = undefined;
     if (props.model === 'add') {
     if (props.model === 'add') {
       response = await service.save(value);
       response = await service.save(value);

+ 6 - 0
src/pages/system/Permission/service.ts

@@ -32,6 +32,12 @@ class Service extends BaseService<PermissionItem> {
         }),
         }),
       ),
       ),
     ).pipe(map((item) => item));
     ).pipe(map((item) => item));
+
+  public validateField = (data: any) =>
+    request(`/${SystemConst.API_BASE}/permission/id/_validate`, {
+      method: 'GET',
+      params: data,
+    });
 }
 }
 
 
 export default Service;
 export default Service;