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.
79 lines
1.8 KiB
79 lines
1.8 KiB
import {WidgetType, Left, Label, Icon} from '@ui'; |
|
import ItemIcon from './left.item.icon.component'; |
|
import Model from '../../link-set.model'; |
|
const className = 'fr.component.linkSet.left.item'; |
|
const Widget: WidgetType = { |
|
props: { |
|
title:'', |
|
id:'', |
|
creator: '', |
|
}, |
|
_store() { |
|
return BI.Models.getModel(Model); |
|
}, |
|
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;
|
|
|