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