|
|
|
import {WidgetType, Vertical, Left, Label, Button} from '@ui/index';
|
|
|
|
import RightDetailModel from './right.detail.model';
|
|
|
|
import Title from '../right_title/right.title.component';
|
|
|
|
import RightShow from '../right_show/right.show.component';
|
|
|
|
import RightEdit from '../right_edit/right.edit.component';
|
|
|
|
import {LinkType} from '@ui/type';
|
|
|
|
const className = 'fr.component.right.detail';
|
|
|
|
let rightDetail: any = null;
|
|
|
|
const Widget: WidgetType = {
|
|
|
|
_store() {
|
|
|
|
return BI.Models.getModel(RightDetailModel);
|
|
|
|
},
|
|
|
|
watch:{
|
|
|
|
linkSelected(linkSelected: LinkType) {
|
|
|
|
if (linkSelected.isSelected) {
|
|
|
|
rightDetail.populate(BI.createItems([
|
|
|
|
{
|
|
|
|
type: Title,
|
|
|
|
isEdit: true,
|
|
|
|
linkSelected,
|
|
|
|
}, {
|
|
|
|
type: RightEdit,
|
|
|
|
linkSelected,
|
|
|
|
},
|
|
|
|
]));
|
|
|
|
} else {
|
|
|
|
rightDetail.populate(BI.createItems([
|
|
|
|
{
|
|
|
|
type: Title,
|
|
|
|
isEdit: false,
|
|
|
|
linkSelected,
|
|
|
|
}, {
|
|
|
|
type: RightShow,
|
|
|
|
linkSelected,
|
|
|
|
},
|
|
|
|
]));
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
render() {
|
|
|
|
return {
|
|
|
|
type: Vertical,
|
|
|
|
cls:'right-content',
|
|
|
|
ref(_ref: any) {
|
|
|
|
rightDetail = _ref;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
rightDetail.populate(BI.createItems([
|
|
|
|
{
|
|
|
|
type: Title,
|
|
|
|
isEdit: false,
|
|
|
|
linkSelected:false,
|
|
|
|
}, {
|
|
|
|
type: RightShow,
|
|
|
|
linkSelected:false,
|
|
|
|
},
|
|
|
|
]));
|
|
|
|
},
|
|
|
|
};
|
|
|
|
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
|
|
|
|
export default className;
|