Răsfoiți Sursa

切换解析状态接口

yangg 7 luni în urmă
părinte
comite
fb25d25738

+ 2 - 2
.env.development

@@ -2,7 +2,7 @@
 ENV = 'development'
 port = 8080
 # base api
-VUE_APP_BASE_API = 'http://121.36.251.245:8084'
-#192.168.66.187
+VUE_APP_BASE_API = 'http://192.168.66.208:8084'
+#192.168.66.208
 #测试服务器:121.36.251.245:8084
 #183.195.216.54

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/index.html


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/css/chunk-240a34fe.13ca31d4.css


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/app.ae49ac30.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-240a34fe.7ae7f5bc.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
dist/static/js/chunk-2fed8cf3.ecc13420.js


+ 40 - 5
src/views/knowledgeMenu/category/knowledgeSet.vue

@@ -176,7 +176,7 @@
                       effect="dark"
                       :content="
                         scope.row.run == 1 || scope.row.run == 5
-                          ? `已解析数:${scope.row.progress}`
+                          ? `当前状态:${getStatusText(scope.row.run)/* scope.row.progress */} 解析说明:${scope.row.progress_msg}`
                           : '解析'
                       "
                       placement="top"
@@ -932,10 +932,9 @@ export default {
       if (this.analysisStatusCheckers[row.id]) {
         clearTimeout(this.analysisStatusCheckers[row.id]);
       }
-
-      const checkStatus = () => {
-        resultTask(row.id)
-          /*   getdocpro({ document_id: row.id }) */
+      /* 获取token数 */
+     /*  const checkStatus = () => {
+        getdocpro({ document_id: row.id })
           .then((res) => {
             if (res.status === 200) {
               const newStatus = Number(res.data.status);
@@ -968,6 +967,42 @@ export default {
             this.$message.error("获取解析状态时出现错误");
             delete this.analysisStatusCheckers[row.id];
           });
+      }; */
+      /* 监控任务 */
+      const checkStatus = () => {
+         resultTask(row.id)
+          .then((res) => {
+            if (res.status === 200) {
+              const newStatus = Number(res.data.document_status);
+              const newProgress = res.data.progress_msg
+              this.$set(row, "run", newStatus);
+              this.$set(row, "progress_msg", newProgress);
+
+              if (newStatus === 3) {
+                this.$message.success("解析成功");
+                delete this.analysisStatusCheckers[row.id];
+                // 在这里添加刷新列表的逻辑
+                this.refreshCurrentList();
+              } else if (newStatus === 4) {
+                this.$message.error("解析失败");
+                delete this.analysisStatusCheckers[row.id];
+              } else if (newStatus === 1 || newStatus === 5) {
+                // Continue checking
+                this.analysisStatusCheckers[row.id] = setTimeout(
+                  checkStatus,
+                  15000
+                );
+              }
+            } else {
+              this.$message.error("获取解析状态失败");
+              delete this.analysisStatusCheckers[row.id];
+            }
+          })
+          .catch((error) => {
+            console.error("获取解析状态错误:", error);
+            this.$message.error("获取解析状态时出现错误");
+            delete this.analysisStatusCheckers[row.id];
+          });
       };
 
       // Start checking immediately

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff