perf: 创建证书流水线时,支持更多参数展开

pull/361/head
xiaojunnuo 2025-03-17 00:06:03 +08:00
parent d01004d530
commit 36aa7f82b0
1 changed files with 19 additions and 3 deletions

View File

@ -10,6 +10,7 @@ export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOpt
const inputs: any = {}; const inputs: any = {};
const userStore = useUserStore(); const userStore = useUserStore();
const settingStore = useSettingStore(); const settingStore = useSettingStore();
const moreParams = [];
for (const plugin of certPlugins) { for (const plugin of certPlugins) {
for (const inputKey in plugin.input) { for (const inputKey in plugin.input) {
if (inputs[inputKey]) { if (inputs[inputKey]) {
@ -18,7 +19,8 @@ export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOpt
} }
const inputDefine = _.cloneDeep(plugin.input[inputKey]); const inputDefine = _.cloneDeep(plugin.input[inputKey]);
if (!inputDefine.required && !inputDefine.maybeNeed) { if (!inputDefine.required && !inputDefine.maybeNeed) {
continue; moreParams.push(inputKey);
// continue;
} }
useReference(inputDefine); useReference(inputDefine);
inputs[inputKey] = { inputs[inputKey] = {
@ -34,8 +36,12 @@ export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOpt
let inputDefineShow = true; let inputDefineShow = true;
if (inputDefine.show != null) { if (inputDefine.show != null) {
const computeShow = inputDefine.show as any; const computeShow = inputDefine.show as any;
if (computeShow === false) {
inputDefineShow = false;
} else if (computeShow && computeShow.computeFn) {
inputDefineShow = computeShow.computeFn({ form }); inputDefineShow = computeShow.computeFn({ form });
} }
}
return form?.certApplyPlugin === plugin.name && inputDefineShow; return form?.certApplyPlugin === plugin.name && inputDefineShow;
}) })
} }
@ -52,6 +58,15 @@ export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOpt
width: 1350, width: 1350,
saveRemind: false, saveRemind: false,
title: "创建证书流水线" title: "创建证书流水线"
},
group: {
groups: {
more: {
header: "更多参数",
columns: moreParams,
collapsed: true
}
}
} }
}, },
columns: { columns: {
@ -61,7 +76,8 @@ export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOpt
dict: dict({ dict: dict({
data: [ data: [
{ value: "CertApply", label: "JS-ACME" }, { value: "CertApply", label: "JS-ACME" },
{ value: "CertApplyLego", label: "Lego-ACME" } { value: "CertApplyLego", label: "Lego-ACME" },
{ value: "CertUpload", label: "上传自定义证书" }
] ]
}), }),
form: { form: {