|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
import { shortcut, store } from '@core/core'; |
|
|
|
|
import { TableList } from './table_list/table_list'; |
|
|
|
|
import {shortcut, store} from '@core/core'; |
|
|
|
|
import {TableList} from './table_list/table_list'; |
|
|
|
|
import '../less/index.less'; |
|
|
|
|
import { DatabaseIndex } from './components/database_index/database_index'; |
|
|
|
|
import { RedisModel, ParameterType } from './app.model'; |
|
|
|
|
import { Preview } from './components/preview/preview'; |
|
|
|
|
import {DatabaseIndex} from './components/database_index/database_index'; |
|
|
|
|
import {RedisModel, ParameterType} from './app.model'; |
|
|
|
|
import {Preview} from './components/preview/preview'; |
|
|
|
|
import './app.less'; |
|
|
|
|
import { redisField } from './app.constant'; |
|
|
|
|
import {redisField} from './app.constant'; |
|
|
|
|
|
|
|
|
|
@shortcut() |
|
|
|
|
@store(RedisModel) |
|
|
|
@ -43,9 +43,10 @@ export class RedisDataset extends BI.Widget {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
|
const { database = '', orderValue = 0, query = '', parameters = [] } = this.options.value.datasetData || {}; |
|
|
|
|
const {database = '', orderValue = 0, query = '', parameters = []} = this.options.value.datasetData || {}; |
|
|
|
|
this.store.setParameters(parameters); |
|
|
|
|
this.store.setAbleSave(!!query); |
|
|
|
|
const plainQuery = BI.Providers.getProvider("dec.provider.cipher").getPlain(query); |
|
|
|
|
this.store.setAbleSave(!!plainQuery); |
|
|
|
|
const inputType = typeof orderValue === 'string' ? 'formula' : 'int'; |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
@ -130,7 +131,7 @@ export class RedisDataset extends BI.Widget {
|
|
|
|
|
cls: 'bi-border', |
|
|
|
|
height: 200, |
|
|
|
|
allowBlank: true, |
|
|
|
|
value: query, |
|
|
|
|
value: plainQuery, |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
this.queryCondition = _ref; |
|
|
|
|
}, |
|
|
|
@ -210,7 +211,7 @@ export class RedisDataset extends BI.Widget {
|
|
|
|
|
value: item.type, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.IconTextValueCombo.EVENT_CHANGE, |
|
|
|
|
action () { |
|
|
|
|
action() { |
|
|
|
|
self.store.setParamType(index, this.getValue()[0]); |
|
|
|
|
}, |
|
|
|
|
}], |
|
|
|
@ -227,7 +228,7 @@ export class RedisDataset extends BI.Widget {
|
|
|
|
|
return { |
|
|
|
|
database: this.tableList.getSelectedDatabase(), |
|
|
|
|
orderValue: this.databaseIndex.getValue(), |
|
|
|
|
query: this.queryCondition.getValue(), |
|
|
|
|
query: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.queryCondition.getValue()), |
|
|
|
|
parameters: this.model.parameters, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|