TemplateDetail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <div class="template-detail-page">
  3. <!-- 顶部栏 -->
  4. <div class="detail-header">
  5. <div class="header-left">
  6. <el-button text @click="goBack" class="back-btn">
  7. <span style="font-size: 18px; margin-right: 8px"> <SvgIcon name="goback" /> </span>返回
  8. </el-button>
  9. <el-divider direction="vertical" />
  10. <span class="breadcrumb">模板</span>
  11. </div>
  12. <div class="template-title">{{ currentTemplate?.title }}</div>
  13. <el-button type="primary" @click="useTemplate"> 使用此工作流程 </el-button>
  14. </div>
  15. <!-- 详情内容 -->
  16. <div class="detail-content">
  17. <!-- 流程图占位 -->
  18. <div class="workflow-diagram">
  19. <div class="diagram-placeholder">流程图占位</div>
  20. </div>
  21. <!-- 下方说明文本 -->
  22. <div class="detail-description">
  23. <h3>{{ currentTemplate?.title }}</h3>
  24. <p>{{ currentTemplate?.description }}</p>
  25. <p class="detail-text">
  26. 此工作流程通过自动化手段连接电子邮件服务、AI 模型和数据库,帮助您高效管理和处理大量信息。
  27. </p>
  28. </div>
  29. </div>
  30. </div>
  31. </template>
  32. <script setup lang="ts">
  33. import { ref, onMounted } from 'vue'
  34. import { useRouter, useRoute } from 'vue-router'
  35. interface Template {
  36. id: string
  37. title: string
  38. description: string
  39. icon: string
  40. }
  41. const router = useRouter()
  42. const route = useRoute()
  43. const currentTemplate = ref<Template | null>(null)
  44. const templates: Record<string, Template> = {
  45. '1': {
  46. id: '1',
  47. title: 'Gmail + GPT-4o-mini',
  48. description: '使用 Gmail、GPT-4o-mini 和 Notion 自动处理电子邮件分类和摘要',
  49. icon: '✉️'
  50. },
  51. '2': {
  52. id: '2',
  53. title: 'Telegram + OpenAI',
  54. description: '使用 Telegram、OpenAI 和 Google Drive 将聊天内容分类为搜索引擎,并生成 PDF 文件',
  55. icon: '💬'
  56. },
  57. '3': {
  58. id: '3',
  59. title: 'Gmail + Memo RAG',
  60. description: '由 Gmail 和 Memo 提供持有的 RAG 代码的电子邮件分析',
  61. icon: '📧'
  62. },
  63. '4': {
  64. id: '4',
  65. title: 'Mistral + OpenRouter',
  66. description: '使用 Mistral 通过 OpenRouter 与 AI 模型处理工作流',
  67. icon: '🤖'
  68. },
  69. '5': {
  70. id: '5',
  71. title: 'RAG 架构',
  72. description: '基于 Supabase、TogetherAI 和 OpenRouter 的 RAG 架构',
  73. icon: '🔍'
  74. },
  75. '6': {
  76. id: '6',
  77. title: 'LINE + Supabase',
  78. description: '结合 LINE Messaging、Supabase Vector DB 和 Gmail 的 AI 综合应用本表记功能',
  79. icon: '💌'
  80. }
  81. }
  82. onMounted(() => {
  83. const templateId = route.params.id as string
  84. currentTemplate.value = templates[templateId] || null
  85. })
  86. // 返回上一个路由,保留所有参数
  87. const goBack = () => {
  88. router.back()
  89. }
  90. // 使用此工作流程,跳转到编辑器
  91. const useTemplate = () => {
  92. router.push('/workflow/0')
  93. }
  94. </script>
  95. <style lang="less" scoped>
  96. .template-detail-page {
  97. height: 100%;
  98. display: flex;
  99. flex-direction: column;
  100. background: var(--bg-page);
  101. .detail-header {
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. padding: 0 24px;
  106. border-bottom: 1px solid var(--border-light);
  107. height: 50px;
  108. .header-left {
  109. display: flex;
  110. align-items: center;
  111. font-size: 14px;
  112. color: var(--text-secondary);
  113. .back-btn {
  114. padding: 0;
  115. color: var(--el-color-primary);
  116. font-size: 14px;
  117. &:hover {
  118. color: var(--el-color-primary-dark-2);
  119. }
  120. }
  121. :deep(.el-divider--vertical) {
  122. margin: 0 12px;
  123. height: 20px;
  124. background-color: var(--border-light);
  125. }
  126. .breadcrumb {
  127. color: var(--text-secondary);
  128. }
  129. }
  130. .template-title {
  131. flex: 1;
  132. text-align: center;
  133. font-size: 18px;
  134. font-weight: 600;
  135. color: var(--text-primary);
  136. margin: 0 24px;
  137. }
  138. }
  139. .detail-content {
  140. flex: 1;
  141. overflow-y: auto;
  142. padding: 32px 24px;
  143. display: flex;
  144. flex-direction: column;
  145. gap: 32px;
  146. .workflow-diagram {
  147. flex: 1;
  148. min-height: 400px;
  149. background: var(--bg-container);
  150. border: 1px solid var(--border-light);
  151. border-radius: 8px;
  152. display: flex;
  153. align-items: center;
  154. justify-content: center;
  155. overflow: hidden;
  156. .diagram-placeholder {
  157. font-size: 14px;
  158. color: var(--text-tertiary);
  159. }
  160. }
  161. .detail-description {
  162. padding: 24px;
  163. background: var(--bg-container);
  164. border-radius: 8px;
  165. h3 {
  166. font-size: 16px;
  167. font-weight: 600;
  168. color: var(--text-primary);
  169. margin: 0 0 12px 0;
  170. }
  171. p {
  172. font-size: 14px;
  173. color: var(--text-secondary);
  174. margin: 0 0 8px 0;
  175. line-height: 1.6;
  176. &.detail-text {
  177. color: var(--text-secondary);
  178. }
  179. }
  180. }
  181. }
  182. }
  183. </style>