import { Component, OnInit, Inject } from '@angular/core'; import { NaMessageService } from '@ng-arthur-mobile/core'; import { HttpClient, HttpResponse } from '@angular/common/http'; import { DOCUMENT } from '@angular/common'; import { tap } from 'rxjs/operators'; import { Observable } from 'rxjs'; import { NaHttpService } from '@ng-arthur-mobile/http'; import { DeleteEmptyFields } from '@ng-arthur-mobile/core'; @Component({ selector: 'na-dashboard', templateUrl: './dashboard.component.html', styleUrls: ['./dashboard.component.scss'] }) export class DashboardComponent implements OnInit { // @DeleteEmptyFields() data: any = { // a: 'abc' // }; constructor(protected message: NaMessageService, private naHttpService: NaHttpService) { } ngOnInit() { // console.log(this.message); // this.message.info('测试', 1000000); // this.naHttpService.download('http://10.8.3.212:18080/api/front/report/company/exportDailyReport', {reportDate: '20181211'}) // this.naHttpService.download('https://dev-www.hljinke.com/prolink/files/preViewProductFile', { // planId: 69, // productNo: 'XT10076', // fileId: 181 // }) // .subscribe(resp => console.log(resp), err => console.error(err)); // this.test('XYY'); } // @Download({ // name: 'XYY' // }) test(arg: string) { const name = 'XIONG'; // this.data = { // name: '熊亚运' // }; // console.log(this.data); // console.log('test1', arg); // this.naHttpService.download('http://10.96.1.70:8080/api/front/report/company/exportDailyReport', {reportDate: '20181206'}).subscribe(resp => console.log(resp)); // console.log('test2', arg); // setInterval(() => { // this.data = { // name: '熊亚运' + new Date(), // age: null // }; // console.log(this.data); // }, 3000); } } function Download(key: any = {}) { console.log('download(): evaluated'); return function (target, propertyKey: string, descriptor: PropertyDescriptor) { console.log('download(): called', target, propertyKey, descriptor, key); }; }