bixi
Version:
企业级中后台前端解决方案
56 lines (50 loc) • 1.59 kB
text/typescript
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { IOperationsColBtn, IRow } from '../table.type';
export class BixiOperationsGroupComponent {
operationGroup: IOperationsColBtn;
rowIndex: number;
row: IRow;
onClick() {
if (!this.operationGroup.disabled && this.operationGroup.onClick) this.operationGroup.onClick(this.row, this.rowIndex);
}
get visibleNoChildren() {
return !this.hasChildren() && this.operationGroup.visible;
}
get visibleHasChildren() {
return this.hasChildren() && this.operationGroup.visible;
}
private hasChildren() {
return this.operationGroup.children && this.operationGroup.children.length > 0;
}
}