1
|
<script lang="ts" setup>
|
1
|
<script lang="ts" setup>
|
2
|
import { BasicTable, useTable } from '/@/components/Table';
|
2
|
import { BasicTable, useTable } from '/@/components/Table';
|
3
|
import { list, topicTableColumn } from './topic';
|
3
|
import { list, topicTableColumn } from './topic';
|
|
|
4
|
+ import { unref } from 'vue';
|
|
|
5
|
+ import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
|
6
|
+ import { useMessage } from '/@/hooks/web/useMessage';
|
4
|
|
7
|
|
|
|
8
|
+ const { createMessage } = useMessage();
|
5
|
const [register] = useTable({
|
9
|
const [register] = useTable({
|
6
|
title: 'Topic',
|
10
|
title: 'Topic',
|
7
|
showIndexColumn: false,
|
11
|
showIndexColumn: false,
|
|
@@ -10,10 +14,51 @@ |
|
@@ -10,10 +14,51 @@ |
10
|
bordered: true,
|
14
|
bordered: true,
|
11
|
showTableSetting: true,
|
15
|
showTableSetting: true,
|
12
|
});
|
16
|
});
|
|
|
17
|
+ const handeleCopy = (e) => {
|
|
|
18
|
+ const { isSuccessRef } = useCopyToClipboard(JSON.parse(JSON.stringify(unref(e), null, 2)));
|
|
|
19
|
+ unref(isSuccessRef);
|
|
|
20
|
+ createMessage.success('复制成功!');
|
|
|
21
|
+ };
|
13
|
</script>
|
22
|
</script>
|
14
|
|
23
|
|
15
|
<template>
|
24
|
<template>
|
16
|
<section class="bg-gray-100 p-4 dark:bg-dark-900 w-full h-full">
|
25
|
<section class="bg-gray-100 p-4 dark:bg-dark-900 w-full h-full">
|
17
|
- <BasicTable @register="register" />
|
26
|
+ <BasicTable @register="register">
|
|
|
27
|
+ <template #function="{ record }">
|
|
|
28
|
+ <a-tooltip :title="record.function">
|
|
|
29
|
+ <a-button type="text" class="ml-2" @click="handeleCopy(record.function)">
|
|
|
30
|
+ <span>{{ record.function.slice(0, 13) }}</span>
|
|
|
31
|
+ </a-button>
|
|
|
32
|
+ </a-tooltip>
|
|
|
33
|
+ </template>
|
|
|
34
|
+ <template #release="{ record }">
|
|
|
35
|
+ <a-tooltip :title="record.release">
|
|
|
36
|
+ <a-button type="text" class="ml-2" @click="handeleCopy(record.release)">
|
|
|
37
|
+ <span>{{ record.release.slice(0, 30) }}</span>
|
|
|
38
|
+ </a-button>
|
|
|
39
|
+ </a-tooltip>
|
|
|
40
|
+ </template>
|
|
|
41
|
+ <template #subscribe="{ record }">
|
|
|
42
|
+ <a-tooltip :title="record.subscribe">
|
|
|
43
|
+ <a-button type="text" class="ml-2" @click="handeleCopy(record.subscribe)">
|
|
|
44
|
+ <span>{{ record.subscribe.slice(0, 30) }}</span>
|
|
|
45
|
+ </a-button>
|
|
|
46
|
+ </a-tooltip>
|
|
|
47
|
+ </template>
|
|
|
48
|
+ <template #platform="{ record }">
|
|
|
49
|
+ <a-tooltip :title="record.platform">
|
|
|
50
|
+ <a-button type="text" class="ml-2" @click="handeleCopy(record.platform)">
|
|
|
51
|
+ <span>{{ record.platform }}</span>
|
|
|
52
|
+ </a-button>
|
|
|
53
|
+ </a-tooltip>
|
|
|
54
|
+ </template>
|
|
|
55
|
+ <template #device="{ record }">
|
|
|
56
|
+ <a-tooltip :title="record.device">
|
|
|
57
|
+ <a-button type="text" class="ml-2" @click="handeleCopy(record.device)">
|
|
|
58
|
+ <span>{{ record.device }}</span>
|
|
|
59
|
+ </a-button>
|
|
|
60
|
+ </a-tooltip>
|
|
|
61
|
+ </template>
|
|
|
62
|
+ </BasicTable>
|
18
|
</section>
|
63
|
</section>
|
19
|
</template> |
64
|
</template> |