|
|
|
@ -37,7 +37,7 @@ export class DriverSelector extends BI.Widget {
|
|
|
|
|
watch = { |
|
|
|
|
driverClassItems: items => { |
|
|
|
|
this.customDrivers.populate(items); |
|
|
|
|
this.customDrivers.setValue(this.model.customDriver.driver); |
|
|
|
|
this.customDrivers.setValue(this.model.customDriver.value); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
driverManageEntryVisible: b => { |
|
|
|
@ -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'); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
@ -120,8 +123,8 @@ export class DriverSelector extends BI.Widget {
|
|
|
|
|
width: 204, |
|
|
|
|
watermark: BI.i18nText('Dec-Please_Input'), |
|
|
|
|
items: this.model.driverClassItems, |
|
|
|
|
value: this.model.customDriver.driver, |
|
|
|
|
text: () => this.model.customDriver.text || '', |
|
|
|
|
value: this.model.customDriver.value, |
|
|
|
|
text: () => this.model.customDriver.value || '', |
|
|
|
|
defaultText: BI.i18nText('Dec-Please_Select'), |
|
|
|
|
warningTitle: BI.i18nText('Dec-Dcm-Driver_Driver_File_Lost'), |
|
|
|
|
listeners: [ |
|
|
|
@ -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 { |
|
|
|
|