diff --git a/packages/ui/certd-client/src/components/plugins/common/remote-select.vue b/packages/ui/certd-client/src/components/plugins/common/remote-select.vue index 15b315a1e..029697ca5 100644 --- a/packages/ui/certd-client/src/components/plugins/common/remote-select.vue +++ b/packages/ui/certd-client/src/components/plugins/common/remote-select.vue @@ -79,6 +79,17 @@ const getPluginType: any = inject("get:plugin:type", () => { return "plugin"; }); +function getInputFromForm(form: any, pluginType: string) { + let input: any = {}; + if (pluginType === "plugin") { + input = form?.input || {}; + } else if (pluginType === "access") { + input = form?.access || {}; + } else { + input = form || {}; + } + return input; +} const searchKeyRef = ref(""); const optionsRef = ref([]); const message = ref(""); @@ -104,7 +115,7 @@ const getOptions = async () => { } const pluginType = getPluginType(); const { form } = getScope(); - const input = (pluginType === "plugin" ? form?.input : form) || {}; + const input = getInputFromForm(form, pluginType); for (let key in define.input) { const inWatches = props.watches?.includes(key); @@ -200,7 +211,7 @@ watch( () => { const pluginType = getPluginType(); const { form, key } = getScope(); - const input = (pluginType === "plugin" ? form?.input : form) || {}; + const input = getInputFromForm(form, pluginType); const watches: any = {}; if (props.watches && props.watches.length > 0) { for (const key of props.watches) {