From 2fe6cb37e678b8773b228614db45a193bf1b7e9e Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Tue, 27 Feb 2024 16:55:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90=E8=B5=84=E4=BA=A7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=91=E8=B5=84=E4=BA=A7=E8=AF=A6=E6=83=85=E4=B8=AD?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E8=B4=A6=E5=8F=B7=EF=BC=8C=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=9C=AA=E8=8E=B7=E5=8F=96=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Apps/AccountCreateUpdateForm/const.js | 9 +++++---- src/views/assets/Platform/AutomationParamsSetting.vue | 7 +++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/Apps/AccountCreateUpdateForm/const.js b/src/components/Apps/AccountCreateUpdateForm/const.js index cb3fac519..f9a481ffa 100644 --- a/src/components/Apps/AccountCreateUpdateForm/const.js +++ b/src/components/Apps/AccountCreateUpdateForm/const.js @@ -165,15 +165,16 @@ export const accountFieldsMeta = (vm) => { params: { label: vm.$t('assets.PushParams'), component: AutomationParamsForm, - el: { - method: vm.asset?.auto_config?.push_account_method - }, + el: {}, hidden: (formValue) => { const automation = vm.iPlatform.automation || {} + vm.fieldsMeta.params.el.method = vm.iPlatform.automation.push_account_method + vm.fieldsMeta.params.el.pushAccountParams = vm.iPlatform.automation.push_account_params return !formValue.push_now || !automation.push_account_enabled || !automation.ansible_enabled || - (formValue.secret_type === 'ssh_key' && vm.iPlatform.type.value === 'windows') || + (formValue.secret_type === 'ssh_key' && + vm.iPlatform.type.value === 'windows') || !vm.$hasPerm('accounts.push_account') || vm.addTemplate } diff --git a/src/views/assets/Platform/AutomationParamsSetting.vue b/src/views/assets/Platform/AutomationParamsSetting.vue index d3294fb8b..ff37eb74d 100644 --- a/src/views/assets/Platform/AutomationParamsSetting.vue +++ b/src/views/assets/Platform/AutomationParamsSetting.vue @@ -70,6 +70,10 @@ export default { type: String, default: '' }, + pushAccountParams: { + type: Object, + default: () => ({}) + }, visible: { type: Boolean, default: false @@ -135,6 +139,7 @@ export default { fieldsMeta: {} } + const param = this.pushAccountParams[method] if (Object.keys(filterField?.children || {}).length > 0) { for (const [k, v] of Object.entries(filterField.children)) { let component = 'el-input' @@ -143,6 +148,8 @@ export default { component = DynamicInput break } + + v.default = param[k] || v.default const item = { ...v, component: component } fieldsMeta[method].fields.push(k) fieldsMeta[method].fieldsMeta[k] = item