import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; import { SmartHelpEntity } from '../common/CommonEntity'; import { ExpressionEditorLocalePipe } from '../utils/expression-editor-locale.pipe'; @Component({ selector: 'app-expression-smart-help-grid', templateUrl: './expression-smart-help-grid.component.html', styleUrls: ['./expression-smart-help-grid.component.css'] }) export class ExpressionSmartHelpGridComponent implements OnInit { //定义i18n标识 private localeId : string; private localePipe : ExpressionEditorLocalePipe; constructor() { //初始化i18n标识 this.localeId = localStorage.getItem('languageCode'); this.localePipe = new ExpressionEditorLocalePipe(this.localeId); } @Input() smartHelp: SmartHelpEntity[]=[]; @Output() selectSchemaRow = new EventEmitter(); @Output() dbclickInsert = new EventEmitter(); items:SmartHelpEntity[]=[]; columns = []; ngOnInit() { this.columns = [ { field: 'code',width: 60, title: this.localePipe.transform("HelpCode"),filter:true}, { field: 'name',width: 60, title: this.localePipe.transform("HelpName"),filter:true}, { field: 'description',width: 100, title: this.localePipe.transform("HelpDescription"),filter:true}, ]; this.items=this.smartHelp; } ondblclickRow($event) { let entities = this.smartHelp.find(temp => temp.code==$event.rowData.code); // entities.serviceInstance.showWizard().subscribe((result)=>{ // this.dbclickInsert.emit(result); // }); this.dbclickInsert.emit(entities.serviceInstance.showWizard()); } selectRowChange($event) { this.selectSchemaRow.emit($event.data); } }