From 3e00c06766b094301f50afd89910f8ce638bb74e Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 27 Jun 2024 15:44:27 +0800 Subject: [PATCH] perf: change dumplidate title to -dumplicate --- src/layout/components/GenericCreateUpdateForm/index.vue | 8 +++++++- src/layout/components/TabPage/index.vue | 2 +- src/views/assets/Platform/PlatformCreateUpdate.vue | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/layout/components/GenericCreateUpdateForm/index.vue b/src/layout/components/GenericCreateUpdateForm/index.vue index 2c014a6c6..63a1c759d 100644 --- a/src/layout/components/GenericCreateUpdateForm/index.vue +++ b/src/layout/components/GenericCreateUpdateForm/index.vue @@ -123,6 +123,12 @@ export default { return method === 'post' ? this.createSuccessNextRoute : this.updateSuccessNextRoute } }, + cloneNameSuffix: { + type: String, + default: function() { + return this.$t('Duplicate').toLowerCase() + } + }, // 获取提交的方法 submitMethod: { type: [Function, String], @@ -366,7 +372,7 @@ export default { name = object['hostname'] attr = 'hostname' } - object[attr] = name + ' ' + this.$t('Duplicate') + object[attr] = name + '-' + this.cloneNameSuffix } else { object = await this.getObjectDetail(this.iUrl) } diff --git a/src/layout/components/TabPage/index.vue b/src/layout/components/TabPage/index.vue index e3077fa65..9416c9632 100644 --- a/src/layout/components/TabPage/index.vue +++ b/src/layout/components/TabPage/index.vue @@ -156,7 +156,7 @@ export default { ] for (const preTab of preActiveTabs) { - const currentTab = typeof preTab === 'object' ? preTab?.name : preTab + const currentTab = typeof preTab === 'object' ? preTab?.name || '' : preTab for (const tabName of this.tabIndices) { const currentTabName = tabName?.name || '' if (currentTab?.toLowerCase() === currentTabName?.toLowerCase()) { diff --git a/src/views/assets/Platform/PlatformCreateUpdate.vue b/src/views/assets/Platform/PlatformCreateUpdate.vue index 42e5315ee..097e95a54 100644 --- a/src/views/assets/Platform/PlatformCreateUpdate.vue +++ b/src/views/assets/Platform/PlatformCreateUpdate.vue @@ -4,6 +4,7 @@ :after-get-form-value="afterGetFormValue" :after-get-remote-meta="handleAfterGetRemoteMeta" :clean-form-value="cleanFormValue" + :clone-name-suffix="1" :fields="fields" :fields-meta="fieldsMeta" :has-detail-in-msg="false"