|
@@ -112,7 +112,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="center" width="330">
|
|
<el-table-column label="操作" align="center" width="330">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <div >
|
|
|
|
|
|
+ <div>
|
|
<el-tooltip
|
|
<el-tooltip
|
|
class="item"
|
|
class="item"
|
|
effect="dark"
|
|
effect="dark"
|
|
@@ -133,14 +133,14 @@
|
|
class="item"
|
|
class="item"
|
|
effect="dark"
|
|
effect="dark"
|
|
:content="
|
|
:content="
|
|
- scope.row.run === 1 || scope.row.run === 5
|
|
|
|
|
|
+ scope.row.run ==1 || scope.row.run ==5
|
|
? '解析中'
|
|
? '解析中'
|
|
: '解析'
|
|
: '解析'
|
|
"
|
|
"
|
|
placement="top"
|
|
placement="top"
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
- v-if="scope.row.run !== 1 && scope.row.run !== 5"
|
|
|
|
|
|
+ v-if="scope.row.run !=1 && scope.row.run !=5"
|
|
type="text"
|
|
type="text"
|
|
icon="el-icon-caret-right"
|
|
icon="el-icon-caret-right"
|
|
circle
|
|
circle
|
|
@@ -295,7 +295,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button @click="handleAnalClose">取 消</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="handleAnalClose">取 消</el-button>
|
|
<el-button type="primary" @click="submitAnal">确 定</el-button>
|
|
<el-button type="primary" @click="submitAnal">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -314,7 +314,9 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button @click="newFolderDialogVisible = false">取 消</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="newFolderDialogVisible = false"
|
|
|
|
+ >取 消</el-button
|
|
|
|
+ >
|
|
<el-button type="primary" @click="submitNewFolder">确 定</el-button>
|
|
<el-button type="primary" @click="submitNewFolder">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -345,7 +347,9 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button @click="batchModifyFolderDialogVisible = false"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="batchModifyFolderDialogVisible = false"
|
|
>取 消</el-button
|
|
>取 消</el-button
|
|
>
|
|
>
|
|
<el-button type="primary" @click="submitBatchModifyFolder"
|
|
<el-button type="primary" @click="submitBatchModifyFolder"
|
|
@@ -577,7 +581,10 @@ export default {
|
|
|
|
|
|
typeList() {
|
|
typeList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- Promise.all([selectTypeList(this.typeForm), selectType0({ kb_id:this.typeForm.kb_id,type_id: 0 })])
|
|
|
|
|
|
+ Promise.all([
|
|
|
|
+ selectTypeList(this.typeForm),
|
|
|
|
+ selectType0({ kb_id: this.typeForm.kb_id, type_id: 0 }),
|
|
|
|
+ ])
|
|
.then(([typeListRes, type0Res]) => {
|
|
.then(([typeListRes, type0Res]) => {
|
|
if (typeListRes.status === 200 && type0Res.status === 200) {
|
|
if (typeListRes.status === 200 && type0Res.status === 200) {
|
|
const folderList = typeListRes.data.dataList.map((folder) => ({
|
|
const folderList = typeListRes.data.dataList.map((folder) => ({
|
|
@@ -780,8 +787,9 @@ export default {
|
|
},
|
|
},
|
|
/* 解析 */
|
|
/* 解析 */
|
|
analysis(row) {
|
|
analysis(row) {
|
|
- if (row.run === 1 || row.run === 5) return;
|
|
|
|
|
|
+ if (row.run ==1 || row.run ==5) return;
|
|
|
|
|
|
|
|
+ // Set the status to "解析中" (1) immediately
|
|
this.$set(row, "run", 1);
|
|
this.$set(row, "run", 1);
|
|
|
|
|
|
analysis({
|
|
analysis({
|
|
@@ -792,6 +800,7 @@ export default {
|
|
})
|
|
})
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.status === 200) {
|
|
if (res.status === 200) {
|
|
|
|
+ // Start checking the status immediately after successful API call
|
|
this.startAnalysisStatusChecker(row);
|
|
this.startAnalysisStatusChecker(row);
|
|
} else {
|
|
} else {
|
|
this.$message.error("解析请求失败");
|
|
this.$message.error("解析请求失败");
|
|
@@ -806,7 +815,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
startAnalysisStatusChecker(row) {
|
|
startAnalysisStatusChecker(row) {
|
|
- // 如果已经有一个检查器在运行,先停止它
|
|
|
|
|
|
+ // Clear any existing checker for this row
|
|
if (this.analysisStatusCheckers[row.id]) {
|
|
if (this.analysisStatusCheckers[row.id]) {
|
|
clearTimeout(this.analysisStatusCheckers[row.id]);
|
|
clearTimeout(this.analysisStatusCheckers[row.id]);
|
|
}
|
|
}
|
|
@@ -825,7 +834,7 @@ export default {
|
|
this.$message.error("解析失败");
|
|
this.$message.error("解析失败");
|
|
delete this.analysisStatusCheckers[row.id];
|
|
delete this.analysisStatusCheckers[row.id];
|
|
} else if (newStatus === 1 || newStatus === 5) {
|
|
} else if (newStatus === 1 || newStatus === 5) {
|
|
- // 继续检查
|
|
|
|
|
|
+ // Continue checking
|
|
this.analysisStatusCheckers[row.id] = setTimeout(
|
|
this.analysisStatusCheckers[row.id] = setTimeout(
|
|
checkStatus,
|
|
checkStatus,
|
|
5000 + Math.random() * 5000
|
|
5000 + Math.random() * 5000
|
|
@@ -833,19 +842,17 @@ export default {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.$message.error("获取解析状态失败");
|
|
this.$message.error("获取解析状态失败");
|
|
- this.$set(row, "run", 0);
|
|
|
|
delete this.analysisStatusCheckers[row.id];
|
|
delete this.analysisStatusCheckers[row.id];
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
console.error("获取解析状态错误:", error);
|
|
console.error("获取解析状态错误:", error);
|
|
this.$message.error("获取解析状态时出现错误");
|
|
this.$message.error("获取解析状态时出现错误");
|
|
- this.$set(row, "run", 0);
|
|
|
|
delete this.analysisStatusCheckers[row.id];
|
|
delete this.analysisStatusCheckers[row.id];
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
- // 立即开始第一次检查
|
|
|
|
|
|
+ // Start checking immediately
|
|
checkStatus();
|
|
checkStatus();
|
|
},
|
|
},
|
|
|
|
|
|
@@ -1039,7 +1046,7 @@ export default {
|
|
|
|
|
|
// Initialize the analysis status for each row
|
|
// Initialize the analysis status for each row
|
|
_this.dataList.forEach((row) => {
|
|
_this.dataList.forEach((row) => {
|
|
- if (row.run === 1) {
|
|
|
|
|
|
+ if (row.run == 1 || row.run ==5) {
|
|
_this.startAnalysisStatusChecker(row);
|
|
_this.startAnalysisStatusChecker(row);
|
|
}
|
|
}
|
|
});
|
|
});
|