From 7f09a225189b80a493a4444c6f0ec3a2db1bd708 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 25 Jun 2025 15:05:17 +0800 Subject: [PATCH] feat: enhance copyTool function to load tool data asynchronously MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1057318 --user=刘瑞斌 【工具】复制工具,工具内容没有复制到新的工具中 https://www.tapd.cn/62980211/s/1718332 --- ui/src/views/tool/component/ToolListContainer.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/views/tool/component/ToolListContainer.vue b/ui/src/views/tool/component/ToolListContainer.vue index 8d908604e..121375d0d 100644 --- a/ui/src/views/tool/component/ToolListContainer.vue +++ b/ui/src/views/tool/component/ToolListContainer.vue @@ -453,9 +453,13 @@ function refresh(data?: any) { } } -function copyTool(row: any) { +async function copyTool(row: any) { ToolDrawertitle.value = t('views.tool.copyTool') - const obj = cloneDeep(row) + const res = await loadSharedApi({ type: 'tool', systemType: apiType.value }).getToolById( + row.id, + changeStateloading, + ) + const obj = cloneDeep(res.data) delete obj['id'] obj['name'] = obj['name'] + ` ${t('views.tool.form.title.copy')}` ToolFormDrawerRef.value.open(obj)