diff --git a/src/app/for-internal/demo/pc/system-prompt/basic/demo.component.html b/src/app/for-internal/demo/pc/system-prompt/basic/demo.component.html index f84e29e89..cb83722f8 100644 --- a/src/app/for-internal/demo/pc/system-prompt/basic/demo.component.html +++ b/src/app/for-internal/demo/pc/system-prompt/basic/demo.component.html @@ -7,6 +7,10 @@ 延迟: +
  • + 可清空: + +
  • 错误: 容器1 diff --git a/src/app/for-internal/demo/pc/system-prompt/basic/demo.component.ts b/src/app/for-internal/demo/pc/system-prompt/basic/demo.component.ts index 43d1f01e3..c63c4001e 100644 --- a/src/app/for-internal/demo/pc/system-prompt/basic/demo.component.ts +++ b/src/app/for-internal/demo/pc/system-prompt/basic/demo.component.ts @@ -14,15 +14,16 @@ export class JigsawSystemPromptBasicDemoComponent { public container3: ViewContainerRef; public timeout = 8000; + public clearable = true; public showSystemPrompt1(message, type) { - JigsawSystemPrompt.show(message, this.container1, { type: type, timeout: this.timeout }); + JigsawSystemPrompt.show(message, this.container1, { type: type, timeout: this.timeout, clearable: this.clearable }); } public showSystemPrompt2(message, type) { - JigsawSystemPrompt.show(message, this.container2, { type: type, timeout: this.timeout }); + JigsawSystemPrompt.show(message, this.container2, { type: type, timeout: this.timeout, clearable: this.clearable }); } public showSystemPrompt3(message, type) { - JigsawSystemPrompt.show(message, this.container3, { type: type, timeout: this.timeout }); + JigsawSystemPrompt.show(message, this.container3, { type: type, timeout: this.timeout, clearable: this.clearable }); } public showSuccess(message) { diff --git a/src/app/for-internal/demo/pc/system-prompt/basic/demo.module.ts b/src/app/for-internal/demo/pc/system-prompt/basic/demo.module.ts index 7b9ad591b..afe757f36 100644 --- a/src/app/for-internal/demo/pc/system-prompt/basic/demo.module.ts +++ b/src/app/for-internal/demo/pc/system-prompt/basic/demo.module.ts @@ -1,13 +1,13 @@ import { NgModule } from "@angular/core"; import { CommonModule } from "@angular/common"; import { JigsawDemoDescriptionModule } from "app/for-internal/description/demo-description"; -import { JigsawButtonModule, JigsawHeaderModule, JigsawNumericInputModule, JigsawSystemPromptModule } from "jigsaw/public_api"; +import { JigsawButtonModule, JigsawHeaderModule, JigsawNumericInputModule, JigsawSwitchModule, JigsawSystemPromptModule } from "jigsaw/public_api"; import { JigsawSystemPromptBasicDemoComponent } from "./demo.component"; import { PerfectScrollbarModule } from "ngx-perfect-scrollbar"; @NgModule({ imports: [JigsawHeaderModule, CommonModule, JigsawDemoDescriptionModule, JigsawSystemPromptModule, JigsawButtonModule, PerfectScrollbarModule, - JigsawNumericInputModule], + JigsawNumericInputModule, JigsawSwitchModule], declarations: [JigsawSystemPromptBasicDemoComponent], exports: [JigsawSystemPromptBasicDemoComponent] }) diff --git a/src/jigsaw/pc-components/system-prompt/system-prompt.html b/src/jigsaw/pc-components/system-prompt/system-prompt.html index f3edc5e71..31d9cef1b 100644 --- a/src/jigsaw/pc-components/system-prompt/system-prompt.html +++ b/src/jigsaw/pc-components/system-prompt/system-prompt.html @@ -1,3 +1,3 @@ {{message}} - \ No newline at end of file + \ No newline at end of file diff --git a/src/jigsaw/pc-components/system-prompt/system-prompt.ts b/src/jigsaw/pc-components/system-prompt/system-prompt.ts index 3524f2ffc..fe247d3d6 100644 --- a/src/jigsaw/pc-components/system-prompt/system-prompt.ts +++ b/src/jigsaw/pc-components/system-prompt/system-prompt.ts @@ -19,6 +19,7 @@ import { AbstractJigsawComponent} from "../../common/common"; export class SystemPromptMessage { type?: NoticeLevel; timeout?: number; + clearable?: boolean; } @Component({ @@ -49,6 +50,12 @@ export class JigsawSystemPrompt extends AbstractJigsawComponent implements OnDes @RequireMarkForCheck() public type: NoticeLevel = 'error'; + /** + * @NoMarkForCheckRequired + */ + @Input() + public clearable: boolean = true; + /** * @NoMarkForCheckRequired */ @@ -63,6 +70,7 @@ export class JigsawSystemPrompt extends AbstractJigsawComponent implements OnDes const instance = componentRef.instance; instance.type = options?.type || 'error'; instance.timeout = CommonUtils.isDefined(options?.timeout) ? options.timeout : 8000; + instance.clearable = CommonUtils.isDefined(options?.clearable) ? options?.clearable : true; instance.message = message; instance._setupTimeout(); containerRef.element.nativeElement.appendChild(componentRef.location.nativeElement);