summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.ts78
1 files changed, 78 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.ts b/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.ts
new file mode 100644
index 00000000..22d3bfed
--- /dev/null
+++ b/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.ts
@@ -0,0 +1,78 @@
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
+import { Util } from '../../../shared/utils/utils';
+
+@Component({
+ selector: 'app-input-intent-condition',
+ templateUrl: './input-intent-condition.component.html',
+ styleUrls: ['../intent-management.component.less']
+})
+export class InputIntentConditionComponent implements OnInit {
+
+ constructor(
+ private Util: Util
+ ) { }
+
+ @Input() showModel: boolean;
+ @Output() modalOpreation = new EventEmitter();
+ @Input() editConditionTableData;
+
+ defaultParams:Object={
+ conditionId:'',
+ conditionName:'',
+ operator:'EQUALTO',
+ conditionValue:'',
+ conditionList:null
+ };
+ conditionType: string;
+ operatorList: any[] = [];
+
+ ngOnChanges() {
+ // this.defaultParams=this.editConditionTableData
+ // if(this.editConditionTableData['conditionList'] === null){
+ // this.conditionType='value'
+ // }else{
+ // this.conditionType='list'
+ // this.secondParams=this.editConditionTableData['conditionList']
+ // }
+ if (this.showModel) {
+ if (JSON.stringify(this.editConditionTableData)!=='{}') {
+ this.defaultParams=this.editConditionTableData
+ }
+ console.log(this.editConditionTableData)
+ }
+ }
+ ngOnInit() {
+ this.conditionType = 'value'
+ this.operatorList = [
+ { label:'EQUALTO', value:'EQUALTO'},
+ { label:'LARGETHAN', value:'LARGETHAN'},
+ { label:'LESSTHAN', value:'LESSTHAN'}
+ ]
+ }
+ handleCancel(): void {
+ this.modalOpreation.emit({ "cancel": true });
+ this.clearConditionData()
+ }
+ handleOk(): void {
+ if(JSON.stringify(this.editConditionTableData)==='{}'){
+ this.defaultParams['conditionId']=this.Util.getUuid()
+ }
+ console.log(this.defaultParams)
+ this.modalOpreation.emit({ "cancel": false, "param": this.defaultParams });
+ this.clearConditionData()
+ }
+ handleChange(event){
+ this.defaultParams['operator']=event
+ }
+ clearConditionData(){
+ this.conditionType = 'value'
+ this.defaultParams={
+ conditionId:'',
+ conditionName:'',
+ operator:'EQUALTO',
+ conditionValue:'',
+ conditionList:null
+ };
+ }
+
+}