实现效果
tab页签
< ul>
< li *ngFor = " let item of tabs; let i=index" >
< a (click) = " handleClick(item.state,i)" [class.active] = " categoryIndex === i" > {{item.title}} · {{item.total}}</ a>
</ li>
</ ul>
total1: number = 0
total2: number = 0
tabs = [
{
title: '待办' ,
state: 2 ,
total: this . total1
} , {
title: '已办' ,
state: 5 ,
total: this . total2
}
]
getRunningData ( state, owner) {
this . loading = true
this . service. getRunningTask ( state, owner) . subscribe ( ( res: any ) => {
this . loading = false
this . data = res. content
this . i18n. setLocale ( zh_CN) ;
console . log ( 'this.data' , this . data)
if ( state=== 2 ) {
this . total1 = res. content. length
this . tabs[ 0 ] . total = this . total1
} else if ( state=== 5 ) {
this . total2 = res. content. length
this . tabs[ 1 ] . total = this . total1
}
console . log ( 'this.tabs' , this . tabs)
this . cd. markForCheck ( )
} )
}
打开任务中心界面
< div class = " more" (click) = " viewTaskCenter()" >
viewTaskCenter ( ) {
const options: any = {
appType: 'menu' ,
funcId: 'WF0101' ,
appId: '' ,
appEntrance: '' ,
tabId: 'WF0101' ,
} ;
( window as any ) . gspframeworkService. rtf. func. openMenu ( options) ;
}