Commit 5a12dae80d6ee7633b0c1fc9400f824f14ef7c04
1 parent
4888f7a6
feat: mock data for topic panel on product detail
Showing
2 changed files
with
20 additions
and
5 deletions
| 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 | + | |
| 6 | + 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' }, | |
| 11 | + ]; | |
| 12 | + | |
| 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 | + }); | |
| 21 | + | |
| 4 | 22 | const [register] = useTable({ |
| 5 | 23 | title: 'Topic', |
| 24 | + showIndexColumn: false, | |
| 25 | + dataSource, | |
| 6 | 26 | columns: topicTableColumn, |
| 7 | 27 | bordered: true, |
| 8 | 28 | showTableSetting: true, | ... | ... |