|
@@ -64,24 +64,59 @@
|
|
element-loading-text="加载中..."
|
|
element-loading-text="加载中..."
|
|
>
|
|
>
|
|
<div class="batch-actions" style="margin: 10px 0">
|
|
<div class="batch-actions" style="margin: 10px 0">
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- @click="batchAnalysis"
|
|
|
|
|
|
+ <el-dropdown
|
|
|
|
+ @command="handleBatchCommand"
|
|
:disabled="!selectedRows.length"
|
|
:disabled="!selectedRows.length"
|
|
- >批量解析</el-button
|
|
|
|
>
|
|
>
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- @click="batchModifyFolder"
|
|
|
|
- :disabled="!selectedRows.length"
|
|
|
|
- >批量修改目录</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- @click="batchDelect"
|
|
|
|
- :disabled="!selectedRows.length"
|
|
|
|
- >批量删除</el-button
|
|
|
|
|
|
+ <el-button type="primary" style="color: #fff">
|
|
|
|
+ 批量操作
|
|
|
|
+ <i data-feather="chevron-down" class="el-icon--right icons"></i>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
|
+ <el-dropdown-item command="analysis">
|
|
|
|
+ <i data-feather="play" class="icons"></i> 批量解析
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item command="modifyFolder">
|
|
|
|
+ <i data-feather="folder" class="icons"></i> 批量修改目录
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item command="delete">
|
|
|
|
+ <i data-feather="trash-2" class="icons"></i> 批量删除
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
+ </el-dropdown>
|
|
|
|
+ <el-button type="danger" @click="endAnalysis()">
|
|
|
|
+ <i data-feather="stop-circle" class="icons"></i>
|
|
|
|
+ 终止所有任务
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="selection-control" v-if="selectedRows.length > 0">
|
|
|
|
+ <el-alert
|
|
|
|
+ type="info"
|
|
|
|
+ show-icon
|
|
|
|
+ :closable="false"
|
|
|
|
+ style="margin-bottom: 10px"
|
|
>
|
|
>
|
|
|
|
+ <template v-if="!isAllDataSelected">
|
|
|
|
+ <!-- <span>已选择 {{ selectedRows.length }} 项</span> -->
|
|
|
|
+ <span
|
|
|
|
+ type="text"
|
|
|
|
+ style="cursor: pointer; color: #409eff; margin-left: 10px"
|
|
|
|
+ @click="handleSelectAllData"
|
|
|
|
+ >
|
|
|
|
+ 选择全部{{ recordCount }}条数据
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <span>已选择全部{{ recordCount }}条数据</span>
|
|
|
|
+ <span
|
|
|
|
+ type="text"
|
|
|
|
+ style="cursor: pointer; color: #409eff; margin-left: 10px"
|
|
|
|
+ @click="handleCancelAllSelection"
|
|
|
|
+ >
|
|
|
|
+ 取消全选
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-alert>
|
|
</div>
|
|
</div>
|
|
<el-table
|
|
<el-table
|
|
ref="dataTable"
|
|
ref="dataTable"
|
|
@@ -91,8 +126,13 @@
|
|
empty-text="暂无数据"
|
|
empty-text="暂无数据"
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
@sort-change="handleSortChange"
|
|
@sort-change="handleSortChange"
|
|
|
|
+ :row-key="getRowKey"
|
|
>
|
|
>
|
|
- <el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ type="selection"
|
|
|
|
+ width="55"
|
|
|
|
+ :reserve-selection="true"
|
|
|
|
+ ></el-table-column>
|
|
<el-table-column prop="id" label="ID" align="center" width="80" />
|
|
<el-table-column prop="id" label="ID" align="center" width="80" />
|
|
<el-table-column prop="name" label="文件名称" sortable width="350">
|
|
<el-table-column prop="name" label="文件名称" sortable width="350">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
@@ -110,9 +150,41 @@
|
|
/>
|
|
/>
|
|
<el-table-column prop="run" label="解析状态" align="center">
|
|
<el-table-column prop="run" label="解析状态" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <el-tag :type="getStatusType(scope.row.run)" size="small">
|
|
|
|
- {{ getStatusText(scope.row.run) }}
|
|
|
|
- </el-tag>
|
|
|
|
|
|
+ <el-tooltip
|
|
|
|
+ effect="dark"
|
|
|
|
+ placement="top"
|
|
|
|
+ :disabled="
|
|
|
|
+ Number(scope.row.run) !== 1 &&
|
|
|
|
+ Number(scope.row.run) !== 4
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <template #content>
|
|
|
|
+ <div style="padding: 5px">
|
|
|
|
+ <div style="margin-top: 5px; font-size: 12px">
|
|
|
|
+ {{ scope.row.progress_msg || "正在解析中..." }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <div class="status-wrapper">
|
|
|
|
+ <template v-if="Number(scope.row.run) === 1">
|
|
|
|
+ <div class="progress-wrapper">
|
|
|
|
+ <el-progress
|
|
|
|
+ type="circle"
|
|
|
|
+ :percentage="Math.floor(scope.row.progress) || 0"
|
|
|
|
+ :width="35"
|
|
|
|
+ :stroke-width="4"
|
|
|
|
+ :format="percentFormat"
|
|
|
|
+
|
|
|
|
+ ></el-progress><!-- :status="getProgressStatus(scope.row.progress)" -->
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <el-tag :type="getStatusType(scope.row.run)" size="small">
|
|
|
|
+ {{ getStatusText(scope.row.run) }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ </el-tooltip>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -176,7 +248,7 @@
|
|
effect="dark"
|
|
effect="dark"
|
|
:content="
|
|
:content="
|
|
scope.row.run == 1 || scope.row.run == 5
|
|
scope.row.run == 1 || scope.row.run == 5
|
|
- ? `当前状态:${getStatusText(scope.row.run)/* scope.row.progress */} 解析说明:${scope.row.progress_msg}`
|
|
|
|
|
|
+ ? `解析中`
|
|
: '解析'
|
|
: '解析'
|
|
"
|
|
"
|
|
placement="top"
|
|
placement="top"
|
|
@@ -412,6 +484,7 @@ import {
|
|
getdocpro,
|
|
getdocpro,
|
|
analysisPro,
|
|
analysisPro,
|
|
resultTask,
|
|
resultTask,
|
|
|
|
+ endClear,
|
|
} from "@/api/knowledge";
|
|
} from "@/api/knowledge";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -455,7 +528,7 @@ export default {
|
|
},
|
|
},
|
|
wordRules: {
|
|
wordRules: {
|
|
new_name: [
|
|
new_name: [
|
|
- { required: true, message: "请输入文件名称", trigger: "blur" },
|
|
|
|
|
|
+ { required: true, message: "请输文件名称", trigger: "blur" },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
anaDialogVisible: false,
|
|
anaDialogVisible: false,
|
|
@@ -490,21 +563,51 @@ export default {
|
|
{ required: true, message: "请选择目标目录", trigger: "change" },
|
|
{ required: true, message: "请选择目标目录", trigger: "change" },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ selectedRows: [], // 已选择的行
|
|
|
|
+ allSelectedRows: new Map(), // 存储所有选中的行
|
|
|
|
+ isAllDataSelected: false, // 是否选中所有数据
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.queryForm.bucket_id = this.$route.query.id;
|
|
this.queryForm.bucket_id = this.$route.query.id;
|
|
this.typeForm.kb_id = this.$route.query.id;
|
|
this.typeForm.kb_id = this.$route.query.id;
|
|
- this.$nextTick(() => {
|
|
|
|
|
|
+ /* this.$nextTick(() => {
|
|
this.initializeTree();
|
|
this.initializeTree();
|
|
- });
|
|
|
|
|
|
+ }); */
|
|
this.typeList();
|
|
this.typeList();
|
|
- this.search();
|
|
|
|
|
|
+ /* this.search(); */
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
Object.values(this.analysisStatusCheckers).forEach(clearTimeout);
|
|
Object.values(this.analysisStatusCheckers).forEach(clearTimeout);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 获取行的唯一标识
|
|
|
|
+ getRowKey(row) {
|
|
|
|
+ return row.id;
|
|
|
|
+ },
|
|
|
|
+ /* 功按钮 */
|
|
|
|
+ handleBatchCommand(command) {
|
|
|
|
+ switch (command) {
|
|
|
|
+ case "analysis":
|
|
|
|
+ this.batchAnalysis();
|
|
|
|
+ break;
|
|
|
|
+ case "modifyFolder":
|
|
|
|
+ this.batchModifyFolder();
|
|
|
|
+ break;
|
|
|
|
+ case "delete":
|
|
|
|
+ this.batchDelect();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getProgressStatus(progress) {
|
|
|
|
+ // el-progress 只接受 'success'/'exception'/'warning' 这几个值
|
|
|
|
+ if (progress >= 100) {
|
|
|
|
+ return "success";
|
|
|
|
+ }
|
|
|
|
+ // 如果进度小于100,返回undefined,使用默认样式
|
|
|
|
+ return undefined;
|
|
|
|
+ },
|
|
/* 操作栏 */
|
|
/* 操作栏 */
|
|
handleCommand(command, row) {
|
|
handleCommand(command, row) {
|
|
switch (command) {
|
|
switch (command) {
|
|
@@ -525,12 +628,12 @@ export default {
|
|
/* 状态展示 */
|
|
/* 状态展示 */
|
|
getStatusType(status) {
|
|
getStatusType(status) {
|
|
const statusMap = {
|
|
const statusMap = {
|
|
- 0: "info", // 未解析
|
|
|
|
|
|
+ 0: "info", // 未解析
|
|
1: "warning", // 解析中
|
|
1: "warning", // 解析中
|
|
3: "success", // 成功
|
|
3: "success", // 成功
|
|
- 4: "danger", // 失败
|
|
|
|
- 5: "warning", // 待处理
|
|
|
|
- 6: "danger", // 文件异常
|
|
|
|
|
|
+ 4: "danger", // 失败
|
|
|
|
+ 5: "info", // 待解析
|
|
|
|
+ 6: "danger", // 文件异常
|
|
};
|
|
};
|
|
return statusMap[status] || "info";
|
|
return statusMap[status] || "info";
|
|
},
|
|
},
|
|
@@ -539,9 +642,9 @@ export default {
|
|
const statusMap = {
|
|
const statusMap = {
|
|
0: "未解析",
|
|
0: "未解析",
|
|
1: "解析中",
|
|
1: "解析中",
|
|
- 3: "成功",
|
|
|
|
- 4: "失败",
|
|
|
|
- 5: "待处理",
|
|
|
|
|
|
+ 3: "解析成功",
|
|
|
|
+ 4: "解析失败",
|
|
|
|
+ 5: "待解析",
|
|
6: "文件异常",
|
|
6: "文件异常",
|
|
};
|
|
};
|
|
return statusMap[status] || "未知状态";
|
|
return statusMap[status] || "未知状态";
|
|
@@ -691,11 +794,17 @@ export default {
|
|
},
|
|
},
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+ // 直接在这里执行一次性的初始化
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.initializeTree();
|
|
|
|
|
|
+ if (this.$refs.folderTree) {
|
|
|
|
+ this.$refs.folderTree.setCurrentKey("001");
|
|
|
|
+ // 只在这里调用一次 search
|
|
|
|
+ this.queryForm.doc_type_id = "";
|
|
|
|
+ this.search();
|
|
|
|
+ }
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- this.$message.error("获取文件夹列表失败");
|
|
|
|
|
|
+ this.$message.error("获取文件夹列表败");
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
@@ -707,14 +816,14 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
- initializeTree() {
|
|
|
|
|
|
+ /* initializeTree() {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
if (this.$refs.folderTree) {
|
|
if (this.$refs.folderTree) {
|
|
this.$refs.folderTree.setCurrentKey(0);
|
|
this.$refs.folderTree.setCurrentKey(0);
|
|
this.handleNodeClick(this.folders[0]);
|
|
this.handleNodeClick(this.folders[0]);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- },
|
|
|
|
|
|
+ }, */
|
|
|
|
|
|
createNewFolder() {
|
|
createNewFolder() {
|
|
this.newFolderDialogVisible = true;
|
|
this.newFolderDialogVisible = true;
|
|
@@ -737,15 +846,23 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ // 移除或简化 initializeTree 方法,因为相关逻辑已经到 typeList 中
|
|
initializeTree() {
|
|
initializeTree() {
|
|
|
|
+ // 可以保留这个方法但不执行 search
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
if (this.$refs.folderTree) {
|
|
if (this.$refs.folderTree) {
|
|
this.$refs.folderTree.setCurrentKey("001");
|
|
this.$refs.folderTree.setCurrentKey("001");
|
|
- this.handleNodeClick(this.folders[0]);
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ /* initializeTree() {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ if (this.$refs.folderTree) {
|
|
|
|
+ this.$refs.folderTree.setCurrentKey("001");
|
|
|
|
+ this.handleNodeClick(this.folders[0]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }, */
|
|
checkAuth(path) {
|
|
checkAuth(path) {
|
|
if (this.roleInfo.is_admin === 1) {
|
|
if (this.roleInfo.is_admin === 1) {
|
|
return true;
|
|
return true;
|
|
@@ -790,9 +907,96 @@ export default {
|
|
return sortOrder === "ascending" ? comparison : -comparison;
|
|
return sortOrder === "ascending" ? comparison : -comparison;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- /* 批量解析 */
|
|
|
|
- handleSelectionChange(val) {
|
|
|
|
- this.selectedRows = val;
|
|
|
|
|
|
+ /* 处理选择变化*/
|
|
|
|
+ handleSelectionChange(selection) {
|
|
|
|
+ if (!this.isAllDataSelected) {
|
|
|
|
+ // 更新当前页选中状态
|
|
|
|
+ this.dataList.forEach((row) => {
|
|
|
|
+ if (selection.find((item) => item.id === row.id)) {
|
|
|
|
+ this.allSelectedRows.set(row.id, row);
|
|
|
|
+ } else {
|
|
|
|
+ this.allSelectedRows.delete(row.id);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.selectedRows = Array.from(this.allSelectedRows.values());
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 选择全部数据
|
|
|
|
+ async handleSelectAllData() {
|
|
|
|
+ try {
|
|
|
|
+ // 构建查询参数,获取所有数据
|
|
|
|
+ const params = {
|
|
|
|
+ ...this.queryForm,
|
|
|
|
+ page: 1,
|
|
|
|
+ page_size: this.recordCount,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const response = await getBucketContents(params);
|
|
|
|
+
|
|
|
|
+ if (response.status === 200) {
|
|
|
|
+ const allData = response.data.documents;
|
|
|
|
+
|
|
|
|
+ // 清空之前的选择
|
|
|
|
+ this.allSelectedRows.clear();
|
|
|
|
+
|
|
|
|
+ // 将所有数据添加到选中集合
|
|
|
|
+ allData.forEach((item) => {
|
|
|
|
+ this.allSelectedRows.set(item.id, item);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.isAllDataSelected = true;
|
|
|
|
+ this.selectedRows = allData;
|
|
|
|
+
|
|
|
|
+ // 选中当前页显示的所有行
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ if (this.$refs.dataTable) {
|
|
|
|
+ this.dataList.forEach((row) => {
|
|
|
|
+ this.$refs.dataTable.toggleRowSelection(row, true);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.$message.success(`已选中全部${this.recordCount}条数据`);
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error("获取全部数据失败:", error);
|
|
|
|
+ this.$message.error("选择全部数据失败");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 取消全选
|
|
|
|
+ handleCancelAllSelection() {
|
|
|
|
+ this.clearSelection();
|
|
|
|
+ this.isAllDataSelected = false;
|
|
|
|
+ this.$message.info("已取消全部选择");
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 修改清除选择方法
|
|
|
|
+ clearSelection() {
|
|
|
|
+ if (this.$refs.dataTable) {
|
|
|
|
+ this.$refs.dataTable.clearSelection();
|
|
|
|
+ }
|
|
|
|
+ this.selectedRows = [];
|
|
|
|
+ this.allSelectedRows.clear();
|
|
|
|
+ this.isAllDataSelected = false;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 修改分页方法,保持选中状态
|
|
|
|
+ ChangePage(e) {
|
|
|
|
+ this.queryForm.page = e;
|
|
|
|
+ this.search().then(() => {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ if (this.$refs.dataTable) {
|
|
|
|
+ this.dataList.forEach((row) => {
|
|
|
|
+ if (this.isAllDataSelected || this.allSelectedRows.has(row.id)) {
|
|
|
|
+ this.$refs.dataTable.toggleRowSelection(row, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
batchAnalysis() {
|
|
batchAnalysis() {
|
|
@@ -823,7 +1027,7 @@ export default {
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
console.error("批量解析错误:", error);
|
|
console.error("批量解析错误:", error);
|
|
- this.$message.error("批量解析过程中出现错误");
|
|
|
|
|
|
+ this.$message.error("批量解析过程中出错误");
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -897,6 +1101,13 @@ export default {
|
|
a.target = "_blank";
|
|
a.target = "_blank";
|
|
a.click();
|
|
a.click();
|
|
},
|
|
},
|
|
|
|
+ /*终止 */
|
|
|
|
+ endAnalysis() {
|
|
|
|
+ endClear().then((res) => {
|
|
|
|
+ if (res.status !== 200) return;
|
|
|
|
+ this.search();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
/* 解析 */
|
|
/* 解析 */
|
|
analysis(row) {
|
|
analysis(row) {
|
|
if (row.run == 1 || row.run == 5) return;
|
|
if (row.run == 1 || row.run == 5) return;
|
|
@@ -933,7 +1144,7 @@ export default {
|
|
clearTimeout(this.analysisStatusCheckers[row.id]);
|
|
clearTimeout(this.analysisStatusCheckers[row.id]);
|
|
}
|
|
}
|
|
/* 获取token数 */
|
|
/* 获取token数 */
|
|
- /* const checkStatus = () => {
|
|
|
|
|
|
+ /* const checkStatus = () => {
|
|
getdocpro({ document_id: row.id })
|
|
getdocpro({ document_id: row.id })
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.status === 200) {
|
|
if (res.status === 200) {
|
|
@@ -970,13 +1181,15 @@ export default {
|
|
}; */
|
|
}; */
|
|
/* 监控任务 */
|
|
/* 监控任务 */
|
|
const checkStatus = () => {
|
|
const checkStatus = () => {
|
|
- resultTask(row.id)
|
|
|
|
|
|
+ resultTask(row.id)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
if (res.status === 200) {
|
|
if (res.status === 200) {
|
|
const newStatus = Number(res.data.document_status);
|
|
const newStatus = Number(res.data.document_status);
|
|
- const newProgress = res.data.progress_msg
|
|
|
|
|
|
+ const newProgress = Number(res.data.progress);
|
|
|
|
+ const newProgressMsg = res.data.progress_msg;
|
|
this.$set(row, "run", newStatus);
|
|
this.$set(row, "run", newStatus);
|
|
- this.$set(row, "progress_msg", newProgress);
|
|
|
|
|
|
+ this.$set(row, "progress", newProgress);
|
|
|
|
+ this.$set(row, "progress_msg", newProgressMsg);
|
|
|
|
|
|
if (newStatus === 3) {
|
|
if (newStatus === 3) {
|
|
this.$message.success("解析成功");
|
|
this.$message.success("解析成功");
|
|
@@ -1188,6 +1401,38 @@ export default {
|
|
start_page: _this.analForm.start_page,
|
|
start_page: _this.analForm.start_page,
|
|
end_page: _this.analForm.end_page,
|
|
end_page: _this.analForm.end_page,
|
|
}));
|
|
}));
|
|
|
|
+ // 获取失败状态的文档的失败原因
|
|
|
|
+ const failedDocs = _this.dataList.filter(
|
|
|
|
+ (doc) => Number(doc.run) === 4
|
|
|
|
+ );
|
|
|
|
+ if (failedDocs.length > 0) {
|
|
|
|
+ Promise.all(
|
|
|
|
+ failedDocs.map((doc) =>
|
|
|
|
+ resultTask(doc.id)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.status === 200) {
|
|
|
|
+ // 找到对应的文档并更新其 progress_msg
|
|
|
|
+ const docIndex = _this.dataList.findIndex(
|
|
|
|
+ (item) => item.id === doc.id
|
|
|
|
+ );
|
|
|
|
+ if (docIndex !== -1) {
|
|
|
|
+ _this.$set(
|
|
|
|
+ _this.dataList[docIndex],
|
|
|
|
+ "progress_msg",
|
|
|
|
+ res.data.progress_msg
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ console.error(
|
|
|
|
+ `获取文档 ${doc.id} 的失败原因时出错:`,
|
|
|
|
+ error
|
|
|
|
+ );
|
|
|
|
+ })
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ }
|
|
_this.pageTotal = res.data.pagination.total_count;
|
|
_this.pageTotal = res.data.pagination.total_count;
|
|
_this.recordCount = res.data.pagination.total_count;
|
|
_this.recordCount = res.data.pagination.total_count;
|
|
_this.queryForm.pageSize = res.data.pagination.total_size;
|
|
_this.queryForm.pageSize = res.data.pagination.total_size;
|
|
@@ -1209,16 +1454,24 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
- //修改分页
|
|
|
|
- ChangePage(e) {
|
|
|
|
- let _this = this;
|
|
|
|
- _this.queryForm.page = e;
|
|
|
|
- _this.search();
|
|
|
|
- },
|
|
|
|
|
|
+ // 处理每页显示数量变化
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
this.queryForm.pageSize = val;
|
|
this.queryForm.pageSize = val;
|
|
- this.queryForm.page = 1; // Reset to first page when changing page size
|
|
|
|
- this.search();
|
|
|
|
|
|
+ this.queryForm.page = 1;
|
|
|
|
+ this.search().then(() => {
|
|
|
|
+ // 恢复选中状态
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.dataList.forEach((row) => {
|
|
|
|
+ if (this.pageSelected.has(row.id)) {
|
|
|
|
+ this.$refs.dataTable.toggleRowSelection(row, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 添加格式化方法
|
|
|
|
+ percentFormat(percentage) {
|
|
|
|
+ return `${percentage}%`;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -1360,6 +1613,89 @@ export default {
|
|
::v-deep .el-tree-node__expand-icon {
|
|
::v-deep .el-tree-node__expand-icon {
|
|
display: none;
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
+::v-deep .el-tag {
|
|
|
|
+ display: inline-flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ height: auto;
|
|
|
|
+ padding: 5px 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.batch-actions {
|
|
|
|
+ display: flex;
|
|
|
|
+ gap: 10px;
|
|
|
|
+
|
|
|
|
+ .el-dropdown {
|
|
|
|
+ /* margin-right: auto; */
|
|
|
|
+ }
|
|
|
|
+ .icons {
|
|
|
|
+ width: 15px;
|
|
|
|
+ height: 15px;
|
|
|
|
+ vertical-align: middle;
|
|
|
|
+ margin-right: 4px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+::v-deep .el-dropdown-menu__item {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ padding: 8px 16px;
|
|
|
|
+ .icons {
|
|
|
|
+ width: 14px;
|
|
|
|
+ height: 14px;
|
|
|
|
+ margin-right: 8px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
@import "./components/dataList.scss";
|
|
@import "./components/dataList.scss";
|
|
|
|
+.status-wrapper {
|
|
|
|
+ display: inline-flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ transition: none !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.progress-wrapper {
|
|
|
|
+ display: inline-flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ padding: 2px;
|
|
|
|
+ transition: none !important;
|
|
|
|
+
|
|
|
|
+ ::v-deep .el-progress {
|
|
|
|
+ line-height: 1;
|
|
|
|
+ transition: none !important;
|
|
|
|
+
|
|
|
|
+ .el-progress__text {
|
|
|
|
+ font-size: 12px !important;
|
|
|
|
+ color: inherit;
|
|
|
|
+ transition: none !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-progress-circle {
|
|
|
|
+ margin: 0;
|
|
|
|
+ transition: none !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 禁用 SVG 动画
|
|
|
|
+ svg {
|
|
|
|
+ transition: none !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 禁用进度条路径动画
|
|
|
|
+ .el-progress-circle__track,
|
|
|
|
+ .el-progress-circle__path {
|
|
|
|
+ transition: none !important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 添加选择提示区域样式
|
|
|
|
+.selection-control {
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+
|
|
|
|
+ .el-alert {
|
|
|
|
+ padding: 8px 16px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
|
|
|