|
|
@ -1,8 +1,9 @@ |
|
|
|
import { shortcut, store } from '@core/core'; |
|
|
|
import { shortcut, store } from '@core/core'; |
|
|
|
import { VtapeXtype, HtapeXtype, IconButtonXtype, TextValueComboXtype, ButtonXtype, TextEditorXtype, ButtonGroupXtype, VerticalXtype } from 'ui'; |
|
|
|
import { VtapeXtype, HtapeXtype, LabelXtype, IconButtonXtype, TextValueComboXtype, ButtonXtype, TextEditorXtype, ButtonGroupXtype, VerticalXtype } from 'ui'; |
|
|
|
import { ListItem } from './list_item'; |
|
|
|
import { ListItem } from './list_item'; |
|
|
|
import { TableModelModel } from './table_list.model'; |
|
|
|
import { TableModelModel } from './table_list.model'; |
|
|
|
import { fineServletURL } from '@constants/env'; |
|
|
|
import { fineServletURL } from '@constants/env'; |
|
|
|
|
|
|
|
import { DatabaseIndex } from '../components/database_index/database_index'; |
|
|
|
|
|
|
|
|
|
|
|
@shortcut() |
|
|
|
@shortcut() |
|
|
|
@store(TableModelModel) |
|
|
|
@store(TableModelModel) |
|
|
@ -12,12 +13,18 @@ export class TableList extends BI.Widget { |
|
|
|
store: TableModelModel['store'] |
|
|
|
store: TableModelModel['store'] |
|
|
|
model: TableModelModel['model'] |
|
|
|
model: TableModelModel['model'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
databaseIndex: DatabaseIndex; |
|
|
|
buttonGroup: any; |
|
|
|
buttonGroup: any; |
|
|
|
connectionTextValue: any; |
|
|
|
connectionTextValue: any; |
|
|
|
searchText: any; |
|
|
|
searchText: any; |
|
|
|
|
|
|
|
|
|
|
|
props = { |
|
|
|
props = { |
|
|
|
database: '', |
|
|
|
database: '', |
|
|
|
|
|
|
|
value: { |
|
|
|
|
|
|
|
datasetData: { |
|
|
|
|
|
|
|
orderValue: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
watch = { |
|
|
|
watch = { |
|
|
@ -27,7 +34,7 @@ export class TableList extends BI.Widget { |
|
|
|
this.connectionTextValue.setValue(name); |
|
|
|
this.connectionTextValue.setValue(name); |
|
|
|
this.store.setSelectedConnection(name); |
|
|
|
this.store.setSelectedConnection(name); |
|
|
|
}, |
|
|
|
}, |
|
|
|
'selectedConnection || search': () => { |
|
|
|
'selectedConnection || search || orderValue': () => { |
|
|
|
this.store.initTableList(); |
|
|
|
this.store.initTableList(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
tables: (tables: string[]) => { |
|
|
|
tables: (tables: string[]) => { |
|
|
@ -36,6 +43,9 @@ export class TableList extends BI.Widget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
|
|
|
|
const { orderValue = 0 } = this.options.value.datasetData || {}; |
|
|
|
|
|
|
|
const inputType = typeof orderValue === 'string' ? 'formula' : 'int'; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
type: VtapeXtype, |
|
|
|
type: VtapeXtype, |
|
|
|
hgap: 10, |
|
|
|
hgap: 10, |
|
|
@ -83,6 +93,22 @@ export class TableList extends BI.Widget { |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: HtapeXtype, |
|
|
|
type: HtapeXtype, |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
type: LabelXtype, |
|
|
|
|
|
|
|
text: BI.i18nText('Plugin-Redis_Index'), |
|
|
|
|
|
|
|
textAlign: 'left', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
width: 24, |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
type: DatabaseIndex.xtype, |
|
|
|
|
|
|
|
value: orderValue, |
|
|
|
|
|
|
|
inputType, |
|
|
|
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
|
|
|
this.databaseIndex = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
width: 24, |
|
|
|
|
|
|
|
height: 22, |
|
|
|
|
|
|
|
}, { |
|
|
|
type: TextEditorXtype, |
|
|
|
type: TextEditorXtype, |
|
|
|
height: 24, |
|
|
|
height: 24, |
|
|
|
watermark: BI.i18nText('Plugin-Redis_Keys_Pattern'), |
|
|
|
watermark: BI.i18nText('Plugin-Redis_Keys_Pattern'), |
|
|
@ -95,7 +121,7 @@ export class TableList extends BI.Widget { |
|
|
|
minWidth: 50, |
|
|
|
minWidth: 50, |
|
|
|
text: BI.i18nText('Plugin-Redis_Keys_Pattern_Search'), |
|
|
|
text: BI.i18nText('Plugin-Redis_Keys_Pattern_Search'), |
|
|
|
handler: () => { |
|
|
|
handler: () => { |
|
|
|
this.store.setSearch(this.searchText.getValue()); |
|
|
|
this.store.setSearch(this.searchText.getValue(), this.databaseIndex.getValue()); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
width: 50, |
|
|
|
width: 50, |
|
|
|