Refactor project pages and update related docs

This commit is contained in:
wkc
2026-05-28 16:37:51 +08:00
parent 000e8698a5
commit 7ce721ef93
40 changed files with 730 additions and 785 deletions

View File

@@ -176,7 +176,8 @@ export default {
'0': 'primary',
'1': 'success',
'2': 'info',
'3': 'warning'
'3': 'warning',
'4': 'danger'
}
return statusMap[status] || 'info'
},
@@ -185,7 +186,8 @@ export default {
'0': '进行中',
'1': '已完成',
'2': '已归档',
'3': '打标中'
'3': '打标中',
'4': '打标失败'
}
return statusMap[status] || '未知'
},

View File

@@ -98,7 +98,7 @@
>
<template slot-scope="scope">
<el-button
v-if="scope.row.status === '0' || scope.row.status === '3'"
v-if="['0', '3', '4'].includes(scope.row.status)"
size="mini"
type="text"
icon="el-icon-right"
@@ -199,6 +199,7 @@ export default {
1: "#52c41a",
2: "#8c8c8c",
3: "#fa8c16",
4: "#f56c6c",
};
return colorMap[status] || "#8c8c8c";
},

View File

@@ -40,7 +40,8 @@ export default {
'0': 0,
'1': 0,
'2': 0,
'3': 0
'3': 0,
'4': 0
})
}
},
@@ -53,7 +54,8 @@ export default {
{ label: '进行中', value: '0', count: 0 },
{ label: '已完成', value: '1', count: 0 },
{ label: '已归档', value: '2', count: 0 },
{ label: '打标中', value: '3', count: 0 }
{ label: '打标中', value: '3', count: 0 },
{ label: '打标失败', value: '4', count: 0 }
]
}
},

View File

@@ -359,7 +359,7 @@ export default {
return String(this.projectInfo.projectStatus) === "2";
},
isReportDisabled() {
return ["0", "3"].includes(String(this.projectInfo.projectStatus));
return ["0", "3", "4"].includes(String(this.projectInfo.projectStatus));
},
},
created() {
@@ -505,7 +505,9 @@ export default {
return today;
},
getPullBankInfoMinSelectableDate() {
return new Date(2025, 0, 1);
const minSelectableDate = this.getPullBankInfoMaxSelectableDate();
minSelectableDate.setFullYear(minSelectableDate.getFullYear() - 1);
return minSelectableDate;
},
getPullBankInfoMaxSelectableDate() {
const yesterday = this.getPullBankInfoTodayStart();
@@ -546,10 +548,10 @@ export default {
},
isPullBankInfoDateDisabled(time) {
const minSelectableDate = this.getPullBankInfoMinSelectableDate();
const todayStart = this.getPullBankInfoTodayStart();
const maxSelectableDate = this.getPullBankInfoMaxSelectableDate();
return (
time.getTime() < minSelectableDate.getTime() ||
time.getTime() >= todayStart.getTime()
time.getTime() > maxSelectableDate.getTime()
);
},
hasInvalidPullBankInfoDateRange(dateRange) {
@@ -590,7 +592,7 @@ export default {
}
if (this.hasInvalidPullBankInfoDateRange([startDate, endDate])) {
this.$message.warning("时间跨度仅支持 2025-01-01 至昨天");
this.$message.warning("时间跨度仅支持近一年内日期,且最晚只能选择到昨天");
return;
}
@@ -662,6 +664,7 @@ export default {
1: "success",
2: "archived",
3: "tagging",
4: "failed",
};
return statusMap[status] || "processing";
},
@@ -673,6 +676,7 @@ export default {
1: "已完成",
2: "已归档",
3: "打标中",
4: "打标失败",
};
return statusMap[status] || "未知";
},
@@ -1050,6 +1054,11 @@ export default {
color: #909399;
font-weight: 500;
}
.status-failed {
color: #f56c6c;
font-weight: 500;
}
}
.update-time {

View File

@@ -57,6 +57,24 @@
</div>
</div>
<div
v-if="isProjectTagFailed && projectInfo.latestTagTaskErrorMessage"
class="tag-failure-alert"
>
<div class="tag-failure-alert__content">
<i class="el-icon-warning-outline"></i>
<div>
<div class="tag-failure-alert__title">项目打标失败</div>
<div class="tag-failure-alert__message">
{{ tagFailureSummary }}
</div>
</div>
</div>
<el-button type="text" size="mini" @click="openTagFailureDialog">
查看完整错误
</el-button>
</div>
<!-- 动态组件渲染区域 -->
<component
:is="currentComponent"
@@ -81,6 +99,20 @@
:visible.sync="evidenceDrawerVisible"
:project-id="projectId"
/>
<el-dialog
title="打标失败详情"
:visible.sync="tagFailureDialogVisible"
width="720px"
append-to-body
>
<div
v-if="projectInfo.latestTagTaskEndTime"
class="tag-failure-dialog__time"
>
失败时间{{ formatUpdateTime(projectInfo.latestTagTaskEndTime) }}
</div>
<pre class="tag-failure-dialog__message">{{ projectInfo.latestTagTaskErrorMessage }}</pre>
</el-dialog>
</div>
</template>
@@ -126,10 +158,13 @@ export default {
warningCount: 0,
warningThreshold: 60,
projectStatus: "0",
latestTagTaskErrorMessage: "",
latestTagTaskEndTime: "",
},
evidenceConfirmVisible: false,
evidenceDrawerVisible: false,
evidencePayload: {},
tagFailureDialogVisible: false,
projectStatusPollingTimer: null,
projectStatusPollingInterval: 1000,
projectStatusPollingLoading: false,
@@ -139,6 +174,13 @@ export default {
isProjectArchived() {
return String(this.projectInfo.projectStatus) === "2";
},
isProjectTagFailed() {
return String(this.projectInfo.projectStatus) === "4";
},
tagFailureSummary() {
const message = this.projectInfo.latestTagTaskErrorMessage || "";
return message.length > 120 ? `${message.slice(0, 120)}...` : message;
},
},
watch: {
"$route.params.projectId"(newId) {
@@ -346,6 +388,7 @@ export default {
1: "success", // 已完成
2: "info", // 已归档
3: "warning", // 打标中
4: "danger", // 打标失败
};
return statusMap[status] || "info";
},
@@ -356,9 +399,13 @@ export default {
1: "已完成",
2: "已归档",
3: "打标中",
4: "打标失败",
};
return statusMap[status] || "未知";
},
openTagFailureDialog() {
this.tagFailureDialogVisible = true;
},
/** 获取配置类型标签文字 */
getConfigTypeLabel(configType) {
const configTypeMap = {
@@ -606,6 +653,67 @@ export default {
}
}
.tag-failure-alert {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 16px;
padding: 12px 16px;
color: #9f3a38;
background: #fff2f0;
border: 1px solid #ffd6d1;
border-radius: 8px;
}
.tag-failure-alert__content {
display: flex;
align-items: flex-start;
min-width: 0;
gap: 10px;
i {
margin-top: 2px;
font-size: 18px;
color: #f56c6c;
}
}
.tag-failure-alert__title {
font-size: 14px;
font-weight: 600;
line-height: 20px;
}
.tag-failure-alert__message {
margin-top: 2px;
font-size: 13px;
line-height: 20px;
word-break: break-word;
}
.tag-failure-dialog__time {
margin-bottom: 12px;
color: #606266;
font-size: 13px;
}
.tag-failure-dialog__message {
max-height: 420px;
margin: 0;
padding: 12px;
overflow: auto;
white-space: pre-wrap;
word-break: break-word;
color: #303133;
background: #f8f9fb;
border: 1px solid #ebeef5;
border-radius: 6px;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
font-size: 12px;
line-height: 1.6;
}
.info-card {
margin-bottom: 16px;

View File

@@ -103,7 +103,8 @@ export default {
'0': 0,
'1': 0,
'2': 0,
'3': 0
'3': 0,
'4': 0
},
// 新增/编辑弹窗
addDialogVisible: false,
@@ -142,7 +143,8 @@ export default {
'0': counts.status0 || 0,
'1': counts.status1 || 0,
'2': counts.status2 || 0,
'3': counts.status3 || 0
'3': counts.status3 || 0,
'4': counts.status4 || 0
}
this.loading = false