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.
77 lines
2.1 KiB
77 lines
2.1 KiB
import './left_item.less'; |
|
import {WidgetType, Icon, TextButton, LeftRightVerticalAdapt} from '@ui'; |
|
import ItemIcon from './left_item_icon'; |
|
import ItemDelete from './left_item_delete'; |
|
import Model from '../../link_set.model'; |
|
import {ACTION_COPY, ACTION_TEST, ACTION_DELETE, DEFAULT_INFO} from '@private/constants'; |
|
const className = 'dec.dcm.component.linkSet.left.item'; |
|
const Widget: WidgetType = { |
|
props: { |
|
title: '', |
|
id: '', |
|
creator: '', |
|
baseCls: 'dec-webui-dcm-connection-left-item bi-list-item-active', |
|
}, |
|
_store() { |
|
return BI.Models.getModel(Model); |
|
}, |
|
render() { |
|
const {title, creator, text, id} = this.options; |
|
|
|
return { |
|
type: LeftRightVerticalAdapt, |
|
items: { |
|
left: [ |
|
{ |
|
type: Icon, |
|
cls: 'dcm-link-font', |
|
height: 25, |
|
width: 25, |
|
text: BI.i18nText('Dec-Dcm_Connections'), |
|
title, |
|
}, |
|
{ |
|
type: TextButton, |
|
text: title, |
|
title, |
|
}, |
|
], |
|
right: [ |
|
{ |
|
type: ItemIcon, |
|
cls: 'link-item-icon dcm-test-font', |
|
title: BI.i18nText('Dec-Dcm_Test_Connection'), |
|
value: ACTION_TEST, |
|
id, |
|
}, |
|
{ |
|
type: ItemIcon, |
|
cls: 'link-item-icon copy-font', |
|
title: BI.i18nText('Dec-Dcm_Copy'), |
|
value: ACTION_COPY, |
|
id, |
|
}, |
|
{ |
|
type: ItemIcon, |
|
cls: 'link-item-icon dcm-info-font', |
|
title: `${BI.i18nText('Dec-Dcm_Type')}:${text === DEFAULT_INFO ? BI.i18nText('Dec-Dcm_Other') : text} \r\n${BI.i18nText('Dec-Dcm_Creator')}:${creator}`, |
|
id, |
|
}, |
|
{ |
|
type: ItemDelete, |
|
cls: 'link-item-icon dcm-delete-font', |
|
title: BI.i18nText('Dec-Dcm_Delete'), |
|
value: ACTION_DELETE, |
|
id, |
|
}, |
|
], |
|
}, |
|
}; |
|
}, |
|
doClick() { |
|
const {title} = this.options; |
|
this.store.setLinkSelected(title); |
|
}, |
|
}; |
|
BI.shortcut(className, BI.inherit(BI.BasicButton, Widget)); |
|
export default className;
|
|
|