Browse Source

fix: DEC-10168 驱动可以选择也可以新增

qufenxi
alan 5 years ago
parent
commit
f329911e80
  1. 23
      src/modules/pages/maintain/forms/components/form.jdbc.ts
  2. 2
      src/ui/fineui.ts

23
src/modules/pages/maintain/forms/components/form.jdbc.ts

@ -1,5 +1,5 @@
import { shortcut } from '@core/core';
import { Vertical, TextEditor, TextValueCombo, Label, TextAreaEditor, Editor, SingleSelectInsertCombo, Left, TextButton } from 'ui';
import { Vertical, TextEditor, TextValueCombo, Label, TextAreaEditor, Editor, EdirotIconCheckCombo, Left, TextButton } from 'ui';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { FormItemXtype } from '../../components/form_item/form_item';
import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings';
@ -85,29 +85,15 @@ export class FormJdbc extends BI.Widget {
type: FormItemXtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
forms: [{
type: SingleSelectInsertCombo,
type: EdirotIconCheckCombo,
width: 300,
value: driver,
ref: (_ref: any) => {
this.form.driver = _ref;
},
itemsCreator: (options: {
keywords?: string[],
selectedValues: string[],
times: number,
type: number,
}, callback: Function) => {
let drivers = this.getDrivers();
if (options.selectedValues.length > 0) {
drivers = drivers.filter(item => item.text !== options.selectedValues[0]);
}
callback({
items: drivers,
hasNext: false,
});
},
items: this.getDrivers(),
listeners: [{
eventName: BI.SingleSelectInsertCombo.EVENT_CONFIRM,
eventName: BI.EditorIconCheckCombo.EVENT_CHANGE,
action: () => {
const value = this.form.driver.getValue();
const connectionData = this.options.formData.connectionData as ConnectionJDBC;
@ -675,6 +661,7 @@ export class FormJdbc extends BI.Widget {
text: connectionData.driver,
value: connectionData.driver,
},
...drivers,
];
}

2
src/ui/fineui.ts

@ -51,7 +51,7 @@ export const BubbleCombo = 'bi.bubble_combo';
export const TextBubblePopupBarView = 'bi.text_bubble_bar_popup_view';
export const TextValueCombo = 'bi.text_value_combo';
export const Loader = 'bi.loader';
export const EdirotIconCheckCombo = 'bi.editor_icon_check_combo';
// 布局
export const VerticalAdapt = 'bi.vertical_adapt';
export const Vtape = 'bi.vtape';

Loading…
Cancel
Save