1
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user