diff --git a/src/modules/pages/maintain/components/driverselector/driverselector.ts b/src/modules/pages/maintain/components/driverselector/driverselector.ts index c155878..0bb502c 100644 --- a/src/modules/pages/maintain/components/driverselector/driverselector.ts +++ b/src/modules/pages/maintain/components/driverselector/driverselector.ts @@ -76,12 +76,15 @@ export class DriverSelector extends BI.Widget { if (value === 'default') { this.defaultDrivers.setVisible(true); this.customDrivers.setVisible(false); - + this.fireEvent('EVENT_CHANGE'); return; } this.defaultDrivers.setVisible(false); this.customDrivers.setVisible(true); + if (BI.isKey(this.customDrivers.getValue()[0])) { + this.fireEvent('EVENT_CHANGE'); + } }, }, ], @@ -136,71 +139,29 @@ export class DriverSelector extends BI.Widget { }, }, { el: { - type: BI.Button.xtype, + type: 'dec.connection.driver.entry', ref: (_ref: Button) => { this.driverManageEntry = _ref; }, - level: 'ignore', - text: BI.i18nText('Dec-Dcm_Create_New_Driver'), - invisible: !this.model.driverManageEntryVisible, - handler: () => { - this.createDriverManagerLayer(); + el: { + type: BI.Button.xtype, + level: 'ignore', + text: BI.i18nText('Dec-Dcm_Create_New_Driver'), }, - }, - }, - ], - }; - } - - private createDriverManagerLayer() { - const name = BI.UUID(); - - BI.Layers.create(name, '.dec-dcm', { - render: { - type: 'bi.vtape', - cls: 'bi-background', - items: [ - { - type: 'bi.vertical_adapt', - cls: 'bi-card', - items: [ + from: '.dec-dcm', + invisible: !this.model.driverManageEntryVisible, + listeners: [ { - el: { - type: 'bi.icon_text_item', - text: BI.i18nText('Dec-Connection_Driver_Management_Exit'), - cls: 'back-font bi-high-light', - height: 24, - logic: { - dynamic: true, - }, - handler: () => { - this.store.initDriverClassList(() => BI.Layers.remove(name)); - }, + eventName: 'EVENT_CLOSE', + action: () => { + this.store.initDriverClassList(BI.emptyFn); }, - hgap: 10, }, ], - height: 40, - }, { - el: { - type: 'dec.connection.driver', - listeners: [ - { - eventName: 'EVENT_CLOSE', - action() { - BI.Layers.remove(name); - }, - }, - ], - }, - hgap: 10, - vgap: 10, }, - ], - }, - }); - - BI.Layers.show(name); + }, + ], + }; } validation(): boolean {