From 7f84fa9b2360a4323388a1df718cb9d05685ac77 Mon Sep 17 00:00:00 2001 From: 3octaves <873551943@qq.com> Date: Wed, 12 Feb 2025 11:14:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E4=BC=98=E5=8C=96=E6=95=B4?= =?UTF-8?q?=E7=AB=99=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD=20#9221?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/cluster-selector/Index.vue | 8 ++-- .../components/db-member-selector/index.vue | 5 +-- .../src/components/editable-info/index.vue | 11 +---- .../components/host-preview/HostPreview.vue | 17 ++++--- .../common/preview-result/Index.vue | 8 ++-- .../src/components/ip-selector/IpSelector.vue | 13 ++++-- .../components/PreviewWhitelist.vue | 7 ++- .../src/components/tag-block/Index.vue | 2 +- .../src/hooks/useLinkQueryColumnSerach.ts | 3 ++ dbm-ui/frontend/src/locales/zh-cn.json | 7 +-- .../views/db-manage/common/RenderPassword.vue | 9 ++-- .../big-data-host-table/HdfsHostTable.vue | 9 ++-- .../big-data-host-table/RenderHostTable.vue | 9 ++-- .../es-host-table/index.vue | 9 ++-- .../components/RulesPreview.vue | 13 +++--- .../components/TargetInstances.vue | 9 ++-- .../common/cluster-ip-copy/Index.vue | 7 ++- .../common/cluster-role-status/Index.vue | 2 +- .../ClusterNameColumn.vue | 4 +- .../MasterDomainColumn.vue | 4 +- .../cluster-table-column/RoleColumn.vue | 1 + .../SlaveDomainColumn.vue | 16 ++----- .../components/base-role-column/Index.vue | 20 +++------ .../components/CellContent.vue | 14 +----- .../components/InstanceList.vue | 6 +-- .../hooks/useColumnCopy.ts | 5 +-- .../components/common/AccountCreate.vue | 8 ++-- .../common/render-head-copy/Index.vue | 3 +- .../common/render-instances/Instacelist.vue | 2 +- .../detail/components/node-list/Index.vue | 8 ++-- .../doris/list/components/list/Index.vue | 7 +++ .../detail/components/node-list/Index.vue | 15 ++++--- .../list/components/list/Index.vue | 7 +++ .../detail/components/node-list/Index.vue | 15 ++++--- .../hdfs/list/components/list/Index.vue | 7 +++ .../list/components/ClusterSettings.vue | 8 ++-- .../components/render-list/Index.vue | 45 +++++++++++-------- .../detail/components/node-list/Index.vue | 15 ++++--- .../kafka/list/components/list/Index.vue | 5 +++ .../mongodb/components/AccessEntry.vue | 9 ++-- .../components/list/Index.vue | 4 ++ .../components/list/Index.vue | 6 +++ .../list/components/render-shard/Index.vue | 11 ++--- .../mongodb/structure-instance/Index.vue | 12 +++-- .../components/instance-list/Index.vue | 16 ++++--- .../mysql/ha-cluster-list/components/List.vue | 7 +++ .../ha-instance-list/components/List.vue | 7 ++- .../single-cluster-list/components/List.vue | 4 ++ .../detail/components/node-list/Index.vue | 11 +++-- .../pulsar/list/components/list/Index.vue | 6 +++ .../list/components/ManagerPassword.vue | 9 ++-- .../cluster-ha-list/components/list/Index.vue | 6 +++ .../cluster-list/components/list/Index.vue | 6 +++ .../components/list/components/EntryPanel.vue | 7 ++- .../list/components/MasterSlaveRoleColume.vue | 7 +-- .../cluster-oprations/ClusterPassword.vue | 9 ++-- .../components/list/Index.vue | 7 ++- .../instance-list/components/list/Index.vue | 7 ++- .../components/detail/components/NodeList.vue | 11 +++-- .../riak/list/components/list/Index.vue | 4 ++ .../ha-cluster-list/components/List.vue | 6 +++ .../ha-instance-list/components/List.vue | 10 ++--- .../single-cluster-list/components/List.vue | 4 ++ .../cluster-list/components/list/Index.vue | 5 +++ .../list/components/MasterSlaveRoleColume.vue | 7 +-- .../list/components/RemoteRoleColumn.vue | 7 +-- .../instance-list/components/list/Index.vue | 10 ++--- .../result/components/head/Index.vue | 11 +++-- .../views/quick-search/components/Entry.vue | 7 +-- .../quick-search/components/Instance.vue | 7 ++- .../quick-search/components/ResourcePool.vue | 6 +-- .../resource-manage/dirty-machine/Index.vue | 12 +++-- .../resource-manage/pool/host-list/Index.vue | 6 +-- .../import-host/components/FormPanel.vue | 13 ++---- .../record/components/HostDetail.vue | 14 +++--- .../views/task-history/components/NodeLog.vue | 8 ++-- .../task-history/components/PreviewHost.vue | 11 +++-- .../components/RedisResultFiles.vue | 7 ++- .../components/UpdateResult.vue | 9 ++-- .../RenderInstance.vue | 8 ++-- .../components/RedisKeysExtractFile.vue | 7 +-- .../components/RenderTable.vue | 9 ++-- .../components/TargetCluster.vue | 26 ++++++----- .../task-info/com-factory/doris/Replace.vue | 21 ++++----- .../com-factory/elastic-search/Reboot.vue | 8 ++-- .../com-factory/elastic-search/Replace.vue | 21 ++++----- .../task-info/com-factory/hdfs/Reboot.vue | 8 ++-- .../task-info/com-factory/hdfs/Replace.vue | 21 ++++----- .../task-info/com-factory/kafka/Reboot.vue | 8 ++-- .../task-info/com-factory/kafka/Replace.vue | 21 ++++----- .../com-factory/mysql/ClientCloneRules.vue | 9 ++-- .../task-info/com-factory/pulsar/Reboot.vue | 8 ++-- .../task-info/com-factory/pulsar/Replace.vue | 21 ++++----- .../task-info/com-factory/riak/Reboot.vue | 7 ++- .../tendbCluster/ClientCloneRules.vue | 8 ++-- .../list/components/FileContent.vue | 7 ++- .../src/views/whitelist/list/Index.vue | 6 +-- 97 files changed, 452 insertions(+), 461 deletions(-) diff --git a/dbm-ui/frontend/src/components/cluster-selector/Index.vue b/dbm-ui/frontend/src/components/cluster-selector/Index.vue index afecd1dfc1..dbacf27623 100644 --- a/dbm-ui/frontend/src/components/cluster-selector/Index.vue +++ b/dbm-ui/frontend/src/components/cluster-selector/Index.vue @@ -156,11 +156,11 @@ import { getTendbsingleList } from '@services/source/tendbsingle'; import type { ListBase } from '@services/types'; - import { useCopy, useSelectorDialogWidth } from '@hooks'; + import { useSelectorDialogWidth } from '@hooks'; import { ClusterTypes } from '@common/const'; - import { messageWarn } from '@utils'; + import { execCopy, messageWarn } from '@utils'; import ResultPreview from './components/common/result-preview/Index.vue'; import type { SearchSelectList } from './components/common/SearchBar.vue'; @@ -232,7 +232,6 @@ }); const slots = useSlots(); - const copy = useCopy(); const { dialogWidth } = useSelectorDialogWidth(); const { t } = useI18n(); @@ -564,8 +563,7 @@ messageWarn(t('没有可复制集群')); return; } - - copy(copyValues.join('\n')); + execCopy(copyValues.join('\n'), t('复制成功,共n条', { n: copyValues.length })); }; const handleConfirm = () => { diff --git a/dbm-ui/frontend/src/components/db-member-selector/index.vue b/dbm-ui/frontend/src/components/db-member-selector/index.vue index d0188e148d..4762908626 100644 --- a/dbm-ui/frontend/src/components/db-member-selector/index.vue +++ b/dbm-ui/frontend/src/components/db-member-selector/index.vue @@ -46,7 +46,7 @@ import { getUserList } from '@services/source/user'; - import { useCopy } from '@hooks'; + import { execCopy } from '@utils'; const emits = defineEmits<{ (e: 'change', value: string[]): void; @@ -57,7 +57,6 @@ }); const { t } = useI18n(); - const copy = useCopy(); const userSelectorRef = ref(); const isHover = ref(false); @@ -133,7 +132,7 @@ }; const handleCopy = () => { - copy(modelValue.value.join(';')); + execCopy(modelValue.value.join(';'), t('复制成功,共n条', { n: modelValue.value.length })); }; diff --git a/dbm-ui/frontend/src/components/editable-info/index.vue b/dbm-ui/frontend/src/components/editable-info/index.vue index 408a20cfc5..e0a20c401c 100644 --- a/dbm-ui/frontend/src/components/editable-info/index.vue +++ b/dbm-ui/frontend/src/components/editable-info/index.vue @@ -76,7 +76,7 @@ + @click.stop="execCopy(data[config.key], t('复制成功,共n条', { n: 1 }))" /> @@ -88,9 +88,7 @@