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.
 
 
 
 
 
 

46 lines
1.3 KiB

import { model, Model } from './core/core';
import { redisParamHeader } from './app.constant';
@model()
export class RedisDatasetModel extends Model {
static xtype = 'dec.model.dcm.connection.plugin.redis.dataset'
context = ['dataSetName', 'ableSave']
state() {
return {
parameters: [{ name: '123', type: 'String' }] as {
name: string;
type: string;
value: string;
}[],
};
}
actions = {
setAbleSave(ableSave: boolean) {
this.model.ableSave = ableSave;
},
setParameters: (parameters: {
name: string;
type: string;
value: string;
}[]) => {
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);
}
},
}
computed = {
paramHeader: () => redisParamHeader.map(item => BI.extend({
textAlign: 'left',
height: 30,
hgap: 10,
}, item)),
}
}