From 03d1e9a881ebf6fee3549db76cc31ea83aa8f3d0 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:00:51 +0800 Subject: [PATCH] Fixed: Fix the issue of losing the automation status when cloning the platform list. (#4951) * Fixed: Fix the issue of losing the automation status when cloning the platform list. * Fixed: Remove console --------- Co-authored-by: zhaojisen <1301338853@qq.com> --- .../assets/Platform/PlatformCreateUpdate.vue | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/views/assets/Platform/PlatformCreateUpdate.vue b/src/views/assets/Platform/PlatformCreateUpdate.vue index 2c36117e9..e04b7bdef 100644 --- a/src/views/assets/Platform/PlatformCreateUpdate.vue +++ b/src/views/assets/Platform/PlatformCreateUpdate.vue @@ -60,23 +60,20 @@ export default { url: `/api/v1/assets/platforms/`, cleanFormValue: (values) => { const protocols = values['protocols'] || [] - const query = this.$route.query || {} const automation = values['automation'] || {} const category_type = values['category_type'] const ansibleConfig = automation?.['ansible_config'] || {} automation.ansible_config = ansibleConfig instanceof Object ? ansibleConfig : JSON.parse(ansibleConfig) - if (query.hasOwnProperty('_clone_from')) { - if (automation.hasOwnProperty('id')) { - delete automation['id'] - } - values['protocols'] = protocols.map(i => { - if (i.hasOwnProperty('id')) { - delete i['id'] - } - return i - }) + if (automation.hasOwnProperty('id')) { + delete automation['id'] } + values['protocols'] = protocols.map(i => { + if (i.hasOwnProperty('id')) { + delete i['id'] + } + return i + }) values['category'] = category_type[0] values['type'] = category_type[1] return values