ai-polish-modal.component.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!-- ai-polish-modal.component.html -->
  2. <ion-header>
  3. <ion-toolbar>
  4. <ion-title>AI 润色</ion-title>
  5. <ion-buttons slot="end">
  6. <ion-button (click)="dismiss()">关闭</ion-button>
  7. </ion-buttons>
  8. </ion-toolbar>
  9. </ion-header>
  10. <ion-content>
  11. <!-- 文本域:生成提示词 -->
  12. <ion-textarea [value]="userPrompt" (ionInput)="promptInput($event)" placeholder="请输入想要润色的内容~"
  13. autoGrow="true"></ion-textarea>
  14. <!-- 按钮:执行消息生成函数 -->
  15. <ion-button (click)="sendMessage()" expand="block" class="primary">开始润色</ion-button>
  16. <!-- 展示:返回消息内容 -->
  17. <!-- 消息传输过程中,实时预览 -->
  18. @if(!isComplete){
  19. <div>{{responseMsg}}</div>
  20. }
  21. <!-- 消息传输完成后,实时预览Markdown格式 -->
  22. @if(isComplete){
  23. <fm-markdown-preview class="content-style" [content]="responseMsg"></fm-markdown-preview>
  24. <ion-textarea [(ngModel)]="polishedText" rows="10" placeholder="润色后的内容" autoGrow="true"></ion-textarea>
  25. <!-- 添加复制按钮 -->
  26. <ion-button (click)="copyPolishedText()" class="secondary">复制</ion-button>
  27. <!-- 添加填入文末按钮 -->
  28. <ion-button (click)="insertIntoChapterEnd()" class="secondary">填入文末</ion-button>
  29. <!-- 添加重新生成按钮 -->
  30. <ion-button (click)="regenerate()" class="success">重新生成</ion-button>
  31. }
  32. </ion-content>