1 import { Component, OnInit } from "@angular/core";
2 import { Router } from "@angular/router";
3 import { NzMessageService } from "ng-zorro-antd";
4 import { intentBaseService } from "../../../../core/services/intentBase.service";
7 selector: 'app-intent-instance',
8 templateUrl: './intent-instance.component.html',
9 styleUrls: ['./intent-instance.component.less']
11 export class IntentInstanceComponent implements OnInit {
14 private router:Router,
15 private myHttp: intentBaseService,
16 private nzMessage: NzMessageService
24 this.getIntentionInstanceList();
30 listOfData: any[] = [];
31 // pageSize or pageNum
32 pageIndex: number = 1;
33 pageSize: number = 10;
38 getIntentionInstanceList(): void {
39 this.myHttp.getIntentInstanceList({
40 currentPage: this.pageIndex,
41 pageSize: this.pageSize
42 }).subscribe((response) => {
43 const { code, message, data:{ totalRecords, list } } = response;
45 this.nzMessage.error(message);
49 this.total = totalRecords;
50 this.listOfData = list;
56 // change page message
58 this.getIntentionInstanceList();
61 verificationIntentionInstance(row): void {
62 this.myHttp.verifyIntentInstance({
64 }).subscribe((response) => {
65 const { code, message, data } = response;
67 this.nzMessage.error(message);
70 this.nzMessage.success(data);
71 this.resetParam2Query();
77 deleteIntentionInstance(row): void {
78 this.myHttp.delIntentInstance(row.id).subscribe((response) => {
79 const { code, message } = response;
81 this.nzMessage.error(message);
84 this.nzMessage.success('Delete IntentionInstance Success');
85 this.resetParam2Query();
94 this.getIntentionInstanceList();