diff --git a/src/views/group/modules/group-detail-drawer.vue b/src/views/group/modules/group-detail-drawer.vue index 267ccfc..d05ae19 100644 --- a/src/views/group/modules/group-detail-drawer.vue +++ b/src/views/group/modules/group-detail-drawer.vue @@ -1,8 +1,8 @@ @@ -26,7 +51,17 @@ const visible = defineModel('visible', { {{ rowData?.groupName }} - {{ rowData?.token }} + + + + {{ $t('page.groupConfig.token') }} + + + + + + {{ rowData?.token }} + {{ $t(groupConfigStatusRecord[rowData?.groupStatus!]) }} diff --git a/src/views/group/modules/group-operate-drawer.vue b/src/views/group/modules/group-operate-drawer.vue index 4238938..c194f1b 100644 --- a/src/views/group/modules/group-operate-drawer.vue +++ b/src/views/group/modules/group-operate-drawer.vue @@ -3,8 +3,7 @@ import { computed, reactive, ref, watch } from 'vue'; import { useClipboard } from '@vueuse/core'; import { useFormRules, useNaiveForm } from '@/hooks/common/form'; import { $t } from '@/locales'; -import { translateOptions, translateOptions2 } from '@/utils/common'; -import { groupConfigIdModeOptions, groupConfigStatusOptions, groupConfigYesOrNoOptions } from '@/constants/business'; +import { groupConfigStatusOptions, groupConfigYesOrNoOptions } from '@/constants/business'; import { fetchAddGroupConfig, fetchEditGroupConfig, fetchGetPartitionTableList } from '@/service/api/group'; defineOptions({ @@ -173,7 +172,16 @@ async function handleCopy(source: string) { return; } - await copy(source); + if (navigator.clipboard && window.isSecureContext) { + await copy(source); + } else { + const range = document.createRange(); + range.selectNode(document.getElementById('tokenOperateInput')!); + const selection = window.getSelection(); + if (selection?.rangeCount) selection.removeAllRanges(); + selection?.addRange(range); + document.execCommand('copy'); + } window.$message?.success('复制成功'); } @@ -207,6 +215,7 @@ async function handleCopy(source: string) { @@ -135,6 +144,7 @@ async function handleCopy(source: string) {