This commit is contained in:
2025-10-10 02:25:27 +08:00
parent 13cf9865dd
commit f302c9ea69
4 changed files with 931 additions and 0 deletions

View File

@@ -156,6 +156,10 @@ export default {
if (Array.isArray(data)) this.resultList = data
else if (typeof data === 'string') this.resultList = data ? [data] : []
else this.resultList = []
// 检查是否有以[炸弹]开头的消息
this.checkBombAlert(this.resultList)
// 执行成功后刷新历史记录
this.loadHistory()
} else {
@@ -251,6 +255,9 @@ export default {
this.$message.success('已查询到今天的慢单数据')
}
// 检查是否有以[炸弹]开头的消息
this.checkBombAlert(this.resultList)
// 执行成功后刷新历史记录
this.loadHistory()
} else {
@@ -266,6 +273,39 @@ export default {
clearAll() {
this.form.command = ''
this.resultList = []
},
checkBombAlert(resultList) {
if (!resultList || resultList.length === 0) return
// 检查是否有以[炸弹]开头的消息
const bombMessages = resultList
.filter(msg => {
return msg && typeof msg === 'string' && msg.trim().startsWith('[炸弹]')
})
.map(msg => {
// 移除所有的[炸弹]标记
return msg.trim().replace(/\[炸弹\]\s*/g, '').trim()
})
if (bombMessages.length > 0) {
// 显示全屏警告弹窗
this.$alert(bombMessages.join('\n\n'), '⚠️ 警告提示', {
confirmButtonText: '我已知晓',
type: 'warning',
center: true,
customClass: 'bomb-alert-dialog',
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
dangerouslyUseHTMLString: false
}).catch(() => {})
}
},
copyHistoryItem(item) {
const message = this.extractMessage(item)
if (message) {
this.doCopy(message)
}
}
}
}
@@ -363,6 +403,80 @@ export default {
.history-content::-webkit-scrollbar-thumb:hover {
background: #C0C4CC;
}
.history-item-header {
display: flex;
justify-content: space-between;
align-items: center;
}
/* 炸弹警告弹窗样式 */
::v-deep .bomb-alert-dialog {
width: 80% !important;
max-width: 1920px !important;
}
::v-deep .bomb-alert-dialog .el-message-box__message {
font-size: 16px !important;
font-weight: 600 !important;
color: #E6A23C !important;
white-space: pre-wrap !important;
word-break: break-word !important;
line-height: 1.8 !important;
max-height: 60vh !important;
overflow-y: auto !important;
}
::v-deep .bomb-alert-dialog .el-message-box__btns {
text-align: center !important;
}
::v-deep .bomb-alert-dialog .el-message-box__btns .el-button {
padding: 12px 40px !important;
font-size: 16px !important;
font-weight: 600 !important;
}
</style>
<style>
/* 全局样式炸弹警告弹窗不使用scoped因为弹窗挂载在body下 */
.bomb-alert-dialog {
width: 80vw !important;
max-width: 1920px !important;
min-width: 500px !important;
}
.bomb-alert-dialog .el-message-box__header {
padding: 20px 20px 15px !important;
}
.bomb-alert-dialog .el-message-box__title {
font-size: 20px !important;
font-weight: 700 !important;
}
.bomb-alert-dialog .el-message-box__message {
font-size: 16px !important;
font-weight: 600 !important;
color: #E6A23C !important;
white-space: pre-wrap !important;
word-break: break-word !important;
line-height: 1.8 !important;
max-height: 60vh !important;
overflow-y: auto !important;
padding: 15px 20px !important;
}
.bomb-alert-dialog .el-message-box__btns {
text-align: center !important;
padding: 15px 20px 20px !important;
}
.bomb-alert-dialog .el-message-box__btns .el-button {
padding: 12px 40px !important;
font-size: 16px !important;
font-weight: 600 !important;
}
</style>