抓取生产工单,抓取发料异常

This commit is contained in:
hjq
2026-06-11 19:38:16 +08:00
parent a160d5d48f
commit 94c81cdc4f
10 changed files with 160 additions and 28 deletions

View File

@@ -15,8 +15,7 @@
<div v-if="logs.length === 0" style="color: #666; text-align: center; margin-top: 150px;">
暂无后台任务输出...
</div>
<div v-for="(log, index) in logs" :key="index" style="margin-bottom: 2px;">
{{ log }}
<div v-for="(log, index) in logs" :key="index" style="margin-bottom: 2px;" :style="getLogStyle(log)" v-text="log">
</div>
</div>
<span slot="footer" class="dialog-footer">
@@ -62,6 +61,17 @@
}
},
methods: {
getLogStyle(log) {
if (!log) return '';
if (log.includes('✅') || log.includes('大功告成')) return 'color: #67C23A; font-weight: bold;'; // 绿色
if (log.includes('❌') || log.includes('ERR') || log.includes('失败') || log.includes('异常')) return 'color: #F56C6C; font-weight: bold;'; // 红色
if (log.includes('⏭️') || log.includes('断点续传') || log.includes('中断记录')) return 'color: #E040FB; font-weight: bold;'; // 紫色
if (log.includes('正在收集并解析') || log.includes('准备抓取下一页') || log.includes('等待重试') || log.includes('警告')) return 'color: #E6A23C;'; // 橙黄色
if (log.includes('===================================')) return 'color: #409EFF; font-weight: bold;'; // 蓝色
if (log.includes('命中目标 URL') || log.includes('POST 请求')) return 'color: #909399; font-style: italic;'; // 灰色斜体
if (log.includes('开始') || log.includes('完成')) return 'color: #FFF; font-weight: bold;'; // 白色高亮
return 'color: #a9b7c6;'; // 默认灰白色
},
fetchLogs() {
// 如果弹窗没打开,也可以不刷新日志以节省性能,或者一直拉取保持最新
if (!this.logDialogVisible) return;