import { Component, OnInit } from '@angular/core';
import {WorkService} from '../../work.service';
import {NzMessageService} from 'ng-zorro-antd';
import {ActivatedRoute} from '@angular/router';

@Component({
  selector: 'smart-handle-detail',
  templateUrl: './handle-detail.component.html',
  styles: [
      `
          :host ::ng-deep .ant-row{
              margin: 20px 0;
          }
          :host ::ng-deep .ant-col-4{
              text-align: right;
          }
          h2{
              font-weight: 400;
          }
      `
  ]
})
export class HandleDetailComponent implements OnInit {

  eventId;
  event;
  constructor(private workSer:WorkService,private message:NzMessageService,
              private routrInfo:ActivatedRoute) {
    this.routrInfo.queryParams.subscribe(
        (res)=>{
          this.eventId = res.eventId;
        }
    )
  }

  ngOnInit() {
    this.getDetail();
  }

  getDetail(){
    this.workSer.findByNo(this.eventId).subscribe(
        (res)=>{
          this.event = res.data;
        }
    )
  }
}
