Files
EasyFlow/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/ChatErrorNotice.vue
陈子默 b13280cf1f fix: 支持模型异常后继续文档对话
- 将本轮文档上下文纳入可持久化的 Agent 用户消息

=- 在异常提示中提供请重试动作并自动发送继续
2026-08-26 22:56:33 +08:00

97 lines
2.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
defineProps<{
actionDisabled?: boolean;
actionLabel?: string;
message: string;
}>();
const emit = defineEmits<{
action: [];
}>();
</script>
<template>
<div class="chat-error-notice" role="alert">
<span class="chat-error-notice__icon" aria-hidden="true">!</span>
<span class="chat-error-notice__content">
<span>{{ message }}<template v-if="actionLabel"></template></span>
<button
v-if="actionLabel"
type="button"
class="chat-error-notice__action"
:disabled="actionDisabled"
@click="emit('action')"
>
{{ actionLabel }}
</button>
</span>
</div>
</template>
<style scoped>
.chat-error-notice {
display: flex;
gap: 8px;
align-items: flex-start;
max-width: min(78%, 680px);
padding: 10px 12px;
font-size: 13px;
line-height: 20px;
color: var(--el-color-danger);
background: var(--el-color-danger-light-9);
border: 1px solid var(--el-color-danger-light-7);
border-radius: 8px;
}
.chat-error-notice__icon {
display: inline-flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
margin-top: 2px;
font-size: 12px;
font-weight: 700;
border: 1px solid currentColor;
border-radius: 50%;
}
.chat-error-notice__content {
min-width: 0;
}
.chat-error-notice__action {
padding: 0;
margin-left: var(--space-1);
font: inherit;
font-weight: 600;
line-height: inherit;
color: currentcolor;
text-decoration: underline;
text-underline-offset: 2px;
cursor: pointer;
background: transparent;
border: 0;
border-radius: var(--el-border-radius-small);
}
.chat-error-notice__action:hover:not(:disabled) {
opacity: 0.8;
}
.chat-error-notice__action:active:not(:disabled) {
opacity: 0.65;
}
.chat-error-notice__action:focus-visible {
outline: 2px solid var(--el-color-primary-light-3);
outline-offset: 2px;
}
.chat-error-notice__action:disabled {
cursor: not-allowed;
opacity: 0.5;
}
</style>