dataset.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="knowledge-base-container">
  3. <div class="card-container">
  4. <el-card class="create-card" shadow="hover">
  5. <div class="create-content">
  6. <el-icon class="create-icon"><Plus /></el-icon>
  7. <span class="create-text">创建知识库</span>
  8. </div>
  9. <div class="create-footer">
  10. 导入您自己的文本数据或通过 Webhook 实时写入数据以增强 LLM 的上下文。
  11. </div>
  12. </el-card>
  13. <el-card class="document-card" shadow="hover" v-for="index in 4" :key="index">
  14. <div class="document-header">
  15. <el-icon><Folder /></el-icon>
  16. <span>接口鉴权示例代码.md</span>
  17. </div>
  18. <div class="document-info">
  19. <el-tag size="small">1 文档</el-tag>
  20. <el-tag size="small" type="info">5 千字符</el-tag>
  21. <el-tag size="small" type="warning">0 关联应用</el-tag>
  22. </div>
  23. <p class="document-description">
  24. useful for when you want to answer queries about the 接口鉴权示例代码.md
  25. </p>
  26. </el-card>
  27. </div>
  28. <div class="pagination-container">
  29. <el-pagination
  30. v-model:current-page="currentPage"
  31. v-model:page-size="pageSize"
  32. :page-sizes="[10, 20, 30, 40]"
  33. :small="false"
  34. :disabled="false"
  35. :background="true"
  36. layout="total, sizes, prev, pager, next, jumper"
  37. :total="total"
  38. @size-change="handleSizeChange"
  39. @current-change="handleCurrentChange"
  40. />
  41. </div>
  42. </div>
  43. </template>
  44. <script setup>
  45. import { ref } from 'vue'
  46. import { Folder, Plus } from '@element-plus/icons-vue'
  47. const currentPage = ref(1)
  48. const pageSize = ref(10)
  49. const total = ref(100) // 假设总共有100条数据
  50. const handleSizeChange = (val) => {
  51. console.log(`每页 ${val} 条`)
  52. }
  53. const handleCurrentChange = (val) => {
  54. console.log(`当前页: ${val}`)
  55. }
  56. </script>
  57. <style scoped>
  58. .knowledge-base-container {
  59. font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
  60. position: absolute;
  61. padding: 20px;
  62. margin: 0 auto;
  63. display: flex;
  64. flex-direction: column;
  65. top: 0;
  66. bottom: 40px;
  67. width: 100%;
  68. }
  69. .card-container {
  70. display: flex;
  71. flex-wrap: wrap; /* Enable wrapping */
  72. gap: 20px;
  73. margin-bottom: auto; /* Pushes pagination to the bottom */
  74. }
  75. .create-card, .document-card {
  76. flex: 1 1 360px; /* Allow cards to grow and shrink */
  77. min-width: 0;
  78. max-width: 400px;
  79. border-radius: 10px;
  80. cursor: pointer;
  81. }
  82. .create-card {
  83. background-color: rgba(168, 168, 168, 0.22);
  84. }
  85. .create-card:hover {
  86. background-color: #fff;
  87. }
  88. .create-content {
  89. display: flex;
  90. align-items: center;
  91. gap: 10px;
  92. margin-bottom: 15px;
  93. }
  94. .create-icon {
  95. font-size: 24px;
  96. color: #409EFF;
  97. }
  98. .create-text {
  99. font-size: 18px;
  100. font-weight: bold;
  101. color: #303133;
  102. }
  103. .create-footer {
  104. font-size: 14px;
  105. color: #909399;
  106. line-height: 1.5;
  107. }
  108. .document-header {
  109. display: flex;
  110. align-items: center;
  111. gap: 10px;
  112. font-size: 16px;
  113. font-weight: bold;
  114. margin-bottom: 15px;
  115. }
  116. .document-info {
  117. display: flex;
  118. gap: 10px;
  119. margin-bottom: 15px;
  120. }
  121. .document-description {
  122. color: #606266;
  123. font-size: 14px;
  124. line-height: 1.5;
  125. }
  126. .pagination-container {
  127. position: absolute;
  128. width: 100%;
  129. bottom: 0;
  130. display: flex;
  131. justify-content: center;
  132. margin-top: 20px;
  133. }
  134. </style>