import { Router } from '@angular/router';
/*
 * @Author: your name
 * @Date: 2022-01-05 11:01:55
 * @LastEditTime: 2022-01-10 15:56:26
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \tms-obc-web\src\app\routes\contract-management\components\contract-template-detail\contract-template-detail.component.ts
 */
import { DatePipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { apiConf } from '@conf/api.conf';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFTagWidgetSchema, SFTextWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { ImageViewComponent } from 'src/app/shared/components/imagelist';
import { ContractManagementService } from '../../services/contract-management.service';

@Component({
  selector: 'app-contract-management-detail-complaint',
  templateUrl: './contract-detail.component.html',
  styleUrls: ['./contract-detail.component.less'],
  providers: [DatePipe]
})
export class ContractManagementDetailComponent implements OnInit {

  constructor(
    private nzModalService: NzModalService,
    public service: ContractManagementService,
    public route: ActivatedRoute,
    private datePipe: DatePipe,
    private router: Router
  ) {}
  textStatus = '合同详情'
  name: any;
  code: any;
  templateHTML: any;
  detailList: any = {
    templateName: ''
  };
  ngOnInit() {
    this.initData(this.service.$api_contract_get)
  }
  goBack() {
    window.history.go(-1)
  }

  initData(url: string) {
    this.service.request(url, {id: this.route.snapshot.params.id}).subscribe((res) => {
      console.log(res)
      if(res) {
        this.detailList = res;
        this.detailList = res;
        let value :any= JSON.parse(res.contractParameter)
        console.log(value['${code}'])
        console.log(value['${name}'])
        this.code = value['${code}']
        this.name =value['${name}']
      }
    })
  }
  cancel() {
    window.history.go(-1)
  }
}
