import { Component, OnInit, ViewChild } from '@angular/core'; import { WizardService } from '@farris/ui-wizard'; @Component({ selector: 'app-wizard-demo', templateUrl: './wizard-demo.component.html', styleUrls: ['./wizard-demo.component.scss'] }) export class WizardDemoComponent implements OnInit { progressData = { activeIndex: -1, stepMessages: [ { id: 'selectgood', title: '结算方式定义', icon: '' }, { id: 'deliverytime', title: '开始结转', icon: '' }, { id: 'shipmentamount', title: '平衡检查', icon: '' } ] }; stepValue: string = 'selectgood'; selectUnitValue = ''; constructor(private wizardSer: WizardService) {} ngOnInit() { if (this.progressData.activeIndex >= 0) { this.stepValue = this.progressData.stepMessages[ this.progressData.activeIndex ]['id']; } // 设置向导数据,供子取数 this.wizardSer.setWizardData({ selectUnitValue: this.selectUnitValue }); } onSelect(event) { // console.log('PageSelected事件'); //console.log(event); } change() { //------------------------------------向导相关,处理向导数据 this.progressData = Object.assign({}, this.progressData, { activeIndex: this.selectUnitValue ? 0 : -1 }); this.wizardSer.setWizardData({ selectUnitValue: this.selectUnitValue }); } stateChange(event){ // console.log('状态变化'); //console.log(event); } }