Skip to content

Commit 7f09a22

Browse files
committed
feat: enhance copyTool function to load tool data asynchronously
--bug=1057318 --user=刘瑞斌 【工具】复制工具,工具内容没有复制到新的工具中 https://www.tapd.cn/62980211/s/1718332
1 parent d1fe600 commit 7f09a22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ui/src/views/tool/component/ToolListContainer.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,13 @@ function refresh(data?: any) {
453453
}
454454
}
455455
456-
function copyTool(row: any) {
456+
async function copyTool(row: any) {
457457
ToolDrawertitle.value = t('views.tool.copyTool')
458-
const obj = cloneDeep(row)
458+
const res = await loadSharedApi({ type: 'tool', systemType: apiType.value }).getToolById(
459+
row.id,
460+
changeStateloading,
461+
)
462+
const obj = cloneDeep(res.data)
459463
delete obj['id']
460464
obj['name'] = obj['name'] + ` ${t('views.tool.form.title.copy')}`
461465
ToolFormDrawerRef.value.open(obj)

0 commit comments

Comments
 (0)