xieyonghong 4 gadi atpakaļ
vecāks
revīzija
c6b3ab8013

BIN
public/images/cloud/dueros-doc.jpg


+ 1 - 1
src/components/ProTableCard/CardItems/duerOs.tsx

@@ -39,7 +39,7 @@ export default (props: DuerOSProps) => {
             <div>
               <label>产品</label>
               <div className={'ellipsis'}>
-                <Tooltip title={props?.name || ''}>{props?.name || ''}</Tooltip>
+                <Tooltip title={props?.productName || ''}>{props?.productName || ''}</Tooltip>
               </div>
             </div>
             <div>

+ 52 - 20
src/pages/Northbound/AliCloud/Detail/index.tsx

@@ -11,20 +11,19 @@ import {
   Select,
 } from '@formily/antd';
 import type { Field } from '@formily/core';
-import { createForm, onFieldValueChange } from '@formily/core';
+import { createForm, FormPath, onFieldChange, onFieldValueChange } from '@formily/core';
 import { createSchemaField, observer } from '@formily/react';
 import { Card, Col, Image, message, Row } from 'antd';
-import { useEffect, useMemo, useState } from 'react';
+import { useEffect, useMemo } from 'react';
 import { useParams } from 'umi';
 import { useAsyncDataSource } from '@/utils/util';
 import './index.less';
 import { service } from '@/pages/Northbound/AliCloud';
 import usePermissions from '@/hooks/permission';
+import { Store } from 'jetlinks-store';
 
 const Detail = observer(() => {
   const params = useParams<{ id: string }>();
-  const [dataList, setDataList] = useState<any[]>([]);
-  const [productList, setProductList] = useState<any[]>([]);
 
   const form = useMemo(
     () =>
@@ -35,20 +34,47 @@ const Detail = observer(() => {
             const regionId = field.query('accessConfig.regionId').value();
             const accessKeyId = field.query('accessConfig.accessKeyId').value();
             const accessSecret = field.query('accessConfig.accessSecret').value();
+            let response: any[] = [];
             if (regionId && accessKeyId && accessSecret) {
-              const response = await service.getAliyunProductsList({
+              response = await service.getAliyunProductsList({
                 regionId,
                 accessKeyId,
                 accessSecret,
               });
-              f.setFieldState(field.query('bridgeProductKey'), (state) => {
-                state.dataSource = response;
-                setDataList(response);
+            }
+            f.setFieldState(field.query('bridgeProductKey'), (state) => {
+              state.dataSource = response;
+              Store.set('datalist', response);
+            });
+          });
+
+          onFieldChange('mappings.*.productKey', async (field, f) => {
+            const propertyPath = FormPath.transform(
+              field.path,
+              /\d+/,
+              (index) => `mappings.${index}`,
+            );
+            const value = field.query('.productKey').value();
+            if ((Store.get('datalist') || [])?.length > 0) {
+              f.setFieldState(propertyPath, (state) => {
+                state.componentProps = {
+                  header:
+                    (Store.get('datalist') || []).find((item: any) => item.value === value || '')
+                      ?.label || `产品映射`,
+                };
               });
             } else {
-              f.setFieldState(field.query('bridgeProductKey'), (state) => {
-                state.dataSource = [];
-                setDataList([]);
+              const accessConfig = field.query('accessConfig').value();
+              let response: any[] = [];
+              if (Object.keys(accessConfig).length >= 3) {
+                response = await service.getAliyunProductsList(accessConfig);
+              }
+              f.setFieldState(propertyPath, (state) => {
+                Store.set('datalist', response);
+                state.componentProps = {
+                  header:
+                    response.find((item: any) => item.value === value || '')?.label || `产品映射`,
+                };
               });
             }
           });
@@ -85,35 +111,39 @@ const Detail = observer(() => {
     const checked = [...items];
     const index = checked.findIndex((i) => i === f.value);
     checked.splice(index, 1);
-    if (productList?.length > 0) {
+    if (Store.get('productList')?.length > 0) {
       return new Promise((resolve) => {
-        const list = productList.filter((j: any) => !checked.includes(j.value));
+        const list = Store.get('productList').filter((j: any) => !checked.includes(j.value));
         resolve(list);
       });
     } else {
       return service.getProductsList({ paging: false }).then((resp) => {
-        setProductList(resp);
+        Store.set('productList', resp);
         return resp.filter((j: any) => !checked.includes(j.value));
       });
     }
   };
 
   const queryAliyunProductList = (f: Field) => {
+    const accessConfig = form.getValuesIn('accessConfig') || {};
     const items = form.getValuesIn('mappings')?.map((i: any) => i?.productKey) || [];
     const checked = [...items];
     const index = checked.findIndex((i) => i === f.value);
     checked.splice(index, 1);
-    if (dataList?.length > 0) {
+    if ((Store.get('datalist') || [])?.length > 0) {
       return new Promise((resolve) => {
-        const list = dataList.filter((j: any) => !checked.includes(j.value));
+        const list = (Store.get('datalist') || []).filter((j: any) => !checked.includes(j.value));
         resolve(list);
       });
-    } else {
-      const accessConfig = form.getValuesIn('accessConfig') || {};
+    } else if (Object.keys(accessConfig).length >= 3) {
       return service.getAliyunProductsList(accessConfig).then((resp) => {
-        setDataList(resp);
+        Store.set('datalist', resp);
         return resp.filter((j: any) => !checked.includes(j.value));
       });
+    } else {
+      return new Promise((resolve) => {
+        resolve([]);
+      });
     }
   };
 
@@ -343,7 +373,9 @@ const Detail = observer(() => {
 
   const handleSave = async () => {
     const data: any = await form.submit();
-    const product = dataList.find((item) => item?.value === data?.bridgeProductKey);
+    const product = (Store.get('datalist') || []).find(
+      (item: any) => item?.value === data?.bridgeProductKey,
+    );
     data.bridgeProductName = product?.label || '';
     const response: any = data.id ? await service.update(data) : await service.save(data);
     if (response.status === 200) {

+ 7 - 0
src/pages/Northbound/DuerOS/Detail/Doc.tsx

@@ -1,3 +1,7 @@
+import { Image } from 'antd';
+
+const image = require('/public/images/cloud/dueros-doc.jpg');
+
 const Doc = () => {
   return (
     <div className="doc">
@@ -14,6 +18,9 @@ const Doc = () => {
       <h1>2. 操作步骤</h1>
       <div>
         <h2>1、在百度小度技能平台创建技能,并授权。完成物联网平台与dueros的关联。</h2>
+        <div className={'image'}>
+          <Image width="100%" src={image} />
+        </div>
         <h2>2、登录物联网平台,进行平台内产品与dueros产品的数据映射。</h2>
         <h2>
           3、智能家居用户通过物联网平台中的用户,登录小度APP,获取平台内当前用户的所属设备。获取后即可进行语音控制。

+ 75 - 13
src/pages/Northbound/DuerOS/Detail/index.tsx

@@ -15,7 +15,14 @@ import {
 } from '@formily/antd';
 import { PermissionButton } from '@/components';
 import { useMemo } from 'react';
-import { createForm, Field, onFieldReact, onFieldValueChange, onFormInit } from '@formily/core';
+import {
+  createForm,
+  Field,
+  FormPath,
+  onFieldReact,
+  onFieldValueChange,
+  onFormInit,
+} from '@formily/core';
 import { useAsyncDataSource } from '@/utils/util';
 import { service } from '..';
 import { Store } from 'jetlinks-store';
@@ -48,7 +55,6 @@ const Save = () => {
   const findApplianceType = (_id: string) => {
     if (!_id) return;
     const _productTypes = Store.get('product-types');
-    console.log(_productTypes, 'tt');
     return _productTypes?.find((item: any) => item.id === _id);
   };
 
@@ -81,9 +87,24 @@ const Save = () => {
             }
             form1.setInitialValues(_data);
           });
-          onFieldReact('actionMappings.*.layout.action', (field) => {
+          onFieldReact('actionMappings.*.layout.action', (field, f) => {
             const productType = field.query('applianceType').value();
-            (field as Field).setDataSource(findApplianceType(productType)?.actions);
+            const actions = findApplianceType(productType)?.actions;
+            (field as Field).setDataSource(actions);
+
+            const actionPath = FormPath.transform(
+              field.path,
+              /\d+/,
+              (index) => `actionMappings.${index}`,
+            );
+            const value = (field as Field).value;
+
+            const title = actions.find((item: any) => item.id === value)?.name;
+            f.setFieldState(actionPath, (state) => {
+              state.componentProps = {
+                header: title || '动作映射',
+              };
+            });
           });
           onFieldReact('actionMappings.*.layout.command.message.properties', (field) => {
             const product = field.query('id').value();
@@ -102,7 +123,7 @@ const Save = () => {
               const _functionList = findProductMetadata(product)?.functions;
               const _function =
                 _functionList && _functionList.find((item: any) => item.id === functionId);
-              form1.setFieldState(field.query('.function'), (state) => {
+              form1.setFieldState(field.query('.inputs'), (state) => {
                 state.value = _function?.inputs.map((item: any) => ({
                   ...item,
                   valueType: item?.valueType?.type,
@@ -110,9 +131,22 @@ const Save = () => {
               });
             },
           );
-          onFieldReact('propertyMappings.*.layout.source', (field) => {
+          onFieldReact('propertyMappings.*.layout.source', (field, f) => {
             const productType = field.query('applianceType').value();
-            (field as Field).setDataSource(findApplianceType(productType)?.properties);
+            const propertiesList = findApplianceType(productType)?.properties;
+            (field as Field).setDataSource();
+            const propertyMappingPath = FormPath.transform(
+              field.path,
+              /\d+/,
+              (index) => `propertyMappings.${index}`,
+            );
+            const value = (field as Field).value;
+            const title = propertiesList.find((item: any) => item.id === value)?.name;
+            f.setFieldState(propertyMappingPath, (state) => {
+              state.componentProps = {
+                header: title || '属性映射',
+              };
+            });
           });
           onFieldReact('propertyMappings.*.layout.target', (field) => {
             const product = field.query('id').value();
@@ -144,8 +178,7 @@ const Save = () => {
     const index = checked.findIndex((i) => i === f.value);
     checked.splice(index, 1);
     const _productType = form.getValuesIn('applianceType');
-    const targetList = findApplianceType(_productType?.value)?.properties;
-    console.log(targetList, 'list', _productType);
+    const targetList = findApplianceType(_productType)?.properties;
     const list = targetList?.filter((i: { id: string }) => !checked.includes(i.id));
     return new Promise((resolve) => resolve(list));
   };
@@ -202,12 +235,13 @@ const Save = () => {
             title: '设备类型',
             'x-decorator-props': {
               gridSpan: 1,
+              tooltip: 'DuerOS平台拟定的规范',
             },
             type: 'string',
             'x-decorator': 'FormItem',
             'x-component': 'Select',
             'x-component-props': {
-              placeholder: '请选择产品',
+              placeholder: '请选择设备类型',
               fieldNames: {
                 label: 'name',
                 value: 'id',
@@ -250,6 +284,7 @@ const Save = () => {
                   'x-decorator-props': {
                     layout: 'vertical',
                     labelAlign: 'left',
+                    tooltip: 'DuerOS平台拟定的设备类型具有的相关动作',
                   },
                   required: true,
                   'x-component-props': {
@@ -266,7 +301,9 @@ const Save = () => {
                   'x-decorator-props': {
                     layout: 'vertical',
                     labelAlign: 'left',
+                    tooltip: '映射物联网平台中所选产品具备的动作',
                   },
+                  required: true,
                   enum: [
                     { label: '下发指令', value: 'command' },
                     { label: '获取历史数据', value: 'latestData' },
@@ -283,6 +320,7 @@ const Save = () => {
                         labelAlign: 'left',
                         gridSpan: 2,
                       },
+                      required: true,
                       'x-component': 'Select',
                       'x-decorator': 'FormItem',
                       enum: [
@@ -304,6 +342,7 @@ const Save = () => {
                       properties: {
                         properties: {
                           title: '属性',
+                          required: true,
                           'x-component': 'Select',
                           'x-decorator': 'FormItem',
                           'x-decorator-props': {
@@ -341,6 +380,7 @@ const Save = () => {
                         },
                         value: {
                           title: '值',
+                          required: true,
                           'x-component': 'Input',
                           'x-decorator': 'FormItem',
                           'x-decorator-props': {
@@ -358,6 +398,7 @@ const Save = () => {
                         },
                         functionId: {
                           title: '功能',
+                          required: true,
                           'x-component': 'Select',
                           'x-decorator': 'FormItem',
                           'x-decorator-props': {
@@ -383,6 +424,7 @@ const Save = () => {
                         inputs: {
                           title: '参数列表',
                           type: 'array',
+                          required: true,
                           'x-component': 'ArrayTable',
                           'x-decorator': 'FormItem',
                           'x-decorator-props': {
@@ -403,6 +445,7 @@ const Save = () => {
                                 properties: {
                                   name: {
                                     type: 'string',
+                                    required: true,
                                     'x-component': 'PreviewText.Input',
                                   },
                                 },
@@ -414,6 +457,7 @@ const Save = () => {
                                 properties: {
                                   valueType: {
                                     type: 'string',
+                                    required: true,
                                     'x-component': 'PreviewText.Input',
                                   },
                                 },
@@ -425,6 +469,7 @@ const Save = () => {
                                 properties: {
                                   value: {
                                     type: 'string',
+                                    required: true,
                                     'x-component': 'Input',
                                   },
                                 },
@@ -469,7 +514,7 @@ const Save = () => {
           type: 'object',
           'x-component': 'ArrayCollapse.CollapsePanel',
           'x-component-props': {
-            header: '动作',
+            header: '属性映射',
           },
           properties: {
             index: {
@@ -493,6 +538,7 @@ const Save = () => {
                     layout: 'vertical',
                     labelAlign: 'left',
                   },
+                  required: true,
                   'x-component-props': {
                     fieldNames: {
                       label: 'name',
@@ -509,6 +555,7 @@ const Save = () => {
                     layout: 'vertical',
                     labelAlign: 'left',
                   },
+                  required: true,
                   'x-component-props': {
                     fieldNames: {
                       label: 'name',
@@ -534,14 +581,29 @@ const Save = () => {
           },
         },
       },
+      description: {
+        title: '说明',
+        'x-component': 'Input.TextArea',
+        'x-decorator': 'FormItem',
+        'x-component-props': {
+          rows: 3,
+          showCount: true,
+          maxLength: 200,
+          placeholder: '请输入说明',
+        },
+      },
     },
   };
 
   const handleSave = async () => {
     const data: any = await form.submit();
     const productName = Store.get('product-list')?.find((item: any) => item.id === data.id)?.name;
-    await service.savePatch({ ...data, productName });
-    message.success('保存成功!');
+    const resp: any = await service.savePatch({ ...data, productName });
+    if (resp.status === 200) {
+      message.success('保存成功!');
+    } else {
+      message.error('保存失败!');
+    }
     history.back();
   };
   return (

+ 69 - 15
src/pages/Northbound/DuerOS/index.tsx

@@ -4,13 +4,15 @@ import { useRef, useState } from 'react';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import { PermissionButton, ProTableCard } from '@/components';
 import {
+  CloseCircleOutlined,
   DeleteOutlined,
   EditOutlined,
   ExclamationCircleFilled,
+  PlayCircleOutlined,
   PlusOutlined,
 } from '@ant-design/icons';
 import { useIntl } from '@@/plugin-locale/localeExports';
-import { message, Space } from 'antd';
+import { Badge, message, Space } from 'antd';
 import { DuerOSItem } from '@/pages/Northbound/DuerOS/types';
 import DuerOSCard from '@/components/ProTableCard/CardItems/duerOs';
 import { history } from '@@/core/history';
@@ -53,10 +55,64 @@ export default () => {
           })}
       </PermissionButton>,
       <PermissionButton
+        style={{ padding: 0 }}
+        isPermission={permission.action}
+        type="link"
+        key="changeState"
+        popConfirm={{
+          title: intl.formatMessage({
+            id: `pages.data.option.${
+              record.state?.value === 'enabled' ? 'disabled' : 'enabled'
+            }.tips`,
+            defaultMessage: `确认${record.state?.value === 'enabled' ? '禁用' : '启用'}?`,
+          }),
+          onConfirm: async () => {
+            const map = {
+              disabled: 'enable',
+              enabled: 'disable',
+            };
+            const resp = await service.changeState(record.id, map[record.state?.value]);
+            if (resp.status === 200) {
+              message.success(
+                intl.formatMessage({
+                  id: 'pages.data.option.success',
+                  defaultMessage: '操作成功!',
+                }),
+              );
+            } else {
+              message.error('操作失败!');
+            }
+
+            actionRef.current?.reload();
+          },
+        }}
+        tooltip={{
+          title: intl.formatMessage({
+            id: `pages.data.option.${record.state?.value === 'enabled' ? 'disabled' : 'enabled'}`,
+            defaultMessage: record.state?.value === 'enabled' ? '禁用' : '启用',
+          }),
+        }}
+      >
+        {record.state?.value === 'enabled' ? (
+          <>
+            {' '}
+            <CloseCircleOutlined /> {type === 'card' && '禁用'}
+          </>
+        ) : (
+          <>
+            <PlayCircleOutlined /> {type === 'card' && '启用'}
+          </>
+        )}
+      </PermissionButton>,
+      <PermissionButton
         key={'delete'}
         type={'link'}
         style={{ padding: 0 }}
         isPermission={permission.delete}
+        disabled={record.state?.value === 'enabled'}
+        tooltip={{
+          title: record.state?.value === 'disabled' ? '删除' : '请先禁用该数据,再删除。',
+        }}
         popConfirm={{
           title: '确认删除?',
           onConfirm: async () => {
@@ -65,9 +121,6 @@ export default () => {
             actionRef.current?.reload();
           },
         }}
-        tooltip={{
-          title: '删除',
-        }}
       >
         <DeleteOutlined />
       </PermissionButton>,
@@ -98,18 +151,19 @@ export default () => {
       renderText: (data) => data.text,
     },
     {
-      title: intl.formatMessage({
-        id: 'pages.cloud.duerOS.manufacturerName',
-        defaultMessage: '厂家名称',
-      }),
-      dataIndex: 'manufacturerName',
+      title: '说明',
+      dataIndex: 'description',
     },
     {
-      title: intl.formatMessage({
-        id: 'pages.cloud.duerOS.version',
-        defaultMessage: '动作数量',
-      }),
-      dataIndex: 'version',
+      title: '状态',
+      dataIndex: 'state',
+      renderText: (data) => {
+        const map = {
+          disabled: <Badge status="error" text="禁用" />,
+          enabled: <Badge status="success" text="正常" />,
+        };
+        return map[data.value];
+      },
     },
     {
       title: intl.formatMessage({
@@ -160,7 +214,7 @@ export default () => {
         headerTitle={
           <Space>
             <PermissionButton
-              isPermission={true}
+              isPermission={permission.add}
               onClick={() => {
                 history.push(getMenuPathByCode(MENUS_CODE['Northbound/DuerOS/Detail']));
               }}

+ 3 - 0
src/pages/Northbound/DuerOS/service.ts

@@ -16,6 +16,9 @@ class Service extends BaseService<DuerOSItem> {
         paging: false,
       },
     });
+
+  public changeState = (id: string, state: 'enable' | 'disable') =>
+    request(`/${SystemConst.API_BASE}/dueros/product/${id}/_${state}`, { method: 'POST' });
 }
 
 export default Service;

+ 2 - 0
src/pages/account/Center/index.less

@@ -18,10 +18,12 @@
   .content {
     width: 80%;
     padding-top: 15px;
+
     :global {
       .ant-descriptions-item-label::after {
         content: none;
       }
+
       .ant-descriptions-item-content {
         color: #666363d9;
       }

+ 1 - 0
src/pages/cloud/DuerOS/typings.d.ts

@@ -28,6 +28,7 @@ type ActionMapping = {
   };
 };
 type DuerOSItem = {
+  productName?: string;
   version: number;
   manufacturerName: string;
   autoReportProperty: boolean;

+ 25 - 17
src/pages/device/Instance/Detail/MetadataLog/Property/AMap.tsx

@@ -1,4 +1,5 @@
 import { AMap, PathSimplifier } from '@/components';
+import useDistance from '@/components/AMapComponent/hooks/Distance';
 import { Button, Space } from 'antd';
 import { useEffect, useRef, useState } from 'react';
 
@@ -8,20 +9,28 @@ interface Props {
 }
 
 export default (props: Props) => {
-  const [speed] = useState(1000000);
+  const { distance, onDistance } = useDistance();
+  const [speed, setSpeed] = useState<number>(1000000);
   const PathNavigatorRef = useRef<PathNavigator | null>(null);
-  const [dataSource, setDataSource] = useState<any>({});
+  const [dataSource, setDataSource] = useState<any[]>([]);
 
   useEffect(() => {
     const list: any[] = [];
     (props?.value?.data || []).forEach((item: any) => {
       list.push([item.value.lon, item.value.lat]);
     });
-    setDataSource({
-      name: props?.name || '',
-      path: [...list],
-    });
+    setDataSource([
+      {
+        name: props?.name || '',
+        path: [...list],
+      },
+    ]);
   }, [props.value]);
+
+  useEffect(() => {
+    setSpeed((distance / 5) * 3.6);
+  }, [distance]);
+
   return (
     <div style={{ position: 'relative' }}>
       <div style={{ position: 'absolute', right: 0, top: 5, zIndex: 999 }}>
@@ -55,17 +64,16 @@ export default (props: Props) => {
           width: '100%',
         }}
       >
-        {(dataSource?.path || []).length > 0 ? (
-          <PathSimplifier pathData={[dataSource]}>
-            <PathSimplifier.PathNavigator
-              speed={speed}
-              isAuto={false}
-              onCreate={(nav) => {
-                PathNavigatorRef.current = nav;
-              }}
-            />
-          </PathSimplifier>
-        ) : null}
+        <PathSimplifier pathData={dataSource}>
+          <PathSimplifier.PathNavigator
+            speed={speed}
+            isAuto={false}
+            onCreate={(nav) => {
+              onDistance(dataSource[0]?.path);
+              PathNavigatorRef.current = nav;
+            }}
+          />
+        </PathSimplifier>
       </AMap>
     </div>
   );

+ 4 - 2
src/pages/device/Instance/Detail/MetadataLog/Property/index.tsx

@@ -149,6 +149,7 @@ const PropertyLog = (props: Props) => {
           type: 'and',
         },
       ],
+      sorts: [{ name: 'timestamp', order: 'asc' }],
     });
     if (resp.status === 200) {
       const dataList: any[] = [];
@@ -174,7 +175,7 @@ const PropertyLog = (props: Props) => {
           type: data?.name || '',
         });
       });
-      setChartsList(dataList);
+      setChartsList(dataList.reverse());
     }
   };
 
@@ -214,6 +215,7 @@ const PropertyLog = (props: Props) => {
             dataSource={dataSource?.data || []}
             columns={data?.valueType?.type === 'geoPoint' ? geoColumns : columns}
             pagination={{
+              current: dataSource?.pageIndex + 1,
               pageSize: dataSource?.pageSize || 10,
               showSizeChanger: true,
               total: dataSource?.total || 0,
@@ -231,7 +233,7 @@ const PropertyLog = (props: Props) => {
                   style={{ width: 120 }}
                   onChange={(value: string) => {
                     setCycle(value);
-                    if (cycle === '*') {
+                    if (value === '*') {
                       queryChartsList(start, end);
                     } else {
                       queryChartsAggList({

+ 1 - 1
src/pages/device/Instance/Detail/Running/Property/FileComponent/Detail.tsx

@@ -1,5 +1,5 @@
 import LivePlayer from '@/components/Player';
-import { Modal, Image } from 'antd';
+import { Image, Modal } from 'antd';
 
 interface Props {
   close: () => void;

+ 2 - 6
src/pages/device/Instance/Detail/Running/Property/FileComponent/index.tsx

@@ -1,7 +1,7 @@
 import type { PropertyMetadata } from '@/pages/device/Product/typings';
 import styles from './index.less';
 import Detail from './Detail';
-import { useEffect, useState } from 'react';
+import { useState } from 'react';
 import { message, Tooltip } from 'antd';
 
 interface Props {
@@ -31,12 +31,8 @@ const FileComponent = (props: Props) => {
   const isHttps = document.location.protocol === 'https:';
   const [temp, setTemp] = useState<boolean>(false);
 
-  useEffect(() => {
-    setTemp(false);
-  }, [props.value]);
-
   const renderValue = () => {
-    if (!value?.formatValue) {
+    if (value?.formatValue !== 0 && !value?.formatValue) {
       return <div className={props.type === 'card' ? styles.other : {}}>--</div>;
     } else if (data?.valueType?.type === 'file') {
       if (

+ 2 - 2
src/pages/link/AccessConfig/Detail/Cloud/Protocol/index.tsx

@@ -15,8 +15,8 @@ ProcotoleMapping.set('mqtt-client-gateway', 'MQTT');
 ProcotoleMapping.set('mqtt-server-gateway', 'MQTT');
 ProcotoleMapping.set('tcp-server-gateway', 'TCP');
 ProcotoleMapping.set('child-device', '');
-ProcotoleMapping.set('OneNet', 'OneNet');
-ProcotoleMapping.set('Ctwing', 'Ctwing');
+ProcotoleMapping.set('OneNet', 'HTTP');
+ProcotoleMapping.set('Ctwing', 'HTTP');
 ProcotoleMapping.set('modbus-tcp', 'MODBUS_TCP');
 ProcotoleMapping.set('opc-ua', 'OPC_UA');
 

+ 1 - 1
src/pages/link/Channel/Modbus/Access/addPoint/index.tsx

@@ -1,4 +1,4 @@
-import { Col, Form, Input, Modal, Row, Select, InputNumber, message } from 'antd';
+import { Col, Form, Input, InputNumber, message, Modal, Row, Select } from 'antd';
 import { useEffect, useState } from 'react';
 import { service } from '@/pages/link/Channel/Modbus';
 

+ 1 - 1
src/pages/link/Channel/Modbus/Access/bindDevice/index.tsx

@@ -2,7 +2,7 @@ import { Modal } from '@/components';
 import SearchComponent from '@/components/SearchComponent';
 import ProTable, { ActionType, ProColumns } from '@jetlinks/pro-table';
 import { Badge, message } from 'antd';
-import { useState, useRef } from 'react';
+import { useRef, useState } from 'react';
 import { service } from '@/pages/link/Channel/Modbus';
 import moment from 'moment';
 

+ 1 - 1
src/pages/link/Channel/Modbus/Access/index.tsx

@@ -1,7 +1,7 @@
 import PermissionButton from '@/components/PermissionButton';
 import { PageContainer } from '@ant-design/pro-layout';
 import ProTable, { ActionType, ProColumns } from '@jetlinks/pro-table';
-import { Badge, Card, Popconfirm, message, Tabs, Empty, Input } from 'antd';
+import { Badge, Card, Empty, Input, message, Popconfirm, Tabs } from 'antd';
 import { useIntl, useLocation } from 'umi';
 import { useEffect, useRef, useState } from 'react';
 import {

+ 1 - 1
src/pages/link/Channel/Modbus/Save/index.tsx

@@ -1,7 +1,7 @@
 import { useIntl } from 'umi';
 import { createForm } from '@formily/core';
 import { createSchemaField } from '@formily/react';
-import { Form, FormGrid, FormItem, Input, Select, NumberPicker } from '@formily/antd';
+import { Form, FormGrid, FormItem, Input, NumberPicker, Select } from '@formily/antd';
 import type { ISchema } from '@formily/json-schema';
 import { service } from '@/pages/link/Channel/Modbus';
 import { Modal } from '@/components';

+ 1 - 0
src/pages/link/Channel/Modbus/index.less

@@ -1,6 +1,7 @@
 .topCard {
   display: flex;
   align-items: center;
+
   .img {
     position: relative;
     top: 10px;

+ 1 - 1
src/pages/link/Channel/Opcua/Access/addPoint/index.tsx

@@ -1,4 +1,4 @@
-import { Col, Form, Input, Modal, Row, Select, InputNumber, Radio, message } from 'antd';
+import { Col, Form, Input, InputNumber, message, Modal, Radio, Row, Select } from 'antd';
 import { useEffect, useState } from 'react';
 import { service } from '@/pages/link/Channel/Opcua';
 import { DataTypeList } from '@/pages/device/data';

+ 1 - 1
src/pages/link/Channel/Opcua/Access/bindDevice/index.tsx

@@ -2,7 +2,7 @@ import { Modal } from '@/components';
 import SearchComponent from '@/components/SearchComponent';
 import ProTable, { ActionType, ProColumns } from '@jetlinks/pro-table';
 import { Badge, message } from 'antd';
-import { useEffect, useState, useRef } from 'react';
+import { useEffect, useRef, useState } from 'react';
 import { service } from '@/pages/link/Channel/Opcua';
 import moment from 'moment';
 

+ 1 - 1
src/pages/link/Channel/Opcua/Access/index.tsx

@@ -1,7 +1,7 @@
 import PermissionButton from '@/components/PermissionButton';
 import { PageContainer } from '@ant-design/pro-layout';
 import ProTable, { ActionType, ProColumns } from '@jetlinks/pro-table';
-import { Badge, Card, Popconfirm, message, Tabs, Empty, Input } from 'antd';
+import { Badge, Card, Empty, Input, message, Popconfirm, Tabs } from 'antd';
 import { useIntl, useLocation } from 'umi';
 import { useEffect, useRef, useState } from 'react';
 import {

+ 0 - 1
src/pages/rule-engine/Scene/TriggerTerm/index.tsx

@@ -392,7 +392,6 @@ const TriggerTerm = (props: Props, ref: any) => {
                               },
                             },
                           },
-
                           metric: {
                             type: 'string',
                             'x-component': 'Select',

+ 1 - 1
src/pages/system/Platforms/Api/basePage.tsx

@@ -1,5 +1,5 @@
 import { Button, message, Table } from 'antd';
-import { useCallback, useEffect, useState, useRef } from 'react';
+import { useCallback, useEffect, useRef, useState } from 'react';
 import { useLocation } from 'umi';
 import { service } from '../index';
 import { ApiModel } from '@/pages/system/Platforms/Api/base';