Compare commits

..

No commits in common. 'master' and 'master' have entirely different histories.

  1. 25
      src/web/src/modules/app.dataset.ts
  2. 29
      src/web/src/modules/app.program.ts

25
src/web/src/modules/app.dataset.ts

@ -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,10 +43,9 @@ 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);
const plainQuery = BI.Providers.getProvider("dec.provider.cipher").getPlain(query);
this.store.setAbleSave(!!plainQuery);
this.store.setAbleSave(!!query);
const inputType = typeof orderValue === 'string' ? 'formula' : 'int';
return {
@ -131,7 +130,7 @@ export class RedisDataset extends BI.Widget {
cls: 'bi-border',
height: 200,
allowBlank: true,
value: plainQuery,
value: query,
ref: (_ref: any) => {
this.queryCondition = _ref;
},
@ -186,7 +185,7 @@ export class RedisDataset extends BI.Widget {
columnSize: [300, 300, ''],
items: this.renderItems(),
header: [this.model.paramHeader],
ref: (_ref: any) => {
ref: (_ref: any) => {
this.parameterEditor = _ref;
},
}],
@ -211,7 +210,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]);
},
}],
@ -228,7 +227,7 @@ export class RedisDataset extends BI.Widget {
return {
database: this.tableList.getSelectedDatabase(),
orderValue: this.databaseIndex.getValue(),
query: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.queryCondition.getValue()),
query: this.queryCondition.getValue(),
parameters: this.model.parameters,
};
}

29
src/web/src/modules/app.program.ts

@ -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 { DatabaseIndex } from './components/database_index/database_index';
import { RedisModel, ParameterType } from './app.model';
import './app.less';
import {redisField} from './app.constant';
import {Preview} from './components/preview/preview';
import { redisField } from './app.constant';
import { Preview } from './components/preview/preview';
@shortcut()
@store(RedisModel)
@ -46,16 +46,9 @@ export class RedisProgram extends BI.Widget {
}
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);
const inputType = typeof orderValue === 'string' ? 'formula' : 'int';
const plainScript = BI.Providers.getProvider("dec.provider.cipher").getPlain(script);
return {
type: BI.HTapeLayout.xtype,
@ -164,7 +157,7 @@ export class RedisProgram extends BI.Widget {
cls: 'bi-border',
height: 200,
allowBlank: true,
value: plainScript,
value: script,
ref: (_ref: any) => {
this.queryCondition = _ref;
},
@ -219,7 +212,7 @@ export class RedisProgram extends BI.Widget {
columnSize: [300, 300, ''],
items: this.renderItems(),
header: [this.model.paramHeader],
ref: (_ref: any) => {
ref: (_ref: any) => {
this.parameterEditor = _ref;
},
}],
@ -244,7 +237,7 @@ export class RedisProgram extends BI.Widget {
value: item.type,
listeners: [{
eventName: BI.IconTextValueCombo.EVENT_CHANGE,
action() {
action () {
self.store.setParamType(index, this.getValue()[0]);
},
}],
@ -267,7 +260,7 @@ export class RedisProgram extends BI.Widget {
return {
database: this.tableList.getSelectedDatabase(),
orderValue: this.databaseIndex.getValue(),
script: BI.Providers.getProvider("dec.provider.cipher").getCipher(this.queryCondition.getValue()),
script: this.queryCondition.getValue(),
engineType: this.engineTypeSelect.getValue()[0],
parameters: this.model.parameters,
};

Loading…
Cancel
Save