帆软决策平台数据连接界面库
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.
 
 
 
 

39 lines
1.0 KiB

import {WidgetType, ListView} from '@ui';
import Model from '../link_set.model';
import {LinkType} from '@ui/type';
import LeftItem from './item/left_item';
const className = 'dec.dcm.component.linkset.left';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkList(linkList: LinkType[]) {
this.leftContent.populate(BI.createItems(this._renderItems(linkList)));
},
},
render() {
return {
type: ListView,
ref: _ref => {
this.leftContent = _ref;
},
items: this._renderItems(this.model.linkList),
};
},
_renderItems(linkList: LinkType[]) {
return BI.map(linkList, (index: number, item: LinkType) => {
return {
type: LeftItem,
selected: item.isSelected,
title: item.connectionName,
id: item.connectionId,
creator: item.creator,
text: item.text ? item.text : BI.i18nText('Dec-Dcm_Default'),
};
});
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;