From 06b0b748a722ded3b2eb8409aad92d2557935b67 Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 30 Jan 2023 16:24:19 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=97=B6=20ansible=5Fconfig=20=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=BC=A0=E9=80=92=20dict=20=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormFields/JsonEditor.vue | 4 ++-- src/views/assets/Platform/const.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/FormFields/JsonEditor.vue b/src/components/FormFields/JsonEditor.vue index 44460065f..dcb36a4f8 100644 --- a/src/components/FormFields/JsonEditor.vue +++ b/src/components/FormFields/JsonEditor.vue @@ -38,10 +38,10 @@ export default { }, // 保存 onJsonSave(value) { - this.resultInfo = value + this.resultInfo = typeof value === 'string' ? JSON.parse(value) : value this.hasJsonFlag = true setTimeout(() => { - this.$emit('change', JSON.stringify(this.resultInfo)) + this.$emit('change', this.resultInfo) }, 500) }, onError: _.debounce(function(value) { diff --git a/src/views/assets/Platform/const.js b/src/views/assets/Platform/const.js index ab69d3223..14a7ebd51 100644 --- a/src/views/assets/Platform/const.js +++ b/src/views/assets/Platform/const.js @@ -81,7 +81,7 @@ export const setAutomations = (vm) => { const initial = vm.initial.automation || {} initial['ansible_enabled'] = automation['ansible_enabled'] - initial['ansible_config'] = JSON.stringify(automation['ansible_config']) + initial['ansible_config'] = automation['ansible_config'] if (initial['ansible_enabled'] === false) { _.set(autoFieldsMeta, `ansible_enabled.el.disabled`, true)