|
|
@ -1,5 +1,5 @@ |
|
|
|
import { shortcut, store } from '@core/core'; |
|
|
|
import { shortcut, store } from '@core/core'; |
|
|
|
import { VerticalXtype, HtapeXtype, LabelXtype, IconComboXtype, TextValueComboXtype, CodeEditorXtype, ComponentsStyleTable, ButtonXtype, IconTextValue_Combo } from 'ui'; |
|
|
|
import { VerticalXtype, HtapeXtype, LabelXtype, IconComboXtype, TextValueComboXtype, TextAreaEditorXtype, ComponentsStyleTable, ButtonXtype, IconTextValue_Combo } from 'ui'; |
|
|
|
import { TableList } from './table_list/table_list'; |
|
|
|
import { TableList } from './table_list/table_list'; |
|
|
|
import '../less/index.less'; |
|
|
|
import '../less/index.less'; |
|
|
|
import { DatabaseIndex } from './components/database_index/database_index'; |
|
|
|
import { DatabaseIndex } from './components/database_index/database_index'; |
|
|
@ -29,7 +29,7 @@ export class RedisProgram extends BI.Widget { |
|
|
|
value: { |
|
|
|
value: { |
|
|
|
datasetData: { |
|
|
|
datasetData: { |
|
|
|
database: '', |
|
|
|
database: '', |
|
|
|
orderValue: '0', |
|
|
|
orderValue: 0, |
|
|
|
script: '', |
|
|
|
script: '', |
|
|
|
engineType: 0, |
|
|
|
engineType: 0, |
|
|
|
parameters: [], |
|
|
|
parameters: [], |
|
|
@ -41,14 +41,15 @@ export class RedisProgram extends BI.Widget { |
|
|
|
parameters: () => { |
|
|
|
parameters: () => { |
|
|
|
this.parameterEditor.populate(this.renderItems(), [this.model.paramHeader]); |
|
|
|
this.parameterEditor.populate(this.renderItems(), [this.model.paramHeader]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
ablePreview: (ablePreview: boolean) => { |
|
|
|
ableSave: (ableSave: boolean) => { |
|
|
|
this.previewButton.setEnable(ablePreview); |
|
|
|
this.previewButton.setEnable(ableSave); |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const { database = '', orderValue = '0', script = '', parameters = [], engineType = 0 } = this.options.value.datasetData || {}; |
|
|
|
const { database = '', orderValue = 0, script = '', parameters = [], engineType = 0 } = this.options.value.datasetData || {}; |
|
|
|
this.store.setParameters(parameters); |
|
|
|
this.store.setParameters(parameters); |
|
|
|
|
|
|
|
const inputType = typeof orderValue === 'string' ? 'formula' : 'int'; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
type: HtapeXtype, |
|
|
|
type: HtapeXtype, |
|
|
@ -84,7 +85,7 @@ export class RedisProgram extends BI.Widget { |
|
|
|
type: IconComboXtype, |
|
|
|
type: IconComboXtype, |
|
|
|
height: 22, |
|
|
|
height: 22, |
|
|
|
width: 28, |
|
|
|
width: 28, |
|
|
|
value: 'int', |
|
|
|
value: inputType, |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
text: BI.i18nText('Plugin-Redis_Parameter_Type_Int'), |
|
|
|
text: BI.i18nText('Plugin-Redis_Parameter_Type_Int'), |
|
|
|
value: 'int', |
|
|
|
value: 'int', |
|
|
@ -110,6 +111,7 @@ export class RedisProgram extends BI.Widget { |
|
|
|
type: DatabaseIndex.xtype, |
|
|
|
type: DatabaseIndex.xtype, |
|
|
|
rgap: 11, |
|
|
|
rgap: 11, |
|
|
|
value: orderValue, |
|
|
|
value: orderValue, |
|
|
|
|
|
|
|
inputType, |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.databaseIndex = _ref; |
|
|
|
this.databaseIndex = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -152,9 +154,10 @@ export class RedisProgram extends BI.Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
width: this.textWidth, |
|
|
|
width: this.textWidth, |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
type: CodeEditorXtype, |
|
|
|
type: TextAreaEditorXtype, |
|
|
|
cls: 'bi-border', |
|
|
|
cls: 'bi-border', |
|
|
|
height: 200, |
|
|
|
height: 200, |
|
|
|
|
|
|
|
allowBlank: true, |
|
|
|
value: script, |
|
|
|
value: script, |
|
|
|
ref: (_ref: any) => { |
|
|
|
ref: (_ref: any) => { |
|
|
|
this.queryCondition = _ref; |
|
|
|
this.queryCondition = _ref; |
|
|
@ -193,7 +196,7 @@ export class RedisProgram extends BI.Widget { |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: ButtonXtype, |
|
|
|
type: ButtonXtype, |
|
|
|
text: BI.i18nText('Plugin-Redis_Preview'), |
|
|
|
text: BI.i18nText('Plugin-Redis_Preview'), |
|
|
|
disabled: !this.model.ablePreview, |
|
|
|
disabled: !BI.get(this.model, 'ableSave'), |
|
|
|
handler: () => { |
|
|
|
handler: () => { |
|
|
|
this.openPreview(); |
|
|
|
this.openPreview(); |
|
|
|
}, |
|
|
|
}, |
|
|
|