Commit e9f6b26d4b7e26b630c45e4742abd6017c1e1cd9

Authored by ww
1 parent e277f683

feat: ota包仓库新增复制校验和

... ... @@ -71,9 +71,7 @@ export const columns: BasicColumn[] = [
71 71 {
72 72 title: '校验和',
73 73 dataIndex: PackageField.CHECK_SUM,
74   - format(text, record) {
75   - return text ? `${record[PackageField.CHECK_SUM_ALG]}: ${text.slice(0, 11)}` : '';
76   - },
  74 + slots: { customRender: PackageField.CHECK_SUM },
77 75 width: 120,
78 76 },
79 77 {
... ...
... ... @@ -11,9 +11,11 @@
11 11 import { useDrawer } from '/@/components/Drawer';
12 12 import { useMessage } from '/@/hooks/web/useMessage';
13 13 import { useDownload } from './hook/useDownload';
14   - import { computed } from 'vue';
  14 + import { computed, unref } from 'vue';
15 15 import { useSyncConfirm } from '/@/hooks/component/useSyncConfirm';
16 16 import { Authority } from '/@/components/Authority';
  17 + import Icon from '/@/components/Icon';
  18 + import { useClipboard } from '@vueuse/core';
17 19
18 20 const [register, { reload, getSelectRowKeys, getRowSelection, setSelectedRowKeys }] = useTable({
19 21 columns,
... ... @@ -100,6 +102,13 @@
100 102 reload();
101 103 } catch (error) {}
102 104 };
  105 +
  106 + const { copy, copied } = useClipboard({ legacy: true });
  107 + const handleCopy = (event: MouseEvent, text: string) => {
  108 + event.stopPropagation();
  109 + copy(text);
  110 + unref(copied) && createMessage.success('复制成功');
  111 + };
103 112 </script>
104 113
105 114 <template>
... ... @@ -115,6 +124,15 @@
115 124 </Button>
116 125 </Authority>
117 126 </template>
  127 + <template #checksum="{ text }">
  128 + <div
  129 + class="cursor-pointer flex gap-2 items-center"
  130 + @click="(event) => handleCopy(event, text)"
  131 + >
  132 + <div class="flex-auto truncate">{{ text }}</div>
  133 + <Icon v-if="text" icon="ant-design:copy-outlined" />
  134 + </div>
  135 + </template>
118 136 <template #action="{ record }">
119 137 <TableAction
120 138 @click.stop
... ...