chapter-generator.page.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!-- chapter-generator.page.html -->
  2. <ion-header>
  3. <ion-toolbar>
  4. <!-- 返回箭头 -->
  5. <ion-buttons slot="start">
  6. <ion-back-button defaultHref="/"></ion-back-button>
  7. </ion-buttons>
  8. <!-- 页面标题 -->
  9. <ion-title>章节编辑</ion-title>
  10. <!-- 保存作品按钮 -->
  11. <ion-buttons slot="end">
  12. <!-- <ion-button color="primary">保存作品</ion-button> -->
  13. </ion-buttons>
  14. </ion-toolbar>
  15. </ion-header>
  16. <ion-content>
  17. <!-- 遮罩层 -->
  18. <div class="overlay" [style.display]="isSideShow ? 'block' : 'none'"></div>
  19. <!-- 主要内容区域 -->
  20. <div class="content-container">
  21. <!-- 侧边栏 -->
  22. <div [style.display]="isSideShow ? 'flex' : 'none'"
  23. style="display: flex; width: 200px; height: 90%; flex-direction: column; z-index: 1000; overflow-y: auto; max-height: 100%;">
  24. <ion-list>
  25. <ion-item *ngFor="let chapter of chapters; let i = index;" (click)="selectChapter(i)">
  26. <ion-label>{{ chapter?.get("title") }}</ion-label>
  27. <ion-buttons slot="end">
  28. <ion-button (click)="deleteChapter(i)">
  29. <ion-icon name="trash"></ion-icon>
  30. </ion-button>
  31. </ion-buttons>
  32. </ion-item>
  33. </ion-list>
  34. <ion-button (click)="addChapter()">
  35. <ion-icon name="add"></ion-icon>添加章节
  36. </ion-button>
  37. </div>
  38. <!-- 内容区域 -->
  39. <div class="chapter-edit-container">
  40. <ion-button (click)="openAiContinueModal()">AI续写</ion-button>
  41. <ion-button (click)="openAiPolishModal()">AI润色</ion-button>
  42. <ion-button (click)="openAiExpandModal()">AI扩写</ion-button>
  43. @if(selectedChapterIndex !== null){
  44. <ion-item>
  45. <ion-label position="floating">章节标题</ion-label>
  46. <ion-input [(ngModel)]="selectedChapterTitle"></ion-input>
  47. </ion-item>
  48. <ion-label position="floating">章节内容</ion-label>
  49. <ion-item>
  50. <textarea [(ngModel)]="selectedChapterContent" style="width: 100%; height: 300px;"></textarea>
  51. </ion-item>
  52. <ion-button (click)="saveChapter()" expand="block" color="success">保存章节</ion-button>
  53. }
  54. @else {
  55. <p>请选择一个章节进行编辑。</p>
  56. }
  57. </div>
  58. </div>
  59. <!-- 悬浮球 -->
  60. <ion-fab vertical="bottom" horizontal="end" slot="fixed">
  61. <ion-fab-button (click)="toggleSide()">
  62. <ion-icon name="add"></ion-icon>
  63. </ion-fab-button>
  64. </ion-fab>
  65. </ion-content>