|
|
@ -8,7 +8,7 @@ |
|
|
* - 输入区采用圆角容器包裹文本框与发送按钮 |
|
|
* - 输入区采用圆角容器包裹文本框与发送按钮 |
|
|
*/ |
|
|
*/ |
|
|
import { ResolvedConfig, RagSource } from './types'; |
|
|
import { ResolvedConfig, RagSource } from './types'; |
|
|
import { debounce, formatTime } from './utils'; |
|
|
|
|
|
|
|
|
import { debounce, formatTime, formatHistoryTime } from './utils'; |
|
|
import { t } from './i18n'; |
|
|
import { t } from './i18n'; |
|
|
import { DialogPlugin } from 'tdesign-web-components/lib/dialog/index.js'; |
|
|
import { DialogPlugin } from 'tdesign-web-components/lib/dialog/index.js'; |
|
|
// omi 的 render/h 用于创建带 on* 函数回调的组件(见 createEventful 说明)
|
|
|
// omi 的 render/h 用于创建带 on* 函数回调的组件(见 createEventful 说明)
|
|
|
@ -915,8 +915,11 @@ function createChatAction(wrapper: HTMLElement, text: string, msgId?: string, fe |
|
|
const el = actionEl as unknown as { |
|
|
const el = actionEl as unknown as { |
|
|
actionBar: string[]; |
|
|
actionBar: string[]; |
|
|
handleAction: (action: string, data: { event?: Event; active?: boolean }) => void; |
|
|
handleAction: (action: string, data: { event?: Event; active?: boolean }) => void; |
|
|
|
|
|
tooltipProps: Record<string, unknown>; |
|
|
}; |
|
|
}; |
|
|
el.actionBar = ['replay', 'copy', 'good', 'bad']; |
|
|
el.actionBar = ['replay', 'copy', 'good', 'bad']; |
|
|
|
|
|
// 浮层 portal 到 body:zIndex 越过弹窗(9999)防遮挡,overlayClassName 加 SDK 私有类用于补样式
|
|
|
|
|
|
el.tooltipProps = { overlayClassName: 'csk-tooltip', zIndex: 10000 }; |
|
|
// copyText/comment 为 String 简单类型,须用 setAttribute(property 赋值在 omi 下静默失效)
|
|
|
// copyText/comment 为 String 简单类型,须用 setAttribute(property 赋值在 omi 下静默失效)
|
|
|
actionEl.setAttribute('copyText', text); |
|
|
actionEl.setAttribute('copyText', text); |
|
|
actionEl.setAttribute('comment', feedback === 'up' ? 'good' : feedback === 'down' ? 'bad' : ''); |
|
|
actionEl.setAttribute('comment', feedback === 'up' ? 'good' : feedback === 'down' ? 'bad' : ''); |
|
|
@ -1160,8 +1163,9 @@ export function renderHistoryList( |
|
|
const metaParts: string[] = []; |
|
|
const metaParts: string[] = []; |
|
|
if (item.roleName) metaParts.push(item.roleName); |
|
|
if (item.roleName) metaParts.push(item.roleName); |
|
|
if (item.messageCount !== undefined) metaParts.push(`${item.messageCount} 条消息`); |
|
|
if (item.messageCount !== undefined) metaParts.push(`${item.messageCount} 条消息`); |
|
|
if (item.lastMessageTime) metaParts.push(item.lastMessageTime); |
|
|
|
|
|
else if (item.createdAt) metaParts.push(item.createdAt); |
|
|
|
|
|
|
|
|
const timeStr = item.lastMessageTime || item.createdAt; |
|
|
|
|
|
const timeText = formatHistoryTime(timeStr); |
|
|
|
|
|
if (timeText) metaParts.push(timeText); |
|
|
metaEl.textContent = metaParts.join(' · '); |
|
|
metaEl.textContent = metaParts.join(' · '); |
|
|
|
|
|
|
|
|
info.appendChild(idEl); |
|
|
info.appendChild(idEl); |
|
|
|