فهرست منبع

feat(DuerOS):add DuerOS

crush 4 سال پیش
والد
کامیت
25d03bdfda
6فایلهای تغییر یافته به همراه120 افزوده شده و 4 حذف شده
  1. 13 1
      config/routes.ts
  2. 2 0
      src/locales/en-US/pages.ts
  3. 2 0
      src/locales/zh-CN/menu.ts
  4. 2 0
      src/locales/zh-CN/pages.ts
  5. 83 2
      src/pages/cloud/DuerOS/index.tsx
  6. 18 1
      src/pages/cloud/DuerOS/typings.d.ts

+ 13 - 1
config/routes.ts

@@ -311,7 +311,7 @@
       },
       {
         path:'/cloud/duer',
-        name:'duerOS',
+        name:'DuerOS',
         icon:'smile',
         component: './cloud/DuerOS',
       },
@@ -320,6 +320,18 @@
         name:'aliyun',
         icon:'smile',
         component: './cloud/Aliyun'
+      },
+      {
+        path:'/cloud/ctwing',
+        name:'ctwing',
+        icon:'smile',
+        component: './cloud/Ctwing'
+      },
+      {
+        path:'/cloud/onenet',
+        name:'onenet',
+        icon:'smile',
+        component: './cloud/Onenet'
       }
     ]
   },

+ 2 - 0
src/locales/en-US/pages.ts

@@ -172,6 +172,8 @@ export default {
   // 云云对接
   'pages.cloud.duerOS':'Duer OS',
   'pages.cloud.aliyun':'Aliyun',
+  'pages.cloud.onenet':'移动OneNet',
+  'pages.cloud.ctwing':'电信CTWing',
 
   // 视频网关
   'pages.media.config':'Config',

+ 2 - 0
src/locales/zh-CN/menu.ts

@@ -45,6 +45,8 @@ export default {
   'menu.cloud':'云云对接',
   'menu.cloud.duer':'DuerOS',
   'menu.cloud.aliyun':'阿里云',
+  'menu.cloud.onenet':'移动OneNet',
+  'menu.cloud.ctwing':'电信CTWing',
   'menu.media':'视频网关',
   'menu.media.config':'基本配置',
   'menu.media.device':'视频设备',

+ 2 - 0
src/locales/zh-CN/pages.ts

@@ -170,6 +170,8 @@ export default {
   // 云云对接
   'pages.cloud.duerOS':'Duer OS',
   'pages.cloud.aliyun':'阿里云',
+  'pages.cloud.onenet':'移动OneNet',
+  'pages.cloud.ctwing':'电信CTWing',
 
   // 视频网关
   'pages.media.config':'基本配置',

+ 83 - 2
src/pages/cloud/DuerOS/index.tsx

@@ -1,6 +1,87 @@
-import { PageContainer } from '@ant-design/pro-layout';
+import BaseService from '@/utils/BaseService';
+import type {ProColumns, ActionType} from '@jetlinks/pro-table';
+import {useIntl} from '@@/plugin-locale/localeExports';
+import {PageContainer} from '@ant-design/pro-layout';
+import BaseCrud from '@/components/BaseCrud';
+import {useRef} from 'react';
+import {Tooltip} from 'antd';
+import {EditOutlined, MinusOutlined} from '@ant-design/icons';
 
+export const service = new BaseService<DuerOSItem>('dueros/product');
 const DuerOS = () => {
-  return <PageContainer>Aliyun</PageContainer>;
+  const intl = useIntl();
+  const actionRef = useRef<ActionType>();
+  const columns: ProColumns<DuerOSItem>[] = [
+    {
+      dataIndex: 'index',
+      valueType: 'indexBorder',
+      width: 48,
+    },
+    {
+      title: '名称',
+      dataIndex: 'name',
+    },
+    {
+      title: '设备类型',
+      dataIndex: 'applianceType',
+    },
+    {
+      title: '厂商名称',
+      dataIndex: 'manufacturerName',
+    },
+    {
+      title: '动作数量',
+      dataIndex: 'version',
+    },
+    {
+      title: '操作',
+      valueType: 'option',
+      align: 'center',
+      width: 200,
+      render: (text, record) => [
+        <a
+          onClick={() => {
+            console.log(record);
+          }}
+        >
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.edit',
+              defaultMessage: '编辑',
+            })}
+          >
+            <EditOutlined/>
+          </Tooltip>
+        </a>,
+        <a>
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.remove',
+              defaultMessage: '删除',
+            })}
+          >
+            <MinusOutlined/>
+          </Tooltip>
+        </a>,
+      ],
+    },
+  ];
+  const schema = {};
+
+  return (
+    <PageContainer>
+      <BaseCrud<DuerOSItem>
+        columns={columns}
+        service={service}
+        title={intl.formatMessage({
+          id: 'pages.cloud.duerOS',
+          defaultMessage: 'DuerOS',
+        })}
+        schema={schema}
+        actionRef={actionRef}
+      />
+    </PageContainer>
+  );
 };
 export default DuerOS;
+

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

@@ -1,4 +1,21 @@
-type Item = {
+type Action = {
+  id:string;
+  name:string;
+  arg:unknown[];
+}
+type Mode = {
+  id:string;
+  name:string;
+}
+type Property = {
+  id:string;
+  name:string;
+}
+type DuerOSItem = {
   id: string;
   name: string;
+  actions:Action[];
+  modes:Mode[];
+  properties:Property[];
 };
+