Browse Source

fix: 去掉不该存在的参数

pull/89/head
zhengkunwang223 2 years ago committed by zhengkunwang223
parent
commit
6281905a55
  1. 1
      frontend/src/views/app-store/detail/index.vue
  2. 23
      frontend/src/views/app-store/detail/install/index.vue
  3. 11
      frontend/src/views/app-store/detail/params/index.vue

1
frontend/src/views/app-store/detail/index.vue

@ -54,7 +54,6 @@
show-icon
:closable="false"
/>
<!-- <span v-if="!appDetail.enable">{{ $t('app.limitHelper') }}</span> -->
</div>
</div>
</el-col>

23
frontend/src/views/app-store/detail/install/index.vue

@ -2,13 +2,18 @@
<el-dialog
v-model="open"
:title="$t('app.install')"
:destroy-on-close="true"
:close-on-click-modal="false"
width="40%"
:before-close="handleClose"
@opened="opened"
>
<el-form ref="paramForm" label-position="left" :model="form" label-width="150px" :rules="rules">
<el-form
ref="paramForm"
label-position="left"
:model="form"
label-width="150px"
:rules="rules"
:validate-on-rule-change="false"
>
<el-form-item :label="$t('app.name')" prop="NAME">
<el-input v-model="form['NAME']"></el-input>
</el-form-item>
@ -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;
};

11
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;
}
});
}
});

Loading…
Cancel
Save