Quellcode durchsuchen

fix: 合并代码

jackhoo_98 vor 3 Jahren
Ursprung
Commit
f6ef70f560

Datei-Diff unterdrückt, da er zu groß ist
+ 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`;
     }
     }

+ 1 - 1
src/pages/media/Device/Save/index.tsx

@@ -152,7 +152,7 @@ const Save = () => {
                           console.log(key);
                           console.log(key);
                           setAccessType(key);
                           setAccessType(key);
                           queryProduct(key);
                           queryProduct(key);
-                          form.resetFields(['id']);
+                          form.resetFields(['id', 'productId']);
                         }}
                         }}
                         disabled={id}
                         disabled={id}
                         options={[
                         options={[

+ 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 ? (

+ 2 - 2
src/pages/rule-engine/Scene/Save/action/DeviceOutput/actions/TypeModel.tsx

@@ -204,10 +204,10 @@ export default observer((props: Props) => {
       case 'date':
       case 'date':
         return (
         return (
           <MTimePicker
           <MTimePicker
-            type={props.format}
+            type={props.format === 'yyyy-MM-dd' ? 'time' : 'date'}
             value={moment(
             value={moment(
               value ? value : new Date(),
               value ? value : new Date(),
-              props.format === 'HH:mm:ss' ? 'HH:mm:ss' : 'yyyy-MM-dd HH:mm:ss',
+              props.format === 'yyyy-MM-dd' ? 'HH:mm:ss' : 'yyyy-MM-dd HH:mm:ss',
             )}
             )}
             onOpen={() => {
             onOpen={() => {
               setOpen(false);
               setOpen(false);

+ 4 - 0
src/pages/rule-engine/Scene/Save/action/DeviceOutput/actions/functionCall.tsx

@@ -16,6 +16,8 @@ interface FunctionCallProps {
   value?: any;
   value?: any;
   onChange?: (data: any) => void;
   onChange?: (data: any) => void;
   name?: any;
   name?: any;
+  thenName: number;
+  branchGroup?: number;
 }
 }
 
 
 export default (props: FunctionCallProps) => {
 export default (props: FunctionCallProps) => {
@@ -60,6 +62,8 @@ export default (props: FunctionCallProps) => {
         type={type}
         type={type}
         record={record}
         record={record}
         name={props.name}
         name={props.name}
+        branchGroup={props.branchGroup}
+        thenName={props.thenName}
         format={record?.format}
         format={record?.format}
       />
       />
     );
     );

+ 6 - 1
src/pages/rule-engine/Scene/Save/action/DeviceOutput/actions/index.tsx

@@ -145,7 +145,12 @@ export default observer((props: Props) => {
                 name={['message', 'inputs']}
                 name={['message', 'inputs']}
                 rules={[{ required: true, message: '请输入功能值' }]}
                 rules={[{ required: true, message: '请输入功能值' }]}
               >
               >
-                <FunctionCall functionData={functionList} name={props.name} />
+                <FunctionCall
+                  functionData={functionList}
+                  name={props.name}
+                  branchGroup={props.branchGroup}
+                  thenName={props.thenName}
+                />
               </Form.Item>
               </Form.Item>
             )}
             )}
           </>
           </>

+ 12 - 49
src/pages/rule-engine/Scene/Save/action/DeviceOutput/device/index.tsx

@@ -8,7 +8,7 @@ import { SceneDeviceCard } from '@/components/ProTableCard/CardItems/device';
 import { isNoCommunity } from '@/utils/util';
 import { isNoCommunity } from '@/utils/util';
 import { useIntl } from 'umi';
 import { useIntl } from 'umi';
 import { service as categoryService } from '@/pages/device/Category';
 import { service as categoryService } from '@/pages/device/Category';
-import { service as deptService } from '@/pages/system/Department';
+// import { service as deptService } from '@/pages/system/Department';
 import DeviceModel from '../model';
 import DeviceModel from '../model';
 import { observer } from '@formily/reactive-react';
 import { observer } from '@formily/reactive-react';
 import { Form, TreeSelect } from 'antd';
 import { Form, TreeSelect } from 'antd';
@@ -93,6 +93,7 @@ export default observer((props: Props) => {
       dataIndex: 'productId',
       dataIndex: 'productId',
       width: 200,
       width: 200,
       ellipsis: true,
       ellipsis: true,
+      hideInSearch: true,
       valueType: 'select',
       valueType: 'select',
       request: async () => {
       request: async () => {
         const res = await service.getProductList();
         const res = await service.getProductList();
@@ -105,11 +106,10 @@ export default observer((props: Props) => {
       filterMultiple: true,
       filterMultiple: true,
     },
     },
     {
     {
-      title: intl.formatMessage({
-        id: 'pages.device.instance.registrationTime',
-        defaultMessage: '注册时间',
-      }),
-      dataIndex: 'registryTime',
+      title: '创建时间',
+      dataIndex: 'createTime',
+      width: '200px',
+      valueType: 'dateTime',
     },
     },
     {
     {
       title: intl.formatMessage({
       title: intl.formatMessage({
@@ -149,6 +149,7 @@ export default observer((props: Props) => {
       title: '产品分类',
       title: '产品分类',
       valueType: 'treeSelect',
       valueType: 'treeSelect',
       hideInTable: true,
       hideInTable: true,
+      hideInSearch: true,
       fieldProps: {
       fieldProps: {
         fieldNames: {
         fieldNames: {
           label: 'name',
           label: 'name',
@@ -165,6 +166,7 @@ export default observer((props: Props) => {
     {
     {
       title: '网关类型',
       title: '网关类型',
       dataIndex: 'accessProvider',
       dataIndex: 'accessProvider',
+      hideInSearch: true,
       width: 150,
       width: 150,
       ellipsis: true,
       ellipsis: true,
       valueType: 'select',
       valueType: 'select',
@@ -192,6 +194,7 @@ export default observer((props: Props) => {
       dataIndex: 'productId$product-info',
       dataIndex: 'productId$product-info',
       title: '接入方式',
       title: '接入方式',
       valueType: 'select',
       valueType: 'select',
+      hideInSearch: true,
       hideInTable: true,
       hideInTable: true,
       request: () =>
       request: () =>
         service.queryGatewayList().then((resp: any) =>
         service.queryGatewayList().then((resp: any) =>
@@ -206,6 +209,7 @@ export default observer((props: Props) => {
       title: '设备类型',
       title: '设备类型',
       valueType: 'select',
       valueType: 'select',
       hideInTable: true,
       hideInTable: true,
+      hideInSearch: true,
       valueEnum: {
       valueEnum: {
         device: {
         device: {
           text: '直连设备',
           text: '直连设备',
@@ -221,47 +225,6 @@ export default observer((props: Props) => {
         },
         },
       },
       },
     },
     },
-    {
-      dataIndex: 'id$dim-assets',
-      title: '所属组织',
-      valueType: 'treeSelect',
-      hideInTable: true,
-      fieldProps: {
-        fieldNames: {
-          label: 'name',
-          value: 'value',
-        },
-      },
-      request: () =>
-        deptService
-          .queryOrgThree({
-            paging: false,
-          })
-          .then((resp) => {
-            const formatValue = (lists: any[]) => {
-              const _list: any[] = [];
-              lists.forEach((item) => {
-                if (item.children) {
-                  item.children = formatValue(item.children);
-                }
-                _list.push({
-                  ...item,
-                  value: JSON.stringify({
-                    assetType: 'device',
-                    targets: [
-                      {
-                        type: 'org',
-                        id: item.id,
-                      },
-                    ],
-                  }),
-                });
-              });
-              return _list;
-            };
-            return formatValue(resp.result);
-          }),
-    },
   ];
   ];
 
 
   const filterTree = (nodes: any[]) => {
   const filterTree = (nodes: any[]) => {
@@ -389,7 +352,7 @@ export default observer((props: Props) => {
                   },
                   },
                 }}
                 }}
                 request={(params) => {
                 request={(params) => {
-                  const sorts: any = [{ name: 'createTime', order: 'desc' }];
+                  const sorts: any = [];
 
 
                   if (oldRowKey) {
                   if (oldRowKey) {
                     sorts.push({
                     sorts.push({
@@ -397,7 +360,7 @@ export default observer((props: Props) => {
                       value: oldRowKey,
                       value: oldRowKey,
                     });
                     });
                   }
                   }
-
+                  sorts.push({ name: 'createTime', order: 'desc' });
                   return service.query({
                   return service.query({
                     ...params,
                     ...params,
                     sorts: sorts,
                     sorts: sorts,

+ 3 - 3
src/pages/rule-engine/Scene/Save/action/DeviceOutput/product/index.tsx

@@ -168,7 +168,7 @@ export default observer((props: Props) => {
           .queryOrgThree({
           .queryOrgThree({
             paging: false,
             paging: false,
           })
           })
-          .then((resp) => {
+          .then((resp: any) => {
             const formatValue = (list: any[]) => {
             const formatValue = (list: any[]) => {
               const _list: any[] = [];
               const _list: any[] = [];
               list.forEach((item) => {
               list.forEach((item) => {
@@ -241,7 +241,7 @@ export default observer((props: Props) => {
             },
             },
           }}
           }}
           request={(params) => {
           request={(params) => {
-            const sorts: any = [{ name: 'createTime', order: 'desc' }];
+            const sorts: any = [];
 
 
             if (oldRowKey) {
             if (oldRowKey) {
               sorts.push({
               sorts.push({
@@ -249,7 +249,7 @@ export default observer((props: Props) => {
                 value: oldRowKey,
                 value: oldRowKey,
               });
               });
             }
             }
-
+            sorts.push({ name: 'createTime', order: 'desc' });
             return service.query({
             return service.query({
               ...params,
               ...params,
               sorts: sorts,
               sorts: sorts,

+ 2 - 2
src/pages/rule-engine/Scene/Save/action/ListItem/Item.tsx

@@ -381,7 +381,7 @@ export default (props: ItemProps) => {
           </div>
           </div>
         </Popconfirm>
         </Popconfirm>
       </div>
       </div>
-      {!props.isLast && (
+      {!props.isLast && props.type === 'serial' ? (
         <div
         <div
           className={classNames('actions-item-filter-warp', {
           className={classNames('actions-item-filter-warp', {
             'filter-border': !!thenTerms?.length,
             'filter-border': !!thenTerms?.length,
@@ -522,7 +522,7 @@ export default (props: ItemProps) => {
             )}
             )}
           </div>
           </div>
         </div>
         </div>
-      )}
+      ) : null}
       {visible && (
       {visible && (
         <Modal
         <Modal
           name={props.name}
           name={props.name}

+ 11 - 7
src/pages/rule-engine/Scene/Save/action/index.tsx

@@ -33,7 +33,10 @@ export default (props: ActionsProps) => {
     const serialArr = props.thenOptions.filter((item) => !item.parallel);
     const serialArr = props.thenOptions.filter((item) => !item.parallel);
     setParallelArray(parallelArr);
     setParallelArray(parallelArr);
     setSerialArray(serialArr);
     setSerialArray(serialArr);
-    if (!lock && parallelArr.length && !serialArr.length) {
+    const isSerialActions = serialArr.some((item) => {
+      return !!item.actions.length;
+    });
+    if (!lock && parallelArr.length && (!serialArr.length || !isSerialActions)) {
       setActiveKey(['2']);
       setActiveKey(['2']);
       setLock(true);
       setLock(true);
     }
     }
@@ -140,17 +143,18 @@ export default (props: ActionsProps) => {
                 parallel={true}
                 parallel={true}
                 actions={parallelArray.length ? parallelArray[0].actions : []}
                 actions={parallelArray.length ? parallelArray[0].actions : []}
                 onAdd={(actionItem) => {
                 onAdd={(actionItem) => {
-                  if (parallelArray.length) {
-                    const indexOf = parallelArray[0].actions?.findIndex(
+                  const newParallelArray = [...parallelArray];
+                  if (newParallelArray.length) {
+                    const indexOf = newParallelArray[0].actions?.findIndex(
                       (aItem) => aItem.key === actionItem.key,
                       (aItem) => aItem.key === actionItem.key,
                     );
                     );
                     if (indexOf !== -1) {
                     if (indexOf !== -1) {
-                      parallelArray[0].actions.splice(indexOf, 1, actionItem);
+                      newParallelArray[0].actions.splice(indexOf, 1, actionItem);
                     } else {
                     } else {
-                      parallelArray[0].actions.push(actionItem);
+                      newParallelArray[0].actions.push(actionItem);
                     }
                     }
-                    setParallelArray([...parallelArray]);
-                    props.onUpdate(parallelArray[0], true);
+                    setParallelArray([...newParallelArray]);
+                    props.onUpdate(newParallelArray[0], true);
                   } else {
                   } else {
                     actionItem.key = randomString();
                     actionItem.key = randomString();
                     props.onAdd({
                     props.onAdd({

+ 5 - 1
src/pages/rule-engine/Scene/Save/save.tsx

@@ -2,7 +2,7 @@ import { Modal } from '@/components';
 import { Form, Input } from 'antd';
 import { Form, Input } from 'antd';
 import TriggerWay from '@/pages/rule-engine/Scene/Save/components/TriggerWay';
 import TriggerWay from '@/pages/rule-engine/Scene/Save/components/TriggerWay';
 import type { SceneItem } from '@/pages/rule-engine/Scene/typings';
 import type { SceneItem } from '@/pages/rule-engine/Scene/typings';
-import { useEffect } from 'react';
+import { useEffect, useState } from 'react';
 import { getMenuPathByCode } from '@/utils/menu';
 import { getMenuPathByCode } from '@/utils/menu';
 import useHistory from '@/hooks/route/useHistory';
 import useHistory from '@/hooks/route/useHistory';
 import { service } from '../index';
 import { service } from '../index';
@@ -15,6 +15,7 @@ interface Props {
 export default (props: Props) => {
 export default (props: Props) => {
   const [form] = Form.useForm();
   const [form] = Form.useForm();
   const history = useHistory();
   const history = useHistory();
+  const [loading, setLoading] = useState(false);
 
 
   useEffect(() => {
   useEffect(() => {
     form.setFieldsValue({
     form.setFieldsValue({
@@ -31,6 +32,7 @@ export default (props: Props) => {
         props.close();
         props.close();
       }}
       }}
       width={750}
       width={750}
+      confirmLoading={loading}
       onOk={async () => {
       onOk={async () => {
         const values = await form.validateFields();
         const values = await form.validateFields();
         const obj = {
         const obj = {
@@ -41,9 +43,11 @@ export default (props: Props) => {
             ...values.trigger,
             ...values.trigger,
           },
           },
         };
         };
+        setLoading(true);
         const resp = props.data?.id
         const resp = props.data?.id
           ? await service.modify(props.data?.id, { ...obj })
           ? await service.modify(props.data?.id, { ...obj })
           : await service.save(obj);
           : await service.save(obj);
+        setLoading(false);
         if (resp.status === 200) {
         if (resp.status === 200) {
           props.close();
           props.close();
           const url = getMenuPathByCode('rule-engine/Scene/Save');
           const url = getMenuPathByCode('rule-engine/Scene/Save');

+ 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;