From b71bd34b5baa8e3dfedf83f777d62c988c6b9c97 Mon Sep 17 00:00:00 2001 From: kaixiliu Date: Wed, 4 Dec 2024 15:10:45 +0800 Subject: Optimize the code and fix bug 1. Create a new descripition component code 2. Optimize the code to extract a MaaS feature module and a common module. 3. Optimize the service code and create a new maasService. 4.Click the Q&A Assistant menu, the front-end interface does not deliver an application ID. Issue-ID: USECASEUI-844 Change-Id: If57938f9c57b186691798eb0fb2cdd2fd64ed58a Signed-off-by: kaixiliu --- .../knowledge-base-detail.component.ts | 46 +++------------------- 1 file changed, 6 insertions(+), 40 deletions(-) (limited to 'usecaseui-portal/src/app/views/maas/knowledge-base-management/knowledge-base-detail/knowledge-base-detail.component.ts') diff --git a/usecaseui-portal/src/app/views/maas/knowledge-base-management/knowledge-base-detail/knowledge-base-detail.component.ts b/usecaseui-portal/src/app/views/maas/knowledge-base-management/knowledge-base-detail/knowledge-base-detail.component.ts index 172e9d1d..3bcc1455 100644 --- a/usecaseui-portal/src/app/views/maas/knowledge-base-management/knowledge-base-detail/knowledge-base-detail.component.ts +++ b/usecaseui-portal/src/app/views/maas/knowledge-base-management/knowledge-base-detail/knowledge-base-detail.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { knowledgeBase } from '../knowledge-base.type'; +import { KnowledgeBase } from '../knowledge-base.type'; import { KnowledgeBaseService } from '../knowledge-base.service'; @Component({ selector: 'app-knowledge-base-detail', @@ -9,56 +9,22 @@ import { KnowledgeBaseService } from '../knowledge-base.service'; export class KnowledgeBaseDetailComponent implements OnInit { constructor( - private knowledgeBaseService: KnowledgeBaseService + public knowledgeBaseService: KnowledgeBaseService ) { } - @Input() showModel: boolean; - _knowledgeBase: knowledgeBase; - data: Array<{ label: string, value: string }> = []; - @Input() - - set knowledgeBaseDetail(v: any) { - if (!v) { - return; - } - this.data = [ - { - label: 'Knowledge Base Name', value: v.knowledgeBaseName - }, - { - label: 'Knowledge Base Description', value: v.knowledgeBaseDescription - }, - { - label: 'Operator Name', value: v.operatorName - }, - { - label: 'MaaS Platform Name', value: v.maaSPlatformName - }, - { - label: 'Update Time', value: v.updateTime - }, - { - label: 'Files Name', value: this.knowledgeBaseService.getFiles(v) - } - ] - this._knowledgeBase = v; - } - - get knowledgeBaseDetail() { - return this._knowledgeBase; - }; + @Input() showModal: boolean; + @Input() knowledgeBaseDetail: KnowledgeBase; @Output() modalOpreation = new EventEmitter(); - files = ''; ngOnInit() { } handleCancel(): void { - this.showModel = false; + this.showModal = false; this.modalOpreation.emit({ "cancel": true }); } handleOk(): void { - this.showModel = false; + this.showModal = false; this.modalOpreation.emit({ "cancel": true }); } } \ No newline at end of file -- cgit 1.2.3-korg