diff --git a/frontend/package.json b/frontend/package.json index e81da8f36e..be38d5831b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -42,7 +42,7 @@ } }, "dependencies": { - "@blueking/bkui-form": "^0.0.42-beta.14", + "@blueking/bkui-form": "^0.0.42-beta.15", "@blueking/crypto-js-sdk": "0.0.4", "@blueking/ip-selector": "0.2.0-beta", "@blueking/login-modal": "^1.0.1", diff --git a/frontend/src/components/RussianDolls/create.ts b/frontend/src/components/RussianDolls/create.ts index be77092cf0..7c269afa07 100644 --- a/frontend/src/components/RussianDolls/create.ts +++ b/frontend/src/components/RussianDolls/create.ts @@ -199,7 +199,7 @@ export const transformSchema = (schema: any, parentRequired: any[] = [], key: st prop['minItems'] = 1; prop['ui:group'] = { "props": { - "verifiable": true, + "verifiable": false, }, }; } @@ -232,13 +232,19 @@ export const transformSchema = (schema: any, parentRequired: any[] = [], key: st if (schema.required !== undefined) { delete schema.required; // 删除数组项中的 required } + // 不展示组校验 + schema['ui:group'] = { + "props": { + "verifiable": false, + }, + }; + // 添加样式修改 + schema['ui:props'] = { + "size": 'large' + }; // 处理描述信息 if (schema.description) { - schema['ui:group'] = { - "props": { - "description": schema.description, - }, - }; + schema['ui:group']['props']['description'] = schema.description; } if (schema.items.properties && Object.keys(schema.items.properties).length >= 2) { // 如果是 key 和 value,添加 ui:component @@ -255,7 +261,7 @@ export const transformSchema = (schema: any, parentRequired: any[] = [], key: st }; } if (schema.items.type === 'string' || schema.items.type === 'boolean' || schema.items.type === 'integer') { - parentRequired.push(key); + // parentRequired.push(key); } } diff --git a/frontend/src/components/common/key-value.vue b/frontend/src/components/common/key-value.vue new file mode 100644 index 0000000000..661057e280 --- /dev/null +++ b/frontend/src/components/common/key-value.vue @@ -0,0 +1,199 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/i18n/en.js b/frontend/src/i18n/en.js index fb9326624c..24d6201c32 100644 --- a/frontend/src/i18n/en.js +++ b/frontend/src/i18n/en.js @@ -845,6 +845,7 @@ export default { 选择版本: 'Choose version', '静态 - IP 选择': 'Static-IP selection', '动态 - 拓扑选择': 'Dynamic-Topo selection', + 添加: 'Add', 已部署: 'Deployed', 全部主机: 'All hosts', 搜索拓扑节点: 'Search topology node', diff --git a/frontend/src/i18n/zh.js b/frontend/src/i18n/zh.js index 6a1b0f2b0c..1701219008 100644 --- a/frontend/src/i18n/zh.js +++ b/frontend/src/i18n/zh.js @@ -839,6 +839,7 @@ export default { 升级版本: '升级版本', 升级目标: '升级目标', 参数配置: '参数配置', + 添加: '添加', 执行预览: '执行预览', 部署目标: '部署目标', 部署版本: '部署版本', diff --git a/frontend/src/views/plugin/plugin-rule/plugin-rule-create/params-config.vue b/frontend/src/views/plugin/plugin-rule/plugin-rule-create/params-config.vue index ecfc878485..46f67ba7d1 100644 --- a/frontend/src/views/plugin/plugin-rule/plugin-rule-create/params-config.vue +++ b/frontend/src/views/plugin/plugin-rule/plugin-rule-create/params-config.vue @@ -264,9 +264,14 @@ import { pluginOperate } from '../../operateConfig'; import bus from '@/common/bus'; import createForm from '@blueking/bkui-form'; import '@blueking/bkui-form/dist/bkui-form.css'; -import { transformSchema } from '@/components/RussianDolls/create' +import { transformSchema } from '@/components/RussianDolls/create'; +import keyValue from '@/components/common/key-value'; -const BKUIFrom = createForm() +const BKUIFrom = createForm({ + components: { + bfArray: keyValue + } +}) interface IVariables { title: string @@ -613,11 +618,10 @@ export default class ParamsConfig extends Vue { // 检查表单 public async handleValidateForm() { - // const validateRes: boolean[] = []; - // bus.$emit('validate', (result: boolean) => { - // validateRes.push(result); - // }); - // if(validateRes.some(res => !res)) return true; + const validateRes: boolean[] = []; + bus.$emit('validate', (result: boolean) => { + validateRes.push(result); + }); // const checkList: Promise[] = []; // this.list.forEach((item: IParamsConfig) => { @@ -642,11 +646,10 @@ export default class ParamsConfig extends Vue { // resolve(true); // }); // }); - const validRes: boolean[] = []; (this.$refs.bkuiFormRef as Array)?.forEach((item: any) => { - validRes.push(item.validateForm()); + validateRes.push(item.validateForm()); }) - return validRes.some(valid => !valid); + return validateRes.some(valid => !valid); } // 更新策略的 params 和 configs 属性