Commit 5a12dae80d6ee7633b0c1fc9400f824f14ef7c04

Authored by ww
1 parent 4888f7a6

feat: mock data for topic panel on product detail

@@ -452,11 +452,6 @@ export const topicTableColumn: BasicColumn[] = [ @@ -452,11 +452,6 @@ export const topicTableColumn: BasicColumn[] = [
452 width: 100, 452 width: 100,
453 }, 453 },
454 { 454 {
455 - title: '操作权限',  
456 - dataIndex: 'access',  
457 - width: 100,  
458 - },  
459 - {  
460 title: '描述', 455 title: '描述',
461 dataIndex: 'description', 456 dataIndex: 'description',
462 width: 100, 457 width: 100,
1 <script lang="ts" setup> 1 <script lang="ts" setup>
2 import { topicTableColumn } from '../device.profile.data'; 2 import { topicTableColumn } from '../device.profile.data';
3 import { BasicTable, useTable } from '/@/components/Table'; 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 const [register] = useTable({ 22 const [register] = useTable({
5 title: 'Topic', 23 title: 'Topic',
  24 + showIndexColumn: false,
  25 + dataSource,
6 columns: topicTableColumn, 26 columns: topicTableColumn,
7 bordered: true, 27 bordered: true,
8 showTableSetting: true, 28 showTableSetting: true,