1 import { Component, OnInit } from '@angular/core';
2 import { NzMessageService } from 'ng-zorro-antd';
3 import { intentBaseService } from '../../../../core/services/intentBase.service';
6 selector: 'app-intent-based-predict',
7 templateUrl: './intent-based-predict.component.html',
8 styleUrls: ['./intent-based-predict.component.less']
10 export class IntentBasedPredictComponent implements OnInit {
13 private myhttp: intentBaseService,
14 private msg: NzMessageService
17 // textarea input predict param
18 communicationMessage: String = "";
20 isConfirmCreating: boolean = false;
22 modalParam: Object = {};
23 // cloud modal show flag
24 cloudModalShowFlag: boolean = false;
25 // business modal show flag
26 businessModalShowFlag: boolean = false;
29 this.communicationMessage = '';
34 submitFormMessage(): void {
35 this.isConfirmCreating = true;
36 this.myhttp.intentBasedUnifyPredict({
37 "text": this.communicationMessage
40 this.isConfirmCreating = false;
41 const { code, message, data: { type, formData } } = response;
43 this.msg.error(message);
49 intentContent: this.communicationMessage
52 if (type === 'ccvpn') {
53 this.cloudModalShowFlag = true;
57 this.businessModalShowFlag = true;
61 this.isConfirmCreating = false;
68 this.cloudModalShowFlag = false;
69 this.businessModalShowFlag = false;
71 this.communicationMessage = '';