feat: update copyTool function to fetch tool data asynchronously

This commit is contained in:
CaptainB 2025-06-24 10:13:41 +08:00
parent 7f9caca5c7
commit 4001d0cded

View File

@ -478,9 +478,10 @@ function refresh(data?: any) {
getList()
}
function copyTool(row: any) {
async function copyTool(row: any) {
ToolDrawertitle.value = t('views.tool.copyTool')
const obj = cloneDeep(row)
const res = await ToolApi.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)