|
@@ -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
|