import {Component, OnInit} from '@angular/core';
import {LifeCommonService} from "../../common/life-common.service";
import {MyService} from "../my.service";

@Component({
  selector: 'ydlife-file-upload',
  templateUrl: './file-upload.component.html',
  styleUrls: ['./file-upload.component.scss']
})
export class FileUploadComponent implements OnInit {
  fileUploadItemList: Array<any>;

  constructor(private myService: MyService) {
  }

  ngOnInit() {
    this.fileUpload(3, 0, 19);
  }

//  文件下载
  fileUpload(itemType, itemId, fileCategory) {
    this.myService.filePath(itemType, itemId, fileCategory).subscribe(res => {
      if (res['success']) {
        this.fileUploadItemList = res['data']['fileUploadItemList'];
      }
    });
  }

}
