redis数据集插件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.3 KiB

import { model, Model } from './core/core';
import { redisParamHeader } from './app.constant';
@model()
export class RedisModel extends Model {
static xtype = 'dec.model.dcm.connection.plugin.redis'
context = ['dataSetName', 'ableSave']
state() {
return {
parameters: [] as ParameterType[],
};
}
actions = {
setAbleSave(ableSave: boolean) {
this.model.ableSave = ableSave;
},
setParameters: (parameters: ParameterType[]) => {
this.model.parameters = parameters;
},
setParamType: (index: number, type: string) => {
if (this.model.parameters[index].type !== type) {
this.model.parameters[index].type = type;
this.model.parameters[index].value = BI.Services.getService('dec.service.data.set').getDefaultValueByType(type);
this.model.parameters.splice(0, 0);
}
},
setParamValue: (index: number, val: string) => {
this.model.parameters[index].value = val;
},
}
computed = {
paramHeader: () => redisParamHeader.map(item => BI.extend({
textAlign: 'left',
height: 30,
hgap: 10,
}, item)),
}
}
export interface ParameterType {
name: string;
type: string;
value: string;
}