summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/intent-management/input-intent-condition
diff options
context:
space:
mode:
authorzoulingli128 <zll_1208@126.com>2022-09-08 15:32:27 +0800
committerzoulingli128 <zll_1208@126.com>2022-09-08 15:32:27 +0800
commit7bdeb7cc89a8d60e4c3199f1922a6bf73a9d83c1 (patch)
treebfa45c3c2e02f3f07d760065654d5c3af7ae52c2 /usecaseui-portal/src/app/views/intent-management/input-intent-condition
parenta6d5ef22e8874a33fbee58ec6813be4299b04d67 (diff)
Intent analysis frontend
Issue-ID: USECASEUI-711 Signed-off-by: zoulingli128 <zll_1208@126.com> Change-Id: I8f8636f6b47c5ba25e6f342c484fd8ffb5ed1d6d
Diffstat (limited to 'usecaseui-portal/src/app/views/intent-management/input-intent-condition')
-rw-r--r--usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.html24
-rw-r--r--usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.less0
-rw-r--r--usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.spec.ts25
-rw-r--r--usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.ts78
4 files changed, 127 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.html b/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.html
new file mode 100644
index 00000000..9dab2962
--- /dev/null
+++ b/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.html
@@ -0,0 +1,24 @@
+<nz-modal [(nzVisible)]="showModel" nzTitle="Add Condition" nzCentered (nzOnCancel)="handleCancel()"
+ (nzOnOk)="handleOk()" nzWidth="44%" nzHeight="600px" class="intent-management-modal">
+ <div class="intent-condition-div clearfix">
+ <p class="expectation-p w50">
+ <span class="left"> Condition Name:</span>
+ <input nz-input id="condition_name" [(ngModel)]="this.defaultParams['conditionName']">
+ </p>
+ <p class="expectation-p w50">
+ <span class="left"> Operator:</span>
+ <nz-select *ngIf="conditionType === 'value'" [(ngModel)]="this.defaultParams['operator']" (ngModelChange)="handleChange($event)">
+ <nz-option [nzValue]="itemType.value" [nzLabel]="itemType.label" *ngFor="let itemType of operatorList"></nz-option>
+ </nz-select>
+ </p>
+ <div class="condition-type">
+ <nz-radio-group [(ngModel)]="conditionType">
+ <label nz-radio nzValue="value">
+ Condition Value
+ <input type="text" nz-input id="condition_value" [(ngModel)]="this.defaultParams['conditionValue']" *ngIf="conditionType === 'value'" placeholder="please input condition value" />
+ </label>
+ <label nz-radio nzValue="list" [nzDisabled]="true">Condition List</label>
+ </nz-radio-group>
+ </div>
+ </div>
+</nz-modal> \ No newline at end of file
diff --git a/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.less b/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.less
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.less
diff --git a/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.spec.ts b/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.spec.ts
new file mode 100644
index 00000000..916308db
--- /dev/null
+++ b/usecaseui-portal/src/app/views/intent-management/input-intent-condition/input-intent-condition.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { InputIntentConditionComponent } from './input-intent-condition.component';
+
+describe('InputIntentConditionComponent', () => {
+ let component: InputIntentConditionComponent;
+ let fixture: ComponentFixture<InputIntentConditionComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ InputIntentConditionComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(InputIntentConditionComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
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
+ };
+ }
+
+}