diff --git a/frontend/src/views/app-store/detail/index.vue b/frontend/src/views/app-store/detail/index.vue index 62a611fe0..761ce4f74 100644 --- a/frontend/src/views/app-store/detail/index.vue +++ b/frontend/src/views/app-store/detail/index.vue @@ -54,7 +54,6 @@ show-icon :closable="false" /> - diff --git a/frontend/src/views/app-store/detail/install/index.vue b/frontend/src/views/app-store/detail/install/index.vue index 21613d928..85b55a900 100644 --- a/frontend/src/views/app-store/detail/install/index.vue +++ b/frontend/src/views/app-store/detail/install/index.vue @@ -2,13 +2,18 @@ - + @@ -30,7 +35,7 @@ import { App } from '@/api/interface/app'; import { InstallApp } from '@/api/modules/app'; import { Rules } from '@/global/form-rules'; import { FormInstance, FormRules } from 'element-plus'; -import { nextTick, reactive, ref } from 'vue'; +import { reactive, ref } from 'vue'; import { useRouter } from 'vue-router'; import Params from '../params/index.vue'; const router = useRouter(); @@ -61,22 +66,16 @@ const handleClose = () => { resetForm(); }; -const opened = () => { - nextTick(() => { - if (paramForm.value) { - paramForm.value.clearValidate(); - } - }); -}; - const resetForm = () => { if (paramForm.value) { + paramForm.value.clearValidate(); paramForm.value.resetFields(); } }; const acceptParams = (props: InstallRrops): void => { installData.value = props; + resetForm(); open.value = true; }; diff --git a/frontend/src/views/app-store/detail/params/index.vue b/frontend/src/views/app-store/detail/params/index.vue index 516a63ab1..6f6096482 100644 --- a/frontend/src/views/app-store/detail/params/index.vue +++ b/frontend/src/views/app-store/detail/params/index.vue @@ -91,7 +91,6 @@ const updateParam = () => { const handleParams = () => { rules = props.rules; - if (params.value != undefined && params.value.formFields != undefined) { for (const p of params.value.formFields) { const pObj = p; @@ -129,7 +128,11 @@ const getServices = async (envKey: string, key: string | undefined, pObj: ParamO form[envKey] = res.data[0].value; if (res.data[0].config) { Object.entries(res.data[0].config).forEach(([k, v]) => { - form[k] = v; + params.value.formFields.forEach((field) => { + if (field.envKey === k) { + form[k] = v; + } + }); }); } updateParam(); @@ -141,7 +144,9 @@ const changeService = (value: string, services: App.AppService[]) => { services.forEach((item) => { if (item.value === value) { Object.entries(item.config).forEach(([k, v]) => { - form[k] = v; + if (form.hasOwnProperty(k)) { + form[k] = v; + } }); } });