import { shortcut } from '@core/core'; import { Connection } from 'src/modules/crud/crud.typings'; import { getPluginWidgetEdit } from '../../../../app.service'; export const FormPluginXtype = 'dec.dcm.maintain_plugin'; @shortcut(FormPluginXtype) export class FormPlugin extends BI.Widget { props = { formData: {} as Connection, } plugin: any; render() { const { connectionType } = this.options.formData; return { type: getPluginWidgetEdit(connectionType), ref: (_ref: any) => { this.plugin = _ref; }, formData: this.options.formData.connectionData, }; } public getSubmitValue(): Connection { const { connectionType, connectionId, connectionName } = this.options.formData; return { connectionId, connectionType, connectionName, connectionData: this.plugin.getSubmitValue(), }; } }