Эх сурвалжийг харах

添加滚动翻页及首页部分样式更改

yangg 7 сар өмнө
parent
commit
23dea05a7d

+ 1 - 1
.env.development

@@ -3,7 +3,7 @@ ENV = 'development'
 port = 8080
 # base api
 VUE_APP_BASE_AI_API='https://ylaiapi.raycos.com.cn'
-VUE_APP_BASE_API = 'http://192.168.66.208:8084'
+VUE_APP_BASE_API = 'http://183.195.216.54:8084'
 #192.168.66.208
 #朱:192.168.66.163
 #测试服务器:121.36.251.245

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/index.html


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/css/chunk-16c4b6aa.ca27bb14.css


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/css/chunk-194e2959.b3755e62.css


+ 0 - 1
dist/static/css/chunk-620d0711.424a0e4e.css

@@ -1 +0,0 @@
-.project-search[data-v-8ffea030]{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px;font-size:12px}.listClass[data-v-8ffea030]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.excel-table[data-v-8ffea030]{width:100%;overflow-y:auto}.excel-table table[data-v-8ffea030]{border-collapse:collapse;width:100%;margin-bottom:20px}.excel-table td[data-v-8ffea030],.excel-table th[data-v-8ffea030]{border:1px solid #ddd;padding:8px;text-align:left;white-space:nowrap}.excel-table th[data-v-8ffea030]{background-color:#f2f2f2;font-weight:700;position:sticky;top:0;z-index:1}.excel-table tr[data-v-8ffea030]:nth-child(2n){background-color:#f9f9f9}.no-data[data-v-8ffea030]{font-size:18px;color:#909399;text-align:center;margin-top:50px}.pagination[data-v-8ffea030]{position:fixed;bottom:0;right:51%}.movable-dialog[data-v-8ffea030]{position:absolute!important}[data-v-8ffea030] .el-dialog__header{cursor:move}

+ 1 - 0
dist/static/css/chunk-6c81d65e.7487f033.css

@@ -0,0 +1 @@
+.project-search[data-v-de6f7f10]{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px;font-size:12px}.listClass[data-v-de6f7f10]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.excel-table[data-v-de6f7f10]{width:100%;overflow-y:auto}.excel-table table[data-v-de6f7f10]{border-collapse:collapse;width:100%;margin-bottom:20px}.excel-table td[data-v-de6f7f10],.excel-table th[data-v-de6f7f10]{border:1px solid #ddd;padding:8px;text-align:left;white-space:nowrap}.excel-table th[data-v-de6f7f10]{background-color:#f2f2f2;font-weight:700;position:sticky;top:0;z-index:1}.excel-table tr[data-v-de6f7f10]:nth-child(2n){background-color:#f9f9f9}.no-data[data-v-de6f7f10]{font-size:18px;color:#909399;text-align:center;margin-top:50px}.pagination[data-v-de6f7f10]{position:fixed;bottom:0;right:51%}.movable-dialog[data-v-de6f7f10]{position:absolute!important}[data-v-de6f7f10] .el-dialog__header{cursor:move}.loading-more[data-v-de6f7f10]{text-align:center;padding:10px 0;color:#909399}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/css/chunk-e2b9dfdc.efe6f170.css


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/js/app.7e7cce7c.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/js/chunk-16c4b6aa.4a27728a.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/js/chunk-194e2959.4082741d.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/js/chunk-57ca2e2b.b7478c6b.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/js/chunk-620d0711.dedb4071.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/js/chunk-6c81d65e.6e64ae41.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
dist/static/js/chunk-e2b9dfdc.9f15f426.js


+ 15 - 14
src/views/dashboard/admin/chart.vue

@@ -53,21 +53,22 @@
                         <div class="card-body">
                           <div class="row mb-2">
                             <div class="col-auto">
-                              <h4 class="m-0">
-                                {{ cpuValue + "%"
-                                }}<i
+                              <h2 class="m-0">
+                                <strong>{{ cpuValue + "%"
+                                }}</strong>
+                                <i
                                   class="feather icon-arrow-up text-c-green"
                                 ></i>
-                              </h4>
+                              </h2>
                               <span>CPU使用率</span>
                             </div>
                             <div class="col-auto">
-                              <h4 class="m-0">
-                                {{ GpuValue + "%"
-                                }}<i
+                              <h2 class="m-0">
+                                <strong>{{ GpuValue + "%"
+                                }}</strong><i
                                   class="feather icon-arrow-down text-c-red"
                                 ></i>
-                              </h4>
+                              </h2>
                               <span>GPU使用率</span>
                             </div>
                             <!--  <div class="col">
@@ -496,7 +497,7 @@
                           <div class="card">
                             <div class="card-body">
                               <span>知识库数量</span>
-                              <h3>{{ kenList.length }}</h3>
+                              <h2><strong>{{ kenList.length }}</strong></h2>
                               <div
                                 ref="real4Chart"
                                 style="height: 20px; width: 100%"
@@ -510,7 +511,7 @@
                           <div class="card">
                             <div class="card-body">
                               <span>文件已解析数量</span>
-                              <h3>{{ docList.run_3 }}</h3>
+                              <h2><strong>{{ docList.run_3 }}</strong></h2>
                               <div
                                 ref="real6Chart"
                                 style="height: 20px; width: 100%"
@@ -524,7 +525,7 @@
                           <div class="card">
                             <div class="card-body">
                               <span>文件未解析数量</span>
-                              <h3>{{ docList.run_0 }}</h3>
+                              <h2><strong>{{ docList.run_0 }}</strong></h2>
                               <div
                                 ref="real1Chart"
                                 style="height: 20px; width: 100%"
@@ -538,7 +539,7 @@
                           <div class="card">
                             <div class="card-body">
                               <span>文档数量</span>
-                              <h3>{{ docTotal }}</h3>
+                              <h2><strong>{{ docTotal }}</strong></h2>
                               <div
                                 ref="real5Chart"
                                 style="height: 20px; width: 100%"
@@ -552,7 +553,7 @@
                           <div class="card">
                             <div class="card-body">
                               <span>模版数量</span>
-                              <h3>{{ temTotal }}</h3>
+                              <h2><strong>{{ temTotal }}</strong></h2>
                               <div
                                 ref="real2Chart"
                                 style="height: 20px; width: 100%"
@@ -566,7 +567,7 @@
                           <div class="card">
                             <div class="card-body">
                               <span>模块数量</span>
-                              <h3>{{ pageTotal }}</h3>
+                              <h2><strong>{{ pageTotal }}</strong></h2>
                               <div
                                 ref="real3Chart"
                                 style="height: 20px; width: 100%"

+ 83 - 12
src/views/knowledgeMenu/category/infoList.vue

@@ -8,13 +8,13 @@
         position: relative;
       "
       v-if="dataList.length !== 0"
+      @scroll="handleScroll"
+      ref="scrollContainer"
     >
       <div v-for="item in dataList" :key="item.id" class="listClass">
-        <span style="
-            
-            padding: 10px 10px 10px 0;
-            cursor: pointer;
-          ">{{ item.page_number }}</span>
+        <span style="padding: 0px 10px 10px 0; cursor: pointer">{{
+          item.page_number
+        }}</span>
         <!--  <img
           :src="item.url"
           alt=""
@@ -27,7 +27,7 @@
           "
         /> -->
         <div
-          style="padding-bottom: 20px"
+          style="margin-bottom: 20px"
           v-html="item.content"
           @click="scrollToPage(item.page_number, item.coordinate)"
         ></div>
@@ -43,7 +43,7 @@
         <img :src="previewImageUrl" style="width: 100%" alt="Preview" />
       </el-dialog>
       <!-- 分页控件 -->
-     <!--  <div class="pagination">
+      <!--  <div class="pagination">
         <el-pagination
           @current-change="handleCurrentChange"
           :current-page="queryForm.page"
@@ -53,6 +53,7 @@
         >
         </el-pagination>
       </div> -->
+      <div v-if="loading" class="loading-more">加载中...</div>
     </div>
     <div
       v-else
@@ -134,7 +135,7 @@ export default {
     return {
       queryForm: {
         page: 1,
-        page_size: 9999,
+        page_size: 30,
         document_id: "",
       },
       dataList: [],
@@ -162,6 +163,9 @@ export default {
       previewImageUrl: "",
       pdfPageNum: "",
       pdfCoordinate: "",
+      loading: false,
+      hasMore: true,
+      totalPages: 0,
     };
   },
   mounted() {
@@ -255,19 +259,31 @@ export default {
     },
 
     search() {
+      this.loading = true;
+      this.queryForm.page = 1;
+      this.hasMore = true;
+      this.dataList = [];
+      this.totalPages = 0;
+
       searchTaskInfo(this.queryForm)
         .then((res) => {
           this.dataList = res.data.tasks;
           this.total = res.data.pagination.total_count;
+          this.totalPages = res.data.pagination.num_pages;
+
+          if (this.totalPages <= 1) {
+            this.hasMore = false;
+          }
+
           if (this.isFileViewable) {
             this.documentUrl = res.data.documentUrl;
-          } else {
-            console.log("文件类型不支持预览");
-            // 可以在这里添加下载按钮的逻辑
           }
         })
         .catch((error) => {
           console.error("获取数据时出错:", error);
+        })
+        .finally(() => {
+          this.loading = false;
         });
     },
 
@@ -323,6 +339,56 @@ export default {
         filePreviewComponent.scrollToPage(pageNumber);
       }
     },
+    handleScroll() {
+      const container = this.$refs.scrollContainer;
+      if (!container) return;
+
+      // 距离底部100px时触发加载
+      const bottomOffset = 100;
+      const scrollBottom =
+        container.scrollHeight - container.scrollTop - container.clientHeight;
+
+      if (scrollBottom < bottomOffset && !this.loading && this.hasMore) {
+        this.loadMore();
+      }
+    },
+    loadMore() {
+      if (this.loading || !this.hasMore) return;
+
+      if (this.totalPages && this.queryForm.page >= this.totalPages) {
+        this.hasMore = false;
+        return;
+      }
+
+      this.loading = true;
+      this.queryForm.page += 1;
+
+      searchTaskInfo(this.queryForm)
+        .then((res) => {
+          const newTasks = res.data.tasks;
+          this.totalPages = res.data.pagination.num_pages;
+
+          // 确保先添加新数据
+          if (newTasks && newTasks.length > 0) {
+            this.dataList = [...this.dataList, ...newTasks];
+          }
+
+          // 然后再判断是否是最后一页
+          if (this.queryForm.page >= this.totalPages) {
+            this.hasMore = false;
+          }
+
+          this.total = res.data.pagination.total_count;
+        })
+        .catch((error) => {
+          console.error("加载更多数据时出错:", error);
+          // 发生错误时重置页码
+          this.queryForm.page -= 1;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
   },
 };
 </script>
@@ -335,8 +401,8 @@ export default {
 }
 .listClass {
   display: flex;
+  justify-content: flex-start;
   align-items: center;
-  justify-content: space-between;
 }
 .excel-table {
   width: 100%;
@@ -387,5 +453,10 @@ export default {
 ::v-deep .el-dialog__header {
   cursor: move;
 }
+.loading-more {
+  text-align: center;
+  padding: 10px 0;
+  color: #909399;
+}
 </style>
     

+ 9 - 6
src/views/knowledgeMenu/category/knowledgeSet.vue

@@ -540,8 +540,8 @@ export default {
       analForm: {
         start_page: 1,
         end_page: 10000,
-        token_num: 0,
-        language:'zh'
+        token_num: 512,
+        language: "en",
       },
       analRules: {},
       selectedRows: [],
@@ -1155,7 +1155,7 @@ export default {
           this.$set(row, "run", 0);
         });
     },
-
+    /* 任务监控 */
     startAnalysisStatusChecker(row) {
       // Clear any existing checker for this row
       if (this.analysisStatusCheckers[row.id]) {
@@ -1203,7 +1203,10 @@ export default {
           .then((res) => {
             if (res.status === 200) {
               const newStatus = Number(res.data.document_status);
-              const newProgress = Number(res.data.progress);
+              const newProgress =
+                Number(res.data.progress) == 100
+                  ? 0
+                  : Number(res.data.progress);
               const newProgressMsg = res.data.progress_msg;
               this.$set(row, "run", newStatus);
               this.$set(row, "progress", newProgress);
@@ -1266,7 +1269,7 @@ export default {
     submitAnal() {
       this.dataList.map((el) => {
         if (this.analForm.id == el.id) {
-          el.language=this.analForm.language
+          el.language = this.analForm.language;
           el.start_page = this.analForm.start_page;
           el.end_page = this.analForm.end_page;
           el.token_num = this.analForm.token_num;
@@ -1416,7 +1419,7 @@ export default {
             }
             _this.dataList = res.data.documents.map((el) => ({
               ...el,
-              token_num: 256,
+              token_num: 512,
               start_page: _this.analForm.start_page,
               end_page: _this.analForm.end_page,
             }));

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно