1
|
1
|
<script lang="ts" setup>
|
2
|
2
|
import { topicTableColumn } from '../device.profile.data';
|
3
|
3
|
import { BasicTable, useTable } from '/@/components/Table';
|
4
|
|
- import { buildUUID } from '/@/utils/uuid';
|
5
|
4
|
|
6
|
5
|
const list = [
|
7
|
|
- { function: '遥测主题', class: 'v1/devices/me/telemetry' },
|
8
|
|
- { function: '属性主题', class: 'v1/devices/me/attributes' },
|
9
|
|
- { function: '设备上报事件主题', class: 'v1/devices/me/attributes' },
|
10
|
|
- { function: '服务控制设备(RPC)主题', class: 'v1/devices/me/attributes' },
|
|
6
|
+ {
|
|
7
|
+ function: '网关/直连设备遥测',
|
|
8
|
+ release: 'v1/devices/me/telemetry',
|
|
9
|
+ subscribe: 'v1/devices/me/telemetry',
|
|
10
|
+ platform: '订阅',
|
|
11
|
+ device: '发布',
|
|
12
|
+ },
|
|
13
|
+ {
|
|
14
|
+ function: '服务端命令下发到设备端',
|
|
15
|
+ release: 'v1/devices/me/rpc/request/$request_id',
|
|
16
|
+ subscribe: 'v1/devices/me/rpc/request/+',
|
|
17
|
+ platform: '发布',
|
|
18
|
+ device: '订阅',
|
|
19
|
+ },
|
|
20
|
+ {
|
|
21
|
+ function: '设备端响应命令到服务端',
|
|
22
|
+ release: 'v1/devices/me/rpc/response/$request_id',
|
|
23
|
+ subscribe: 'v1/devices/me/rpc/response/+',
|
|
24
|
+ platform: '订阅',
|
|
25
|
+ device: '发布',
|
|
26
|
+ },
|
|
27
|
+ {
|
|
28
|
+ function: '直连设备属性上报',
|
|
29
|
+ release: 'v1/devices/me/attributes',
|
|
30
|
+ subscribe: 'v1/devices/me/attributes',
|
|
31
|
+ platform: '订阅',
|
|
32
|
+ device: '发布',
|
|
33
|
+ },
|
|
34
|
+
|
|
35
|
+ {
|
|
36
|
+ function: '设备端请求服务端共享属性及客户端属性',
|
|
37
|
+ release: 'vv1/devices/me/attributes/response/$request_id',
|
|
38
|
+ subscribe: 'v1/devices/me/attributes/response/+',
|
|
39
|
+ platform: '订阅',
|
|
40
|
+ device: '发布',
|
|
41
|
+ },
|
|
42
|
+ {
|
|
43
|
+ function: '服务端响应共享属性集客户端属性给设备端',
|
|
44
|
+ release: 'v1/devices/me/attributes/response/$request_id',
|
|
45
|
+ subscribe: 'v1/devices/me/attributes/response/+',
|
|
46
|
+ platform: '发布',
|
|
47
|
+ device: '订阅',
|
|
48
|
+ },
|
|
49
|
+ {
|
|
50
|
+ function: '设备端请求服务端子设备共享属性及客户端属性',
|
|
51
|
+ release: 'v1/gateway/attributes/request',
|
|
52
|
+ subscribe: 'v1/gateway/attributes/request',
|
|
53
|
+ platform: '订阅',
|
|
54
|
+ device: '发布',
|
|
55
|
+ },
|
|
56
|
+ {
|
|
57
|
+ function: '服务端响应子设备共享属性及客户端属性给设备端',
|
|
58
|
+ release: 'v1/gateway/attributes/response',
|
|
59
|
+ subscribe: 'v1/gateway/attributes/response',
|
|
60
|
+ platform: '发布',
|
|
61
|
+ device: '订阅',
|
|
62
|
+ },
|
|
63
|
+ {
|
|
64
|
+ function: '设备端上报子设备客户端属性',
|
|
65
|
+ release: 'v1/gateway/attributes',
|
|
66
|
+ subscribe: 'v1/gateway/attributes',
|
|
67
|
+ platform: '订阅',
|
|
68
|
+ device: '发布',
|
|
69
|
+ },
|
|
70
|
+ {
|
|
71
|
+ function: '网关子设备遥测',
|
|
72
|
+ release: 'v1/gateway/telemetry',
|
|
73
|
+ subscribe: 'v1/gateway/telemetry',
|
|
74
|
+ platform: '订阅',
|
|
75
|
+ device: '发布',
|
|
76
|
+ },
|
11
|
77
|
];
|
12
|
78
|
|
13
|
|
- const dataSource = Array.from({ length: 10 }, (_, index) => {
|
14
|
|
- const record = list[index % 4];
|
15
|
|
- return {
|
16
|
|
- id: buildUUID(),
|
17
|
|
- ...record,
|
18
|
|
- description: record.function,
|
19
|
|
- };
|
20
|
|
- });
|
|
79
|
+ const dataSource = list;
|
21
|
80
|
|
22
|
81
|
const [register] = useTable({
|
23
|
82
|
title: 'Topic',
|
...
|
...
|
|