|
|
@@ -0,0 +1,30 @@ |
|
|
|
// parent.component.ts |
|
|
|
import { CommonModule } from '@angular/common'; |
|
|
|
import { Component, Input, Output, EventEmitter } from '@angular/core'; |
|
|
|
import { SHARED_IMPORTS } from '@shared'; |
|
|
|
import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; |
|
|
|
import { NzIconModule } from 'ng-zorro-antd/icon'; |
|
|
|
@Component({ |
|
|
|
selector: 'lj-data-v-board-title', |
|
|
|
standalone: true, |
|
|
|
templateUrl: './lj-board-title.component.html', |
|
|
|
styleUrls: ['./lj-board-title.component.less'], |
|
|
|
imports: [NzIconModule, CommonModule, NzDropDownModule, ...SHARED_IMPORTS] |
|
|
|
}) |
|
|
|
export class LJDataVBoardTitleComponent { |
|
|
|
@Input() showSetting = false; |
|
|
|
@Input() showEditButton: boolean = false; |
|
|
|
@Input() |
|
|
|
optionsList: Array<{ label: string; checked: boolean }> = []; |
|
|
|
// 定义输出事件 |
|
|
|
@Output() onCheckedItemsChange = new EventEmitter<Array<{ label: string; checked: boolean }>>(); |
|
|
|
@Input() title: string = ''; |
|
|
|
getCheckedItems() { |
|
|
|
return this.optionsList.filter(option => option.checked); |
|
|
|
} |
|
|
|
|
|
|
|
onCheckChange() { |
|
|
|
const checkedItems = this.getCheckedItems(); |
|
|
|
this.onCheckedItemsChange.emit(checkedItems); |
|
|
|
} |
|
|
|
} |