|
|
|
import {WidgetType, Left, Label, Icon} from '@ui';
|
|
|
|
import ItemIcon from './left.item.icon.component';
|
|
|
|
import LeftItemModel from './left.item.model';
|
|
|
|
const className = 'fr.component.linkSet.left.item';
|
|
|
|
const Widget: WidgetType = {
|
|
|
|
props: {
|
|
|
|
title:'',
|
|
|
|
id:'',
|
|
|
|
creator: '',
|
|
|
|
},
|
|
|
|
_store() {
|
|
|
|
return BI.Models.getModel(LeftItemModel);
|
|
|
|
},
|
|
|
|
render() {
|
|
|
|
const {title, extraCls, creator, text, id} = this.options;
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: Left,
|
|
|
|
cls: 'left-item',
|
|
|
|
extraCls,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: Icon,
|
|
|
|
cls: 'link-font',
|
|
|
|
height: 24,
|
|
|
|
width: 26,
|
|
|
|
text: '连接',
|
|
|
|
title,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: Label,
|
|
|
|
cls:'link-title',
|
|
|
|
textAlign: 'left',
|
|
|
|
text: title,
|
|
|
|
title,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: Left,
|
|
|
|
cls: 'icons',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: ItemIcon,
|
|
|
|
cls: 'link-text-font',
|
|
|
|
title: '测试连接',
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: ItemIcon,
|
|
|
|
cls: 'copy-font',
|
|
|
|
title: '复制',
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: ItemIcon,
|
|
|
|
cls: 'info-font',
|
|
|
|
title: `类型:${text === 'DESIGNER' ? '其他' : text} \r\n创建者:${creator}`,
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: ItemIcon,
|
|
|
|
cls: 'delete-font',
|
|
|
|
title: '删除',
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
const {title} = this.options;
|
|
|
|
this.element.on('click', () => {
|
|
|
|
this.store.setLinkSelected(title);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
|
|
|
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
|
|
|
|
export default className;
|