zj-plugin-intelligent 1.2.5-beta.20 → 1.2.5-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -951,7 +951,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
951
951
|
/***/ (function(module, exports, __webpack_require__) {
|
|
952
952
|
|
|
953
953
|
"use strict";
|
|
954
|
-
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.array-buffer.detached.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array-buffer.detached.js\");\n__webpack_require__(/*! core-js/modules/es.array-buffer.transfer.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array-buffer.transfer.js\");\n__webpack_require__(/*! core-js/modules/es.array-buffer.transfer-to-fixed-length.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array-buffer.transfer-to-fixed-length.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.map.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.at.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.at.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.find-last.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.find-last.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.find-last-index.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.find-last-index.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.set.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.set.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.to-reversed.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.to-reversed.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.to-sorted.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.to-sorted.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.with.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.with.js\");\nvar _markdownIt = _interopRequireDefault(__webpack_require__(/*! markdown-it */ \"./node_modules/_markdown-it@14.1.0@markdown-it/index.mjs\"));\nvar _apichat = __webpack_require__(/*! @lib/api/apichat */ \"./src/lib/api/apichat.js\");\nvar _index = __webpack_require__(/*! @lib/socket/fileManager/obs/index */ \"./src/lib/socket/fileManager/obs/index.js\");\nvar _index2 = _interopRequireDefault(__webpack_require__(/*! @lib/socket/utils/index */ \"./src/lib/socket/utils/index.js\"));\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _apiObs = _interopRequireDefault(__webpack_require__(/*! @lib/api/apiObs */ \"./src/lib/api/apiObs.js\"));\nvar _html2canvas = _interopRequireDefault(__webpack_require__(/*! html2canvas */ \"./node_modules/_html2canvas@1.4.1@html2canvas/dist/html2canvas.js\"));\nconst md = new _markdownIt.default({\n breaks: true,\n html: false,\n linkify: true,\n typographer: true\n});\nmd.enable('table');\nvar _default = exports.default = {\n name: 'ChatDetail',\n props: {\n isMobile: {\n type: Boolean,\n default: false\n },\n activeSessionId: {\n type: String,\n default: ''\n },\n currentAgent: {\n type: String,\n default: ''\n },\n agentInfo: {\n type: Object,\n default: () => ({})\n },\n currentAgentDesc: {\n type: String,\n default: ''\n },\n showSidebar: {\n type: Boolean,\n default: false\n },\n showH5List: {\n type: Boolean,\n default: false\n },\n showAgentSelect: {\n type: Boolean,\n default: false\n },\n agentList: {\n type: Array,\n default: () => []\n }\n },\n data() {\n return {\n messages: [],\n inputText: '',\n sending: false,\n waitTimer: null,\n waitSeconds: 0,\n canceling: false,\n msgPage: 1,\n msgMaxPage: 1,\n msgTotal: 0,\n eventSource: null,\n sseAbortController: null,\n showToolInfo: false,\n showDownBtn: false,\n lastScrollTop: 0,\n scrollTimer: null,\n contentCache: {},\n loadingSessionMsg: false,\n greeting: '',\n _scrollTimer: null,\n _userScrolledUp: false,\n voiceMode: false,\n isRecording: false,\n recordDuration: 0,\n recordingTimer: null,\n audioContext: null,\n audioStream: null,\n audioProcessor: null,\n audioChunks: [],\n audioSampleRate: 16000,\n isCancelSwipe: false,\n recordStartY: 0,\n _pendingSendText: null\n };\n },\n computed: {\n isIOS() {\n return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n },\n waitClass() {\n if (this.waitSeconds > 15) return 'wait-15';\n if (this.waitSeconds > 10) return 'wait-10';\n if (this.waitSeconds > 5) return 'wait-5';\n return '';\n },\n currentAgentName() {\n if (!this.currentAgent) return '';\n const a = this.agentList.find(x => x.agentCode === this.currentAgent);\n return a ? a.agentName || a.agentCode : this.currentAgent;\n }\n },\n watch: {\n contentCache: {\n handler(val) {\n // 保持响应性\n },\n immediate: true\n },\n activeSessionId(val) {\n if (val && this._pendingSendText) {\n const text = this._pendingSendText;\n this._pendingSendText = null;\n this.$nextTick(() => this._sendMessage(text));\n }\n }\n },\n mounted() {\n if (window.visualViewport) {\n window.visualViewport.addEventListener('resize', this.onViewportResize, {\n passive: true\n });\n }\n },\n beforeDestroy() {\n if (window.visualViewport) {\n window.visualViewport.removeEventListener('resize', this.onViewportResize);\n }\n this.releaseAudio();\n this.contentCache = {};\n clearTimeout(this._scrollTimer);\n if (this.eventSource) {\n this.eventSource.onerror = null;\n this.eventSource.close();\n this.eventSource = null;\n }\n if (this.sseAbortController) {\n this.sseAbortController.abort();\n this.sseAbortController = null;\n }\n if (this.waitTimer) {\n clearInterval(this.waitTimer);\n this.waitTimer = null;\n }\n if (this._typeTimer) {\n clearInterval(this._typeTimer);\n this._typeTimer = null;\n }\n },\n methods: {\n getInitial(name) {\n if (!name) return '?';\n return name.charAt(0);\n },\n formatTime(t) {\n if (!t) return '';\n const d = new Date(t.replace(' ', 'T'));\n const now = new Date();\n const diff = (now - d) / 1000;\n if (diff < 60) return '刚刚';\n if (diff < 3600) return Math.floor(diff / 60) + '分钟前';\n if (diff < 86400) return Math.floor(diff / 3600) + '小时前';\n return d.getMonth() + 1 + '/' + d.getDate();\n },\n escapeHtml(text) {\n if (!text) return '';\n return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n },\n renderMarkdown(text) {\n if (!text) return '';\n try {\n return md.render(text);\n } catch (err) {\n return this.escapeHtml(text);\n }\n },\n renderStreaming(text, msgKey) {\n if (!text) return '';\n const cache = this.contentCache[msgKey];\n const lines = text.split('\\n');\n const lastLineIdx = lines.length - 1;\n if (!cache) {\n try {\n const html = md.render(text);\n this.$set(this.contentCache, msgKey, {\n renderedLines: lastLineIdx,\n html,\n fullText: text\n });\n return html;\n } catch {\n return this.escapeHtml(text);\n }\n }\n if (text === cache.fullText) return cache.html;\n cache.fullText = text;\n\n // 行数没变,仅末尾追加字符,直接拼接尾行\n if (lastLineIdx === cache.renderedLines) {\n return cache.html + this.escapeHtml(lines[lastLineIdx]);\n }\n\n // 场景1:行数变少/文本回退截断,全量重渲染\n if (lastLineIdx < cache.renderedLines) {\n try {\n const fullLines = lines.slice(0, lastLineIdx);\n let newBaseHtml = '';\n if (fullLines.length > 0) {\n newBaseHtml = md.render(fullLines.join('\\n'));\n }\n cache.html = newBaseHtml;\n cache.renderedLines = lastLineIdx;\n const lastLine = this.escapeHtml(lines[lastLineIdx]);\n return cache.html + (lastLine || '');\n } catch {\n return this.escapeHtml(text);\n }\n }\n\n // 场景2:新增完整行\n if (cache.renderedLines < lastLineIdx) {\n const allFullLines = lines.slice(0, lastLineIdx);\n let newBaseHtml = '';\n if (allFullLines.length > 0) {\n newBaseHtml = md.render(allFullLines.join('\\n'));\n }\n cache.html = newBaseHtml;\n cache.renderedLines = lastLineIdx;\n }\n const lastLine = this.escapeHtml(lines[lastLineIdx]);\n cache.renderedLines = lastLineIdx;\n return cache.html + (lastLine || '');\n },\n getChatAvatarStyle(agent, avatar) {\n if (avatar) {\n return {\n backgroundImage: `url(${avatar})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat'\n };\n }\n const _agent = this.agentList.find(x => x.agentCode === agent);\n if (_agent && _agent.avatar) {\n return {\n backgroundImage: `url(${_agent.avatar})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat'\n };\n }\n // 没有网络图片时,根据智能体在 agentList 中的索引位置决定颜色\n const index = this.agentList.findIndex(item => item.agentCode === agent);\n if (index !== -1) {\n const colorIndex = index % 4 + 1;\n return {\n background: this.getGradientByColorIndex(colorIndex)\n };\n }\n return {\n background: 'linear-gradient(135deg, #1677ff, #4096ff)'\n };\n },\n getGradientByColorIndex(index) {\n const gradients = {\n 1: 'linear-gradient(135deg, #1677ff, #4096ff)',\n 2: 'linear-gradient(135deg, #52c41a, #73d13d)',\n 3: 'linear-gradient(135deg, #fa8c16, #ffa940)',\n 4: 'linear-gradient(135deg, #722ed1, #b37feb)'\n };\n return gradients[index] || gradients[1];\n },\n sendQuickMsg(message) {\n if (message) {\n this.inputText = message;\n this.sendMessage();\n }\n },\n formatMixText(str) {\n if (!str) return '';\n let res = str.replace(/([a-zA-Z0-9])([\\u4e00-\\u9fff])/g, '$1 $2').replace(/([\\u4e00-\\u9fff])([a-zA-Z0-9])/g, '$1 $2');\n res = res.replace(/([a-z])([A-Z])/g, '$1 $2');\n return res;\n },\n // 检测是否滚动到底部,控制向下箭头显示隐藏\n checkScrollBottom(forceShowWhenNotBottom = false) {\n const el = this.$refs.messagesRef;\n if (!el) {\n this.showDownBtn = false;\n return;\n }\n const {\n scrollHeight,\n scrollTop,\n clientHeight\n } = el;\n const remain = scrollHeight - scrollTop - clientHeight;\n const atBottom = remain <= 80;\n\n // 检测用户是否主动向上滚动(远离底部)\n if (remain > 80 && scrollTop < this.lastScrollTop) {\n this._userScrolledUp = true;\n }\n if (atBottom) {\n this._userScrolledUp = false;\n this.showDownBtn = false;\n } else if (this._userScrolledUp) {\n // 用户已主动上滚,保持显示\"到底部\"按钮,不自动回滚\n this.showDownBtn = true;\n } else if (this.sending && scrollTop >= this.lastScrollTop && !forceShowWhenNotBottom) {\n this.showDownBtn = false;\n } else {\n this.showDownBtn = true;\n }\n this.lastScrollTop = scrollTop;\n this.$emit('scroll-bottom-check', {\n showDownBtn: this.showDownBtn,\n lastScrollTop: this.lastScrollTop\n });\n },\n // H5 输入框获取焦点 - 滚动到底部让键盘不遮挡\n onInputFocus() {\n if (!this.isMobile) return;\n setTimeout(() => {\n window.scrollTo(0, document.body.scrollHeight);\n }, 300);\n },\n // visualViewport 变化时(如键盘弹出)调整滚动位置\n onViewportResize() {\n if (!this.isMobile) return;\n const activeEl = document.activeElement;\n if (activeEl && (activeEl.tagName === 'TEXTAREA' || activeEl.tagName === 'INPUT')) {\n window.scrollTo(0, document.body.scrollHeight);\n }\n },\n autoResizeTextarea() {\n const ta = this.$refs.taRef;\n if (!ta) return;\n const isMobile = this.isMobile;\n const baseH = isMobile ? 36 : 100;\n const maxH = isMobile ? 100 : 180;\n ta.style.height = `${baseH}px`;\n const realH = ta.scrollHeight;\n if (realH > baseH) {\n ta.style.height = `${Math.min(realH, maxH)}px`;\n }\n this.$nextTick(() => {\n this.checkScrollBottom(true);\n });\n },\n // Ctrl+Enter换行\n newLine(e) {\n e.preventDefault();\n const ta = this.$refs.taRef;\n const start = ta.selectionStart;\n const end = ta.selectionEnd;\n this.inputText = this.inputText.slice(0, start) + '\\n' + this.inputText.slice(end);\n this.$nextTick(() => {\n ta.selectionStart = ta.selectionEnd = start + 1;\n this.autoResizeTextarea();\n });\n },\n toggleVoiceMode() {\n if (this.voiceMode) {\n this.voiceMode = false;\n this.releaseAudio();\n return;\n }\n // 进入语音模式前提前请求麦克风权限,避免触摸时异步弹窗导致 touchend 丢失\n this.ensureAudioReady().then(ready => {\n if (ready) {\n this.voiceMode = true;\n } else {\n this.voiceMode = false;\n }\n });\n },\n // 确保音频设备已就绪\n async ensureAudioReady() {\n if (this.audioContext && this.audioStream) return true;\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n alert('当前环境不支持麦克风访问');\n return false;\n }\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: true\n });\n this.audioStream = stream;\n const audioContext = new (window.AudioContext || window.webkitAudioContext)();\n // iOS 上 AudioContext 默认 suspended,需要手动 resume\n if (audioContext.state === 'suspended') {\n await audioContext.resume();\n }\n this.audioContext = audioContext;\n // 采集实际采样率(iOS 会忽略 sampleRate 参数,使用硬件采样率)\n this.audioSampleRate = audioContext.sampleRate || 16000;\n const source = audioContext.createMediaStreamSource(stream);\n const processor = audioContext.createScriptProcessor(4096, 1, 1);\n this.audioProcessor = processor;\n processor.onaudioprocess = e => {\n if (!this.isRecording) return;\n const inputData = e.inputBuffer.getChannelData(0);\n this.audioChunks.push(new Float32Array(inputData));\n };\n source.connect(processor);\n processor.connect(audioContext.destination);\n return true;\n } catch (err) {\n console.error('麦克风访问失败:', err);\n alert('麦克风权限被拒绝');\n return false;\n }\n },\n // H5语音录制 - 触摸开始\n async onRecordTouchStart(e) {\n if (this.sending) return;\n const ready = await this.ensureAudioReady();\n if (!ready) return;\n this.isCancelSwipe = false;\n this.recordStartY = e.touches[0].clientY;\n this.recordDuration = 0;\n this.audioChunks = [];\n this.isRecording = true;\n this.recordingTimer = setInterval(() => {\n this.recordDuration++;\n if (this.recordDuration >= 60) {\n this.onRecordTouchEnd();\n }\n }, 1000);\n },\n // H5语音录制 - 触摸移动\n onRecordTouchMove(e) {\n if (!this.isRecording) return;\n const touch = e.touches[0];\n const moveY = touch.clientY;\n const cancelThreshold = 60;\n this.isCancelSwipe = this.recordStartY - moveY > cancelThreshold;\n },\n // H5语音录制 - 触摸结束\n onRecordTouchEnd() {\n if (!this.isRecording) return;\n this.isRecording = false;\n if (this.recordingTimer) {\n clearInterval(this.recordingTimer);\n this.recordingTimer = null;\n }\n this.stopAudioCapture(!this.isCancelSwipe);\n },\n // 停止音频采集并输出 WAV\n stopAudioCapture(shouldSend) {\n this.isRecording = false;\n if (shouldSend && this.audioChunks.length > 0) {\n const wavBlob = this.encodePCMToWav(this.audioChunks, this.audioSampleRate || 16000);\n this.sendAudioBlob(wavBlob);\n }\n this.audioChunks = [];\n },\n // 取消录音\n cancelRecording() {\n this.isRecording = false;\n if (this.recordingTimer) {\n clearInterval(this.recordingTimer);\n this.recordingTimer = null;\n }\n this.recordDuration = 0;\n this.isCancelSwipe = false;\n this.audioChunks = [];\n },\n // 释放音频资源\n releaseAudio() {\n this.cancelRecording();\n if (this.audioProcessor) {\n this.audioProcessor.disconnect();\n this.audioProcessor = null;\n }\n if (this.audioContext) {\n this.audioContext.close().catch(() => {});\n this.audioContext = null;\n }\n if (this.audioStream) {\n this.audioStream.getTracks().forEach(t => t.stop());\n this.audioStream = null;\n }\n },\n // 将 Float32 PCM 数据编码为 WAV Blob\n encodePCMToWav(chunks, sampleRate) {\n let totalLength = 0;\n for (const chunk of chunks) {\n totalLength += chunk.length;\n }\n const pcmData = new Int16Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n for (let i = 0; i < chunk.length; i++) {\n const s = Math.max(-1, Math.min(1, chunk[i]));\n pcmData[offset++] = s < 0 ? s * 0x8000 : s * 0x7FFF;\n }\n }\n const numChannels = 1;\n const bitsPerSample = 16;\n const byteRate = sampleRate * numChannels * bitsPerSample / 8;\n const blockAlign = numChannels * bitsPerSample / 8;\n const dataSize = pcmData.length * (bitsPerSample / 8);\n const headerSize = 44;\n const totalSize = headerSize + dataSize;\n const buffer = new ArrayBuffer(totalSize);\n const view = new DataView(buffer);\n this._wavWriteString(view, 0, 'RIFF');\n view.setUint32(4, totalSize - 8, true);\n this._wavWriteString(view, 8, 'WAVE');\n this._wavWriteString(view, 12, 'fmt ');\n view.setUint32(16, 16, true);\n view.setUint16(20, 1, true);\n view.setUint16(22, numChannels, true);\n view.setUint32(24, sampleRate, true);\n view.setUint32(28, byteRate, true);\n view.setUint16(32, blockAlign, true);\n view.setUint16(34, bitsPerSample, true);\n this._wavWriteString(view, 36, 'data');\n view.setUint32(40, dataSize, true);\n const pcmView = new Int16Array(buffer, headerSize, pcmData.length);\n pcmView.set(pcmData);\n return new Blob([buffer], {\n type: 'audio/wav'\n });\n },\n _wavWriteString(view, offset, str) {\n for (let i = 0; i < str.length; i++) {\n view.setUint8(offset + i, str.charCodeAt(i));\n }\n },\n // 发送音频\n sendAudioBlob(blob) {\n let appSeqId = _index2.default.getAppSeqId();\n let name = appSeqId + '.wav';\n const file = new File([blob], name, {\n type: 'audio/wav'\n });\n this.sendAudioMessage(file);\n },\n sendAudioMessage(file) {\n const sttKey = 'stt_' + Date.now();\n const sttMsg = {\n role: 'user',\n content: '转化中...',\n _sttStatus: 'pending',\n _sttKey: sttKey,\n createTime: new Date().toISOString(),\n _key: sttKey\n };\n this.messages.push(sttMsg);\n this.scrollToBottom(true);\n (0, _index.fileUploadToObs)({\n _file: file,\n appSeqId: file.name\n }).then(resp => {\n if (resp.CommonMsg.Status === 200) {\n return _apiObs.default.aliAudioToText({\n url: resp.obs_upload_data.obsUrl\n }).then(result => {\n if (result.code === '200' && result.data) {\n const idx = this.messages.findIndex(m => m._sttKey === sttKey);\n if (idx !== -1) {\n this.messages.splice(idx, 1);\n }\n this.sendQuickMsg(result.data);\n } else {\n throw new Error(result.msg || '语音转文字失败');\n }\n });\n } else {\n throw new Error(resp.CommonMsg.Message || '文件上传失败');\n }\n }).catch(err => {\n console.error('语音转文字失败:', err);\n const idx = this.messages.findIndex(m => m._sttKey === sttKey);\n if (idx !== -1) {\n this.$set(this.messages, idx, {\n ...this.messages[idx],\n _sttStatus: 'error',\n content: '语音转文字失败'\n });\n }\n this.$message.error('语音转文字失败');\n });\n this.$message.success(`录音完成 (${this.recordDuration}s)`);\n },\n clearWaitTimer() {\n if (this.waitTimer) {\n clearInterval(this.waitTimer);\n this.waitTimer = null;\n }\n },\n loadMoreMessages() {\n const nextPage = this.msgPage + 1;\n const maxPage = Math.ceil(this.msgTotal / 10);\n if (nextPage > maxPage) {\n this.loadingMore = false;\n return;\n }\n (0, _apichat.getSessionMessages)(this.activeSessionId, nextPage, 10).then(res => {\n const list = Array.isArray(res) ? res : res.list || [];\n this.msgPage = nextPage;\n const asAsc = (list || []).slice().reverse();\n const prepend = asAsc.map(m => ({\n role: m.role,\n content: m.content || '',\n thinking: m.thinking || '',\n toolCalls: [],\n agentName: '',\n createTime: m.createTime || null,\n _key: m.createTime ? 'msg_' + m.createTime : 'msg_' + Date.now() + '_' + Math.random()\n }));\n const container = this.$refs.messagesRef;\n const oldScrollHeight = container ? container.scrollHeight : 0;\n const oldScrollTop = container ? container.scrollTop : 0;\n this.messages = [...prepend, ...this.messages];\n this.$nextTick(() => {\n if (container) {\n container.scrollTop = oldScrollTop + (container.scrollHeight - oldScrollHeight);\n }\n this.loadingMore = false;\n });\n }).catch(() => {\n this.loadingMore = false;\n });\n },\n onScrollMessages() {\n const container = this.$refs.messagesRef;\n if (!container || this.loadingMore) return;\n const isAtBottom = container.scrollTop + container.clientHeight >= container.scrollHeight - 100;\n this.checkScrollBottom();\n if (isAtBottom) return;\n if (container.scrollTop < 50 && this.msgPage < Math.ceil(this.msgTotal / 10)) {\n this.loadingMore = true;\n this.loadMoreMessages();\n }\n },\n async sendMessage() {\n const text = this.inputText.trim();\n if (!text || this.sending) return;\n if (text.length > 300) {\n this.$message({\n message: '消息内容不能超过300字',\n type: 'warning',\n duration: 2000\n });\n return;\n }\n if (!this.activeSessionId) {\n this.$emit('start-session');\n this._pendingSendText = text;\n return;\n }\n this._sendMessage(text);\n },\n async _sendMessage(text) {\n this.inputText = '';\n const ta = this.$refs.taRef;\n const isMobile = this.isMobile;\n const baseH = isMobile ? 36 : 100;\n if (ta) {\n ta.style.height = baseH + 'px';\n }\n this.showDownBtn = false;\n this.messages.push({\n role: 'user',\n content: text,\n createTime: new Date().toISOString(),\n _key: 'user_' + Date.now() + '_' + Math.random()\n });\n const agentName = this.currentAgentName;\n const msgIdx = this.messages.push({\n role: \"assistant\",\n content: \"\",\n thinking: \"\",\n loading: true,\n toolCalls: [],\n agentName,\n createTime: new Date().toISOString(),\n _key: 'asst_' + Date.now() + '_' + Math.random()\n }) - 1;\n this.scrollToBottom(true);\n this.sending = true;\n this.waitSeconds = 0;\n if (this.waitTimer) clearInterval(this.waitTimer);\n this.waitTimer = setInterval(() => {\n this.waitSeconds++;\n }, 1000);\n let thinkingBuffer = '';\n let finalContent = '';\n let answerBuffer = '';\n let thinkDisplayed = 0;\n let typeTimer = null;\n let streamDone = false;\n typeTimer = setInterval(() => {\n if (!this.messages[msgIdx]) return;\n\n // Phase 1: 逐字展示思考内容(不 return,让 Phase 2 也能同时执行)\n if (thinkDisplayed < thinkingBuffer.length) {\n thinkDisplayed += 50;\n if (thinkDisplayed > thinkingBuffer.length) thinkDisplayed = thinkingBuffer.length;\n this.messages[msgIdx].thinking = thinkingBuffer.substring(0, thinkDisplayed);\n this.scrollToBottom();\n // 不 return,让 Phase 2 也能执行,避免 iOS 上思考内容过长阻塞回答内容展示\n }\n\n // Phase 2: 逐行展示(已完成的行整行出现,未完成的行也即时显示)\n const target = finalContent || answerBuffer;\n const msg = this.messages[msgIdx];\n const revealedLen = msg._revealedLen || 0;\n if (target.length > revealedLen) {\n const remaining = target.substring(revealedLen);\n const nextNewline = remaining.indexOf('\\n');\n if (nextNewline !== -1) {\n // 新的一行已完成 → 整行出现\n const endPos = revealedLen + nextNewline + 1;\n msg._revealedLen = endPos;\n msg.content = target.substring(0, endPos);\n this.scrollToBottom();\n return;\n }\n\n // 当前行未完成 → 逐步展示(每次 30 字符),确保 iOS 上也有渐进效果\n const revealStep = 30;\n const newRevealedLen = Math.min(revealedLen + revealStep, target.length);\n msg._revealedLen = newRevealedLen;\n msg.content = target.substring(0, newRevealedLen);\n this.scrollToBottom();\n return;\n }\n\n // Phase 3: 流已结束且内容已全部展示 → 收尾\n if (streamDone) {\n clearInterval(typeTimer);\n const key = this.messages[msgIdx]._key;\n if (key) {\n this.$delete(this.contentCache, key);\n this.$delete(this.contentCache, key + '_t');\n }\n typeTimer = null;\n this.messages[msgIdx].content = finalContent;\n this.messages[msgIdx].thinking = thinkingBuffer;\n this.messages[msgIdx].loading = false;\n this.sending = false;\n this.clearWaitTimer();\n this.scrollToBottom();\n this.$emit('session-refresh');\n this.$emit('message-sent');\n }\n }, 30);\n const url = (0, _apichat.createStreamUrl)(this.activeSessionId, text);\n // 关闭上一个连接\n if (this.eventSource) {\n this.eventSource.close();\n this.eventSource = null;\n }\n if (this.sseAbortController) {\n this.sseAbortController.abort();\n this.sseAbortController = null;\n }\n if (this.isIOS) {\n // iOS Safari 对 EventSource 有缓冲 Bug(累积到一定大小才触发事件),\n // 用 fetch + ReadableStream 手动解析 SSE 绕过此问题\n const controller = new AbortController();\n this.sseAbortController = controller;\n fetch(url, {\n signal: controller.signal\n }).then(response => {\n if (!response.ok) throw new Error('SSE response error: ' + response.status);\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n let currentEvent = '';\n let currentData = '';\n const dispatchEvent = () => {\n if (currentData === '') return;\n switch (currentEvent) {\n case 'reasoning':\n {\n let cleanChunk = currentData.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/([a-zA-Z])([\\u4e00-\\u9fff])/g, '$1 $2').replace(/([\\u4e00-\\u9fff])([a-zA-Z])/g, '$1 $2').replace(/([a-zA-Z])(\\d)/g, '$1 $2').replace(/(\\d)([a-zA-Z])/g, '$1 $2').replace(/\\s+([:,.!?])/g, '$1').replace(/([:,.!?])\\s+/g, '$1 ');\n cleanChunk = cleanChunk.replace(/\\s+/g, ' ');\n const lastChar = thinkingBuffer.slice(-1);\n const firstChar = cleanChunk.slice(0, 1);\n const isLetter = c => /[a-zA-Z]/.test(c);\n if (isLetter(lastChar) && isLetter(firstChar)) {\n thinkingBuffer += ' ' + cleanChunk;\n } else {\n thinkingBuffer += cleanChunk;\n }\n break;\n }\n case 'reasoning_result':\n thinkingBuffer = currentData;\n break;\n case 'answer':\n answerBuffer += currentData.replace(/([a-zA-Z]+)([\\u4e00-\\u9fff])/g, '$1 $2').replace(/([\\u4e00-\\u9fff])([a-zA-Z]+)/g, '$1 $2').replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/([a-zA-Z])(\\d)/g, '$1 $2').replace(/(\\d)([a-zA-Z])/g, '$1 $2');\n break;\n case 'tool_result':\n if (this.messages[msgIdx]) {\n if (!this.messages[msgIdx].toolCalls) this.messages[msgIdx].toolCalls = [];\n this.messages[msgIdx].toolCalls.push(currentData);\n this.scrollToBottom();\n }\n break;\n case 'agent_result':\n finalContent = currentData;\n streamDone = true;\n controller.abort();\n this.sseAbortController = null;\n break;\n }\n };\n const read = () => {\n reader.read().then(({\n done,\n value\n }) => {\n if (done) {\n if (buffer.trim()) {\n const remaining = buffer.split('\\n');\n for (const line of remaining) {\n if (line.startsWith('event: ')) currentEvent = line.slice(7).trim();else if (line.startsWith('data: ')) currentData = line.slice(6);\n }\n dispatchEvent();\n }\n if (!streamDone) {\n finalContent = answerBuffer;\n streamDone = true;\n }\n this.sseAbortController = null;\n return;\n }\n buffer += decoder.decode(value, {\n stream: true\n });\n const lines = buffer.split('\\n');\n buffer = lines.pop() || '';\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n if (line.startsWith('event: ')) {\n currentEvent = line.slice(7).trim();\n } else if (line.startsWith('data: ')) {\n currentData = (currentData ? currentData + '\\n' : '') + line.slice(6);\n } else if (line === '' || line === '\\r') {\n dispatchEvent();\n currentEvent = '';\n currentData = '';\n }\n }\n read();\n }).catch(err => {\n if (err.name === 'AbortError') return;\n console.log('[SSE] stream read error', err);\n if (!streamDone) {\n finalContent = thinkingBuffer || answerBuffer || '❌ 连接中断';\n streamDone = true;\n }\n this.sseAbortController = null;\n });\n };\n read();\n }).catch(err => {\n if (err.name === 'AbortError') return;\n console.log('[SSE] fetch error', err);\n if (!streamDone) {\n finalContent = '❌ 连接中断';\n streamDone = true;\n }\n this.sseAbortController = null;\n });\n } else {\n // 非 iOS(PC、Android):使用浏览器原生 EventSource\n this.eventSource = new EventSource(url);\n const es = this.eventSource;\n es.addEventListener('reasoning', e => {\n if (e.data) {\n const chunk = e.data;\n let cleanChunk = chunk.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/([a-zA-Z])([\\u4e00-\\u9fff])/g, '$1 $2').replace(/([\\u4e00-\\u9fff])([a-zA-Z])/g, '$1 $2').replace(/([a-zA-Z])(\\d)/g, '$1 $2').replace(/(\\d)([a-zA-Z])/g, '$1 $2').replace(/\\s+([:,.!?])/g, '$1').replace(/([:,.!?])\\s+/g, '$1 ');\n cleanChunk = cleanChunk.replace(/\\s+/g, ' ');\n const lastChar = thinkingBuffer.slice(-1);\n const firstChar = cleanChunk.slice(0, 1);\n const isLetter = c => /[a-zA-Z]/.test(c);\n if (isLetter(lastChar) && isLetter(firstChar)) {\n thinkingBuffer += ' ' + cleanChunk;\n } else {\n thinkingBuffer += cleanChunk;\n }\n }\n });\n es.addEventListener('reasoning_result', e => {\n if (e.data) {\n thinkingBuffer = e.data;\n }\n });\n es.addEventListener('answer', e => {\n if (e.data) {\n answerBuffer += e.data.replace(/([a-zA-Z]+)([\\u4e00-\\u9fff])/g, '$1 $2').replace(/([\\u4e00-\\u9fff])([a-zA-Z]+)/g, '$1 $2').replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/([a-zA-Z])(\\d)/g, '$1 $2').replace(/(\\d)([a-zA-Z])/g, '$1 $2');\n }\n });\n es.addEventListener('tool_result', e => {\n if (e.data && this.messages[msgIdx]) {\n if (!this.messages[msgIdx].toolCalls) this.messages[msgIdx].toolCalls = [];\n this.messages[msgIdx].toolCalls.push(e.data);\n this.scrollToBottom();\n }\n });\n es.addEventListener('agent_result', e => {\n finalContent = e.data || '';\n streamDone = true;\n es.close();\n this.eventSource = null;\n });\n es.onerror = err => {\n console.log('[SSE] onerror', err);\n if (thinkingBuffer.length > 0 && !streamDone) finalContent = thinkingBuffer;\n if (!streamDone) finalContent = '❌ 连接中断';\n streamDone = true;\n es.close();\n this.eventSource = null;\n };\n }\n },\n stopAgent() {\n if (this.eventSource) {\n this.eventSource.close();\n this.eventSource = null;\n }\n if (this.sseAbortController) {\n this.sseAbortController.abort();\n this.sseAbortController = null;\n }\n if (this.activeSessionId) {\n (0, _apichat.stopStream)(this.activeSessionId).catch(() => {});\n }\n if (this.messages.length > 0) {\n const last = this.messages[this.messages.length - 1];\n if (last && last.loading) {\n last.content = last.content || last.thinking || '⏹ 已停止';\n last.loading = false;\n this.$delete(this.contentCache, last._key);\n }\n }\n this.sending = false;\n this.clearWaitTimer();\n },\n scrollToTop() {\n const el = this.$refs.messagesRef;\n if (el) el.scrollTop = 0;\n },\n scrollToBottom(force = false) {\n if (this.showDownBtn && !force) return;\n this.$nextTick(() => {\n const el = this.$refs.messagesRef;\n if (el) {\n el.scrollTop = el.scrollHeight;\n this.lastScrollTop = el.scrollTop;\n this.showDownBtn = false;\n this._userScrolledUp = false;\n }\n });\n },\n scrollToBottomOnce() {\n clearTimeout(this._scrollTimer);\n this.$nextTick(() => {\n const tryScroll = () => {\n const el = this.$refs.messagesRef;\n if (!el) {\n this._scrollTimer = setTimeout(tryScroll, 50);\n return;\n }\n const originalScrollBehavior = el.style.scrollBehavior;\n el.style.scrollBehavior = 'auto';\n el.scrollTop = el.scrollHeight - el.clientHeight;\n el.style.scrollBehavior = originalScrollBehavior;\n this.showDownBtn = false;\n this._userScrolledUp = false;\n };\n tryScroll();\n });\n },\n copyText(content) {\n if (!content) return;\n const text = content.replace(/<[^>]+>/g, '');\n\n // 优先使用 Clipboard API(HTTPS 环境)\n if (navigator.clipboard && navigator.clipboard.writeText) {\n navigator.clipboard.writeText(text).then(() => {\n this.$message({\n message: '已复制到剪贴板',\n type: 'success',\n duration: 1500\n });\n }).catch(() => {\n this._fallbackCopyText(text);\n });\n } else {\n this._fallbackCopyText(text);\n }\n },\n _fallbackCopyText(text) {\n try {\n const ta = document.createElement('textarea');\n ta.value = text;\n ta.style.cssText = 'position:fixed;left:-9999px;top:0;opacity:0';\n document.body.appendChild(ta);\n ta.focus();\n ta.select();\n document.execCommand('copy');\n document.body.removeChild(ta);\n this.$message({\n message: '已复制到剪贴板',\n type: 'success',\n duration: 1500\n });\n } catch {\n this.$message({\n message: '复制失败',\n type: 'error',\n duration: 2000\n });\n }\n },\n copyAsImage(content) {\n if (!content) return;\n const div = document.createElement('div');\n div.className = 'copy-image-render';\n div.style.cssText = 'position:fixed;left:-9999px;top:0;width:600px;padding:20px;background:#fff;font-size:14px;line-height:1.6;color:#333;border-radius:8px;font-family:-apple-system,BlinkMacSystemFont,sans-serif;';\n // 内联表格样式(因 Vue 作用域样式不覆盖复制用的脱离文档流 div)\n div.innerHTML = this.renderMarkdown(content) + '<style>table{border-collapse:collapse;width:100%;margin:6px 0;font-size:14px}' + 'th,td{border:1px solid #e8e8e8;padding:5px 8px;text-align:left}' + 'th{background:#fafafa;font-weight:600}</style>';\n document.body.appendChild(div);\n this.$message({\n message: '正在生成图片...',\n type: 'info',\n duration: 2000\n });\n (0, _html2canvas.default)(div, {\n scale: 2,\n useCORS: true,\n backgroundColor: '#ffffff'\n }).then(canvas => {\n // 检测是否支持 ClipboardItem(部分 WebView 不支持)\n const canCopyImage = typeof ClipboardItem !== 'undefined' && navigator.clipboard && typeof navigator.clipboard.write === 'function';\n if (canCopyImage) {\n canvas.toBlob(blob => {\n if (blob) {\n navigator.clipboard.write([new ClipboardItem({\n 'image/png': blob\n })]).then(() => {\n this.$message({\n message: '图片已复制到剪贴板',\n type: 'success',\n duration: 1500\n });\n }).catch(() => {\n // ClipboardItem 存在但写入失败 → 降级下载\n this._downloadCanvas(canvas);\n });\n }\n }, 'image/png');\n } else {\n // 不支持剪贴板写图片 → 直接下载\n this._downloadCanvas(canvas);\n }\n }).catch(() => {\n this.$message({\n message: '生成图片失败',\n type: 'error',\n duration: 2000\n });\n }).finally(() => {\n document.body.removeChild(div);\n });\n },\n _downloadCanvas(canvas) {\n const link = document.createElement('a');\n link.download = '消息图片.png';\n link.href = canvas.toDataURL('image/png');\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n this.$message({\n message: '已保存图片到本地',\n type: 'success',\n duration: 2000\n });\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/ChatDetail.vue?./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!./node_modules/_babel-loader@8.4.1@babel-loader/lib!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
954
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.array-buffer.detached.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array-buffer.detached.js\");\n__webpack_require__(/*! core-js/modules/es.array-buffer.transfer.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array-buffer.transfer.js\");\n__webpack_require__(/*! core-js/modules/es.array-buffer.transfer-to-fixed-length.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array-buffer.transfer-to-fixed-length.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.map.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.at.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.at.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.find-last.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.find-last.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.find-last-index.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.find-last-index.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.set.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.set.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.to-reversed.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.to-reversed.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.to-sorted.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.to-sorted.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.with.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.typed-array.with.js\");\nvar _markdownIt = _interopRequireDefault(__webpack_require__(/*! markdown-it */ \"./node_modules/_markdown-it@14.1.0@markdown-it/index.mjs\"));\nvar _apichat = __webpack_require__(/*! @lib/api/apichat */ \"./src/lib/api/apichat.js\");\nvar _index = __webpack_require__(/*! @lib/socket/fileManager/obs/index */ \"./src/lib/socket/fileManager/obs/index.js\");\nvar _index2 = _interopRequireDefault(__webpack_require__(/*! @lib/socket/utils/index */ \"./src/lib/socket/utils/index.js\"));\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _apiObs = _interopRequireDefault(__webpack_require__(/*! @lib/api/apiObs */ \"./src/lib/api/apiObs.js\"));\nvar _html2canvas = _interopRequireDefault(__webpack_require__(/*! html2canvas */ \"./node_modules/_html2canvas@1.4.1@html2canvas/dist/html2canvas.js\"));\nconst md = new _markdownIt.default({\n breaks: true,\n html: false,\n linkify: true,\n typographer: true\n});\nmd.enable('table');\nvar _default = exports.default = {\n name: 'ChatDetail',\n props: {\n isMobile: {\n type: Boolean,\n default: false\n },\n activeSessionId: {\n type: String,\n default: ''\n },\n currentAgent: {\n type: String,\n default: ''\n },\n agentInfo: {\n type: Object,\n default: () => ({})\n },\n currentAgentDesc: {\n type: String,\n default: ''\n },\n showSidebar: {\n type: Boolean,\n default: false\n },\n showH5List: {\n type: Boolean,\n default: false\n },\n showAgentSelect: {\n type: Boolean,\n default: false\n },\n agentList: {\n type: Array,\n default: () => []\n }\n },\n data() {\n return {\n messages: [],\n inputText: '',\n sending: false,\n waitTimer: null,\n waitSeconds: 0,\n canceling: false,\n msgPage: 1,\n msgMaxPage: 1,\n msgTotal: 0,\n eventSource: null,\n showToolInfo: false,\n showDownBtn: false,\n lastScrollTop: 0,\n scrollTimer: null,\n contentCache: {},\n loadingSessionMsg: false,\n greeting: '',\n _scrollTimer: null,\n _userScrolledUp: false,\n voiceMode: false,\n isRecording: false,\n recordDuration: 0,\n recordingTimer: null,\n audioContext: null,\n audioStream: null,\n audioProcessor: null,\n audioChunks: [],\n audioSampleRate: 16000,\n isCancelSwipe: false,\n recordStartY: 0,\n _pendingSendText: null\n };\n },\n computed: {\n waitClass() {\n if (this.waitSeconds > 15) return 'wait-15';\n if (this.waitSeconds > 10) return 'wait-10';\n if (this.waitSeconds > 5) return 'wait-5';\n return '';\n },\n currentAgentName() {\n if (!this.currentAgent) return '';\n const a = this.agentList.find(x => x.agentCode === this.currentAgent);\n return a ? a.agentName || a.agentCode : this.currentAgent;\n }\n },\n watch: {\n contentCache: {\n handler(val) {\n // 保持响应性\n },\n immediate: true\n },\n activeSessionId(val) {\n if (val && this._pendingSendText) {\n const text = this._pendingSendText;\n this._pendingSendText = null;\n this.$nextTick(() => this._sendMessage(text));\n }\n }\n },\n mounted() {\n if (window.visualViewport) {\n window.visualViewport.addEventListener('resize', this.onViewportResize, {\n passive: true\n });\n }\n },\n beforeDestroy() {\n if (window.visualViewport) {\n window.visualViewport.removeEventListener('resize', this.onViewportResize);\n }\n this.releaseAudio();\n this.contentCache = {};\n clearTimeout(this._scrollTimer);\n if (this.eventSource) {\n this.eventSource.onerror = null;\n this.eventSource.close();\n this.eventSource = null;\n }\n if (this.waitTimer) {\n clearInterval(this.waitTimer);\n this.waitTimer = null;\n }\n if (this._typeTimer) {\n clearInterval(this._typeTimer);\n this._typeTimer = null;\n }\n },\n methods: {\n getInitial(name) {\n if (!name) return '?';\n return name.charAt(0);\n },\n formatTime(t) {\n if (!t) return '';\n const d = new Date(t.replace(' ', 'T'));\n const now = new Date();\n const diff = (now - d) / 1000;\n if (diff < 60) return '刚刚';\n if (diff < 3600) return Math.floor(diff / 60) + '分钟前';\n if (diff < 86400) return Math.floor(diff / 3600) + '小时前';\n return d.getMonth() + 1 + '/' + d.getDate();\n },\n escapeHtml(text) {\n if (!text) return '';\n return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n },\n renderMarkdown(text) {\n if (!text) return '';\n try {\n return md.render(text);\n } catch (err) {\n return this.escapeHtml(text);\n }\n },\n renderStreaming(text, msgKey) {\n if (!text) return '';\n const cache = this.contentCache[msgKey];\n const lines = text.split('\\n');\n const lastLineIdx = lines.length - 1;\n if (!cache) {\n try {\n const html = md.render(text);\n this.$set(this.contentCache, msgKey, {\n renderedLines: lastLineIdx,\n html,\n fullText: text\n });\n return html;\n } catch {\n return this.escapeHtml(text);\n }\n }\n if (text === cache.fullText) return cache.html;\n cache.fullText = text;\n\n // 行数没变,仅末尾追加字符,直接拼接尾行\n if (lastLineIdx === cache.renderedLines) {\n return cache.html + this.escapeHtml(lines[lastLineIdx]);\n }\n\n // 场景1:行数变少/文本回退截断,全量重渲染\n if (lastLineIdx < cache.renderedLines) {\n try {\n const fullLines = lines.slice(0, lastLineIdx);\n let newBaseHtml = '';\n if (fullLines.length > 0) {\n newBaseHtml = md.render(fullLines.join('\\n'));\n }\n cache.html = newBaseHtml;\n cache.renderedLines = lastLineIdx;\n const lastLine = this.escapeHtml(lines[lastLineIdx]);\n return cache.html + (lastLine || '');\n } catch {\n return this.escapeHtml(text);\n }\n }\n\n // 场景2:新增完整行\n if (cache.renderedLines < lastLineIdx) {\n const allFullLines = lines.slice(0, lastLineIdx);\n let newBaseHtml = '';\n if (allFullLines.length > 0) {\n newBaseHtml = md.render(allFullLines.join('\\n'));\n }\n cache.html = newBaseHtml;\n cache.renderedLines = lastLineIdx;\n }\n const lastLine = this.escapeHtml(lines[lastLineIdx]);\n cache.renderedLines = lastLineIdx;\n return cache.html + (lastLine || '');\n },\n getChatAvatarStyle(agent, avatar) {\n if (avatar) {\n return {\n backgroundImage: `url(${avatar})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat'\n };\n }\n const _agent = this.agentList.find(x => x.agentCode === agent);\n if (_agent && _agent.avatar) {\n return {\n backgroundImage: `url(${_agent.avatar})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat'\n };\n }\n // 没有网络图片时,根据智能体在 agentList 中的索引位置决定颜色\n const index = this.agentList.findIndex(item => item.agentCode === agent);\n if (index !== -1) {\n const colorIndex = index % 4 + 1;\n return {\n background: this.getGradientByColorIndex(colorIndex)\n };\n }\n return {\n background: 'linear-gradient(135deg, #1677ff, #4096ff)'\n };\n },\n getGradientByColorIndex(index) {\n const gradients = {\n 1: 'linear-gradient(135deg, #1677ff, #4096ff)',\n 2: 'linear-gradient(135deg, #52c41a, #73d13d)',\n 3: 'linear-gradient(135deg, #fa8c16, #ffa940)',\n 4: 'linear-gradient(135deg, #722ed1, #b37feb)'\n };\n return gradients[index] || gradients[1];\n },\n sendQuickMsg(message) {\n if (message) {\n this.inputText = message;\n this.sendMessage();\n }\n },\n formatMixText(str) {\n if (!str) return '';\n let res = str.replace(/([a-zA-Z0-9])([\\u4e00-\\u9fff])/g, '$1 $2').replace(/([\\u4e00-\\u9fff])([a-zA-Z0-9])/g, '$1 $2');\n res = res.replace(/([a-z])([A-Z])/g, '$1 $2');\n return res;\n },\n // 检测是否滚动到底部,控制向下箭头显示隐藏\n checkScrollBottom(forceShowWhenNotBottom = false) {\n const el = this.$refs.messagesRef;\n if (!el) {\n this.showDownBtn = false;\n return;\n }\n const {\n scrollHeight,\n scrollTop,\n clientHeight\n } = el;\n const remain = scrollHeight - scrollTop - clientHeight;\n const atBottom = remain <= 80;\n\n // 检测用户是否主动向上滚动(远离底部)\n if (remain > 80 && scrollTop < this.lastScrollTop) {\n this._userScrolledUp = true;\n }\n if (atBottom) {\n this._userScrolledUp = false;\n this.showDownBtn = false;\n } else if (this._userScrolledUp) {\n // 用户已主动上滚,保持显示\"到底部\"按钮,不自动回滚\n this.showDownBtn = true;\n } else if (this.sending && scrollTop >= this.lastScrollTop && !forceShowWhenNotBottom) {\n this.showDownBtn = false;\n } else {\n this.showDownBtn = true;\n }\n this.lastScrollTop = scrollTop;\n this.$emit('scroll-bottom-check', {\n showDownBtn: this.showDownBtn,\n lastScrollTop: this.lastScrollTop\n });\n },\n // H5 输入框获取焦点 - 滚动到底部让键盘不遮挡\n onInputFocus() {\n if (!this.isMobile) return;\n setTimeout(() => {\n window.scrollTo(0, document.body.scrollHeight);\n }, 300);\n },\n // visualViewport 变化时(如键盘弹出)调整滚动位置\n onViewportResize() {\n if (!this.isMobile) return;\n const activeEl = document.activeElement;\n if (activeEl && (activeEl.tagName === 'TEXTAREA' || activeEl.tagName === 'INPUT')) {\n window.scrollTo(0, document.body.scrollHeight);\n }\n },\n autoResizeTextarea() {\n const ta = this.$refs.taRef;\n if (!ta) return;\n const isMobile = this.isMobile;\n const baseH = isMobile ? 36 : 100;\n const maxH = isMobile ? 100 : 180;\n ta.style.height = `${baseH}px`;\n const realH = ta.scrollHeight;\n if (realH > baseH) {\n ta.style.height = `${Math.min(realH, maxH)}px`;\n }\n this.$nextTick(() => {\n this.checkScrollBottom(true);\n });\n },\n // Ctrl+Enter换行\n newLine(e) {\n e.preventDefault();\n const ta = this.$refs.taRef;\n const start = ta.selectionStart;\n const end = ta.selectionEnd;\n this.inputText = this.inputText.slice(0, start) + '\\n' + this.inputText.slice(end);\n this.$nextTick(() => {\n ta.selectionStart = ta.selectionEnd = start + 1;\n this.autoResizeTextarea();\n });\n },\n toggleVoiceMode() {\n if (this.voiceMode) {\n this.voiceMode = false;\n this.releaseAudio();\n return;\n }\n // 进入语音模式前提前请求麦克风权限,避免触摸时异步弹窗导致 touchend 丢失\n this.ensureAudioReady().then(ready => {\n if (ready) {\n this.voiceMode = true;\n } else {\n this.voiceMode = false;\n }\n });\n },\n // 确保音频设备已就绪\n async ensureAudioReady() {\n if (this.audioContext && this.audioStream) return true;\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n alert('当前环境不支持麦克风访问');\n return false;\n }\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: true\n });\n this.audioStream = stream;\n const audioContext = new (window.AudioContext || window.webkitAudioContext)();\n // iOS 上 AudioContext 默认 suspended,需要手动 resume\n if (audioContext.state === 'suspended') {\n await audioContext.resume();\n }\n this.audioContext = audioContext;\n // 采集实际采样率(iOS 会忽略 sampleRate 参数,使用硬件采样率)\n this.audioSampleRate = audioContext.sampleRate || 16000;\n const source = audioContext.createMediaStreamSource(stream);\n // 保存 source 引用到实例,防止 iOS Safari 垃圾回收导致音频处理中断\n this.audioSource = source;\n const processor = audioContext.createScriptProcessor(4096, 1, 1);\n this.audioProcessor = processor;\n\n // iOS 上 onaudioprocess 可能先于 isRecording=true 触发\n // 因此不依赖 isRecording 过滤,由外部控制 audioChunks 的清零时机\n processor.onaudioprocess = e => {\n const inputData = e.inputBuffer.getChannelData(0);\n this.audioChunks.push(new Float32Array(inputData));\n };\n source.connect(processor);\n processor.connect(audioContext.destination);\n return true;\n } catch (err) {\n console.error('麦克风访问失败:', err);\n alert('麦克风权限被拒绝');\n return false;\n }\n },\n // H5语音录制 - 触摸开始\n async onRecordTouchStart(e) {\n if (this.sending) return;\n const ready = await this.ensureAudioReady();\n if (!ready) return;\n this.isCancelSwipe = false;\n this.recordStartY = e.touches[0].clientY;\n this.recordDuration = 0;\n this.audioChunks = [];\n this.isRecording = true;\n this.recordingTimer = setInterval(() => {\n this.recordDuration++;\n if (this.recordDuration >= 60) {\n this.onRecordTouchEnd();\n }\n }, 1000);\n },\n // H5语音录制 - 触摸移动\n onRecordTouchMove(e) {\n if (!this.isRecording) return;\n const touch = e.touches[0];\n const moveY = touch.clientY;\n const cancelThreshold = 60;\n this.isCancelSwipe = this.recordStartY - moveY > cancelThreshold;\n },\n // H5语音录制 - 触摸结束\n onRecordTouchEnd() {\n if (!this.isRecording) return;\n this.isRecording = false;\n if (this.recordingTimer) {\n clearInterval(this.recordingTimer);\n this.recordingTimer = null;\n }\n this.stopAudioCapture(!this.isCancelSwipe);\n },\n // 停止音频采集并输出 WAV\n stopAudioCapture(shouldSend) {\n this.isRecording = false;\n if (shouldSend && this.audioChunks.length > 0) {\n const wavBlob = this.encodePCMToWav(this.audioChunks, this.audioSampleRate || 16000);\n this.sendAudioBlob(wavBlob);\n }\n this.audioChunks = [];\n },\n // 取消录音\n cancelRecording() {\n this.isRecording = false;\n if (this.recordingTimer) {\n clearInterval(this.recordingTimer);\n this.recordingTimer = null;\n }\n this.recordDuration = 0;\n this.isCancelSwipe = false;\n this.audioChunks = [];\n },\n // 释放音频资源\n releaseAudio() {\n this.cancelRecording();\n if (this.audioProcessor) {\n this.audioProcessor.disconnect();\n this.audioProcessor = null;\n }\n if (this.audioSource) {\n this.audioSource.disconnect();\n this.audioSource = null;\n }\n if (this.audioContext) {\n this.audioContext.close().catch(() => {});\n this.audioContext = null;\n }\n if (this.audioStream) {\n this.audioStream.getTracks().forEach(t => t.stop());\n this.audioStream = null;\n }\n },\n // 将 Float32 PCM 数据编码为 WAV Blob\n encodePCMToWav(chunks, sampleRate) {\n let totalLength = 0;\n for (const chunk of chunks) {\n totalLength += chunk.length;\n }\n const pcmData = new Int16Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n for (let i = 0; i < chunk.length; i++) {\n const s = Math.max(-1, Math.min(1, chunk[i]));\n pcmData[offset++] = s < 0 ? s * 0x8000 : s * 0x7FFF;\n }\n }\n const numChannels = 1;\n const bitsPerSample = 16;\n const byteRate = sampleRate * numChannels * bitsPerSample / 8;\n const blockAlign = numChannels * bitsPerSample / 8;\n const dataSize = pcmData.length * (bitsPerSample / 8);\n const headerSize = 44;\n const totalSize = headerSize + dataSize;\n const buffer = new ArrayBuffer(totalSize);\n const view = new DataView(buffer);\n this._wavWriteString(view, 0, 'RIFF');\n view.setUint32(4, totalSize - 8, true);\n this._wavWriteString(view, 8, 'WAVE');\n this._wavWriteString(view, 12, 'fmt ');\n view.setUint32(16, 16, true);\n view.setUint16(20, 1, true);\n view.setUint16(22, numChannels, true);\n view.setUint32(24, sampleRate, true);\n view.setUint32(28, byteRate, true);\n view.setUint16(32, blockAlign, true);\n view.setUint16(34, bitsPerSample, true);\n this._wavWriteString(view, 36, 'data');\n view.setUint32(40, dataSize, true);\n const pcmView = new Int16Array(buffer, headerSize, pcmData.length);\n pcmView.set(pcmData);\n return new Blob([buffer], {\n type: 'audio/wav'\n });\n },\n _wavWriteString(view, offset, str) {\n for (let i = 0; i < str.length; i++) {\n view.setUint8(offset + i, str.charCodeAt(i));\n }\n },\n // 发送音频\n sendAudioBlob(blob) {\n let appSeqId = _index2.default.getAppSeqId();\n let name = appSeqId + '.wav';\n const file = new File([blob], name, {\n type: 'audio/wav'\n });\n this.sendAudioMessage(file);\n },\n sendAudioMessage(file) {\n const sttKey = 'stt_' + Date.now();\n const sttMsg = {\n role: 'user',\n content: '转化中...',\n _sttStatus: 'pending',\n _sttKey: sttKey,\n createTime: new Date().toISOString(),\n _key: sttKey\n };\n this.messages.push(sttMsg);\n this.scrollToBottom(true);\n (0, _index.fileUploadToObs)({\n _file: file,\n appSeqId: file.name\n }).then(resp => {\n if (resp.CommonMsg.Status === 200) {\n return _apiObs.default.aliAudioToText({\n url: resp.obs_upload_data.obsUrl\n }).then(result => {\n if (result.code === '200' && result.data) {\n const idx = this.messages.findIndex(m => m._sttKey === sttKey);\n if (idx !== -1) {\n this.messages.splice(idx, 1);\n }\n this.sendQuickMsg(result.data);\n } else {\n throw new Error(result.msg || '语音转文字失败');\n }\n });\n } else {\n throw new Error(resp.CommonMsg.Message || '文件上传失败');\n }\n }).catch(err => {\n console.error('语音转文字失败:', err);\n const idx = this.messages.findIndex(m => m._sttKey === sttKey);\n if (idx !== -1) {\n this.$set(this.messages, idx, {\n ...this.messages[idx],\n _sttStatus: 'error',\n content: '语音转文字失败'\n });\n }\n this.$message.error('语音转文字失败');\n });\n this.$message.success(`录音完成 (${this.recordDuration}s)`);\n },\n clearWaitTimer() {\n if (this.waitTimer) {\n clearInterval(this.waitTimer);\n this.waitTimer = null;\n }\n },\n loadMoreMessages() {\n const nextPage = this.msgPage + 1;\n const maxPage = Math.ceil(this.msgTotal / 10);\n if (nextPage > maxPage) {\n this.loadingMore = false;\n return;\n }\n (0, _apichat.getSessionMessages)(this.activeSessionId, nextPage, 10).then(res => {\n const list = Array.isArray(res) ? res : res.list || [];\n this.msgPage = nextPage;\n const asAsc = (list || []).slice().reverse();\n const prepend = asAsc.map(m => ({\n role: m.role,\n content: m.content || '',\n thinking: m.thinking || '',\n toolCalls: [],\n agentName: '',\n createTime: m.createTime || null,\n _key: m.createTime ? 'msg_' + m.createTime : 'msg_' + Date.now() + '_' + Math.random()\n }));\n const container = this.$refs.messagesRef;\n const oldScrollHeight = container ? container.scrollHeight : 0;\n const oldScrollTop = container ? container.scrollTop : 0;\n this.messages = [...prepend, ...this.messages];\n this.$nextTick(() => {\n if (container) {\n container.scrollTop = oldScrollTop + (container.scrollHeight - oldScrollHeight);\n }\n this.loadingMore = false;\n });\n }).catch(() => {\n this.loadingMore = false;\n });\n },\n onScrollMessages() {\n const container = this.$refs.messagesRef;\n if (!container || this.loadingMore) return;\n const isAtBottom = container.scrollTop + container.clientHeight >= container.scrollHeight - 100;\n this.checkScrollBottom();\n if (isAtBottom) return;\n if (container.scrollTop < 50 && this.msgPage < Math.ceil(this.msgTotal / 10)) {\n this.loadingMore = true;\n this.loadMoreMessages();\n }\n },\n async sendMessage() {\n const text = this.inputText.trim();\n if (!text || this.sending) return;\n if (text.length > 300) {\n this.$message({\n message: '消息内容不能超过300字',\n type: 'warning',\n duration: 2000\n });\n return;\n }\n if (!this.activeSessionId) {\n this.$emit('start-session');\n this._pendingSendText = text;\n return;\n }\n this._sendMessage(text);\n },\n async _sendMessage(text) {\n this.inputText = '';\n const ta = this.$refs.taRef;\n const isMobile = this.isMobile;\n const baseH = isMobile ? 36 : 100;\n if (ta) {\n ta.style.height = baseH + 'px';\n }\n this.showDownBtn = false;\n this.messages.push({\n role: 'user',\n content: text,\n createTime: new Date().toISOString(),\n _key: 'user_' + Date.now() + '_' + Math.random()\n });\n const agentName = this.currentAgentName;\n const msgIdx = this.messages.push({\n role: \"assistant\",\n content: \"\",\n thinking: \"\",\n loading: true,\n toolCalls: [],\n agentName,\n createTime: new Date().toISOString(),\n _key: 'asst_' + Date.now() + '_' + Math.random()\n }) - 1;\n this.scrollToBottom(true);\n this.sending = true;\n this.waitSeconds = 0;\n if (this.waitTimer) clearInterval(this.waitTimer);\n this.waitTimer = setInterval(() => {\n this.waitSeconds++;\n }, 1000);\n let thinkingBuffer = '';\n let finalContent = '';\n let answerBuffer = '';\n let thinkDisplayed = 0;\n let typeTimer = null;\n let streamDone = false;\n typeTimer = setInterval(() => {\n if (!this.messages[msgIdx]) return;\n\n // Phase 1: 逐字展示思考内容(不 return,让 Phase 2 也能同时执行)\n if (thinkDisplayed < thinkingBuffer.length) {\n thinkDisplayed += 50;\n if (thinkDisplayed > thinkingBuffer.length) thinkDisplayed = thinkingBuffer.length;\n this.messages[msgIdx].thinking = thinkingBuffer.substring(0, thinkDisplayed);\n this.scrollToBottom();\n // 不 return,让 Phase 2 也能执行,避免 iOS 上思考内容过长阻塞回答内容展示\n }\n\n // Phase 2: 逐行展示(已完成的行整行出现,未完成的行也即时显示)\n const target = finalContent || answerBuffer;\n const msg = this.messages[msgIdx];\n const revealedLen = msg._revealedLen || 0;\n if (target.length > revealedLen) {\n const remaining = target.substring(revealedLen);\n const nextNewline = remaining.indexOf('\\n');\n if (nextNewline !== -1) {\n // 新的一行已完成 → 整行出现\n const endPos = revealedLen + nextNewline + 1;\n msg._revealedLen = endPos;\n msg.content = target.substring(0, endPos);\n this.scrollToBottom();\n return;\n }\n\n // 当前行未完成 → 逐步展示(每次 30 字符),确保 iOS 上也有渐进效果\n const revealStep = 30;\n const newRevealedLen = Math.min(revealedLen + revealStep, target.length);\n msg._revealedLen = newRevealedLen;\n msg.content = target.substring(0, newRevealedLen);\n this.scrollToBottom();\n return;\n }\n\n // Phase 3: 流已结束且内容已全部展示 → 收尾\n if (streamDone) {\n clearInterval(typeTimer);\n const key = this.messages[msgIdx]._key;\n if (key) {\n this.$delete(this.contentCache, key);\n this.$delete(this.contentCache, key + '_t');\n }\n typeTimer = null;\n this.messages[msgIdx].content = finalContent;\n this.messages[msgIdx].thinking = thinkingBuffer;\n this.messages[msgIdx].loading = false;\n this.sending = false;\n this.clearWaitTimer();\n this.scrollToBottom();\n this.$emit('session-refresh');\n this.$emit('message-sent');\n }\n }, 30);\n const url = (0, _apichat.createStreamUrl)(this.activeSessionId, text);\n if (this.eventSource) {\n this.eventSource.close();\n }\n this.eventSource = new EventSource(url);\n const es = this.eventSource;\n es.addEventListener('reasoning', e => {\n if (e.data) {\n const chunk = e.data;\n let cleanChunk = chunk.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/([a-zA-Z])([\\u4e00-\\u9fff])/g, '$1 $2').replace(/([\\u4e00-\\u9fff])([a-zA-Z])/g, '$1 $2').replace(/([a-zA-Z])(\\d)/g, '$1 $2').replace(/(\\d)([a-zA-Z])/g, '$1 $2').replace(/\\s+([:,.!?])/g, '$1').replace(/([:,.!?])\\s+/g, '$1 ');\n cleanChunk = cleanChunk.replace(/\\s+/g, ' ');\n const lastChar = thinkingBuffer.slice(-1);\n const firstChar = cleanChunk.slice(0, 1);\n const isLetter = c => /[a-zA-Z]/.test(c);\n if (isLetter(lastChar) && isLetter(firstChar)) {\n thinkingBuffer += ' ' + cleanChunk;\n } else {\n thinkingBuffer += cleanChunk;\n }\n }\n });\n es.addEventListener('reasoning_result', e => {\n if (e.data) {\n thinkingBuffer = e.data;\n }\n });\n es.addEventListener('answer', e => {\n if (e.data) {\n answerBuffer += e.data.replace(/([a-zA-Z]+)([\\u4e00-\\u9fff])/g, '$1 $2').replace(/([\\u4e00-\\u9fff])([a-zA-Z]+)/g, '$1 $2').replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/([a-zA-Z])(\\d)/g, '$1 $2').replace(/(\\d)([a-zA-Z])/g, '$1 $2');\n }\n });\n es.addEventListener('tool_result', e => {\n if (e.data && this.messages[msgIdx]) {\n if (!this.messages[msgIdx].toolCalls) this.messages[msgIdx].toolCalls = [];\n this.messages[msgIdx].toolCalls.push(e.data);\n this.scrollToBottom();\n }\n });\n es.addEventListener('agent_result', e => {\n finalContent = e.data || '';\n streamDone = true;\n es.close();\n this.eventSource = null;\n });\n es.onerror = err => {\n console.log('[SSE] onerror', err);\n if (thinkingBuffer.length > 0 && !streamDone) finalContent = thinkingBuffer;\n if (!streamDone) finalContent = '❌ 连接中断';\n streamDone = true;\n es.close();\n this.eventSource = null;\n };\n },\n stopAgent() {\n if (this.eventSource) {\n this.eventSource.close();\n this.eventSource = null;\n }\n if (this.activeSessionId) {\n (0, _apichat.stopStream)(this.activeSessionId).catch(() => {});\n }\n if (this.messages.length > 0) {\n const last = this.messages[this.messages.length - 1];\n if (last && last.loading) {\n last.content = last.content || last.thinking || '⏹ 已停止';\n last.loading = false;\n this.$delete(this.contentCache, last._key);\n }\n }\n this.sending = false;\n this.clearWaitTimer();\n },\n scrollToTop() {\n const el = this.$refs.messagesRef;\n if (el) el.scrollTop = 0;\n },\n scrollToBottom(force = false) {\n if (this.showDownBtn && !force) return;\n this.$nextTick(() => {\n const el = this.$refs.messagesRef;\n if (el) {\n el.scrollTop = el.scrollHeight;\n this.lastScrollTop = el.scrollTop;\n this.showDownBtn = false;\n this._userScrolledUp = false;\n }\n });\n },\n scrollToBottomOnce() {\n clearTimeout(this._scrollTimer);\n this.$nextTick(() => {\n const tryScroll = () => {\n const el = this.$refs.messagesRef;\n if (!el) {\n this._scrollTimer = setTimeout(tryScroll, 50);\n return;\n }\n const originalScrollBehavior = el.style.scrollBehavior;\n el.style.scrollBehavior = 'auto';\n el.scrollTop = el.scrollHeight - el.clientHeight;\n el.style.scrollBehavior = originalScrollBehavior;\n this.showDownBtn = false;\n this._userScrolledUp = false;\n };\n tryScroll();\n });\n },\n copyText(content) {\n if (!content) return;\n const text = content.replace(/<[^>]+>/g, '');\n\n // 优先使用 Clipboard API(HTTPS 环境)\n if (navigator.clipboard && navigator.clipboard.writeText) {\n navigator.clipboard.writeText(text).then(() => {\n this.$message({\n message: '已复制到剪贴板',\n type: 'success',\n duration: 1500\n });\n }).catch(() => {\n this._fallbackCopyText(text);\n });\n } else {\n this._fallbackCopyText(text);\n }\n },\n _fallbackCopyText(text) {\n try {\n const ta = document.createElement('textarea');\n ta.value = text;\n ta.style.cssText = 'position:fixed;left:-9999px;top:0;opacity:0';\n document.body.appendChild(ta);\n ta.focus();\n ta.select();\n document.execCommand('copy');\n document.body.removeChild(ta);\n this.$message({\n message: '已复制到剪贴板',\n type: 'success',\n duration: 1500\n });\n } catch {\n this.$message({\n message: '复制失败',\n type: 'error',\n duration: 2000\n });\n }\n },\n copyAsImage(content) {\n if (!content) return;\n const div = document.createElement('div');\n div.className = 'copy-image-render';\n div.style.cssText = 'position:fixed;left:-9999px;top:0;width:600px;padding:20px;background:#fff;font-size:14px;line-height:1.6;color:#333;border-radius:8px;font-family:-apple-system,BlinkMacSystemFont,sans-serif;';\n // 内联表格样式(因 Vue 作用域样式不覆盖复制用的脱离文档流 div)\n div.innerHTML = this.renderMarkdown(content) + '<style>table{border-collapse:collapse;width:100%;margin:6px 0;font-size:14px}' + 'th,td{border:1px solid #e8e8e8;padding:5px 8px;text-align:left}' + 'th{background:#fafafa;font-weight:600}</style>';\n document.body.appendChild(div);\n this.$message({\n message: '正在生成图片...',\n type: 'info',\n duration: 2000\n });\n (0, _html2canvas.default)(div, {\n scale: 2,\n useCORS: true,\n backgroundColor: '#ffffff'\n }).then(canvas => {\n // 检测是否支持 ClipboardItem(部分 WebView 不支持)\n const canCopyImage = typeof ClipboardItem !== 'undefined' && navigator.clipboard && typeof navigator.clipboard.write === 'function';\n if (canCopyImage) {\n canvas.toBlob(blob => {\n if (blob) {\n navigator.clipboard.write([new ClipboardItem({\n 'image/png': blob\n })]).then(() => {\n this.$message({\n message: '图片已复制到剪贴板',\n type: 'success',\n duration: 1500\n });\n }).catch(() => {\n // ClipboardItem 存在但写入失败 → 降级下载\n this._downloadCanvas(canvas);\n });\n }\n }, 'image/png');\n } else {\n // 不支持剪贴板写图片 → 直接下载\n this._downloadCanvas(canvas);\n }\n }).catch(() => {\n this.$message({\n message: '生成图片失败',\n type: 'error',\n duration: 2000\n });\n }).finally(() => {\n document.body.removeChild(div);\n });\n },\n _downloadCanvas(canvas) {\n const link = document.createElement('a');\n link.download = '消息图片.png';\n link.href = canvas.toDataURL('image/png');\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n this.$message({\n message: '已保存图片到本地',\n type: 'success',\n duration: 2000\n });\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/ChatDetail.vue?./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!./node_modules/_babel-loader@8.4.1@babel-loader/lib!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
955
955
|
|
|
956
956
|
/***/ }),
|
|
957
957
|
|
|
@@ -963,7 +963,7 @@ eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@
|
|
|
963
963
|
/***/ (function(module, exports, __webpack_require__) {
|
|
964
964
|
|
|
965
965
|
"use strict";
|
|
966
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.filter.js\");\nvar _apichat = __webpack_require__(/*! @lib/api/apichat */ \"./src/lib/api/apichat.js\");\nvar _default = exports.default = {\n name: 'ChatSidebar',\n props: {\n sessions: {\n type: Array,\n default: () => []\n },\n activeSessionId: {\n type: String,\n default: ''\n },\n isMobile: {\n type: Boolean,\n default: false\n },\n isIntelShow: {\n type: Boolean,\n default: false\n },\n showSidebar: {\n type: Boolean,\n default: false\n },\n showH5List: {\n type: Boolean,\n default: false\n },\n loading: {\n type: Boolean,\n default: false\n }\n },\n data() {\n return {\n searchKeyword: '',\n agentSuggestions: [],\n showAgentSuggestions: false,\n longPressTimer: null,\n longPressed: false,\n
|
|
966
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.filter.js\");\nvar _apichat = __webpack_require__(/*! @lib/api/apichat */ \"./src/lib/api/apichat.js\");\nvar _default = exports.default = {\n name: 'ChatSidebar',\n props: {\n sessions: {\n type: Array,\n default: () => []\n },\n activeSessionId: {\n type: String,\n default: ''\n },\n isMobile: {\n type: Boolean,\n default: false\n },\n isIntelShow: {\n type: Boolean,\n default: false\n },\n showSidebar: {\n type: Boolean,\n default: false\n },\n showH5List: {\n type: Boolean,\n default: false\n },\n loading: {\n type: Boolean,\n default: false\n }\n },\n data() {\n return {\n searchKeyword: '',\n agentSuggestions: [],\n showAgentSuggestions: false,\n longPressTimer: null,\n longPressed: false,\n touchTarget: null,\n touchStartX: 0,\n touchStartY: 0,\n touchMoved: false,\n searchTimer: null\n };\n },\n computed: {\n localFilteredSessions() {\n if (!this.searchKeyword) return this.sessions;\n const kw = this.searchKeyword.toLowerCase();\n return this.sessions.filter(s => {\n const name = (s.agentName || s.agentCode || '').toLowerCase();\n return name.includes(kw);\n });\n }\n },\n watch: {\n searchKeyword(val) {\n if (this.searchTimer) clearTimeout(this.searchTimer);\n if (!val.trim()) {\n this.agentSuggestions = [];\n this.showAgentSuggestions = false;\n return;\n }\n this.searchTimer = setTimeout(() => {\n (0, _apichat.getChatAgents)(val.trim()).then(list => {\n this.agentSuggestions = list || [];\n this.showAgentSuggestions = this.agentSuggestions.length > 0;\n }).catch(() => {\n this.agentSuggestions = [];\n });\n }, 300);\n }\n },\n methods: {\n getInitial(name) {\n if (!name) return '?';\n return name.charAt(0);\n },\n formatTime(t) {\n if (!t) return '';\n const d = new Date(t.replace(' ', 'T'));\n const now = new Date();\n const diff = (now - d) / 1000;\n if (diff < 60) return '刚刚';\n if (diff < 3600) return Math.floor(diff / 60) + '分钟前';\n if (diff < 86400) return Math.floor(diff / 3600) + '小时前';\n return d.getMonth() + 1 + '/' + d.getDate();\n },\n onSearchClear() {\n this.searchKeyword = '';\n this.agentSuggestions = [];\n this.showAgentSuggestions = false;\n },\n selectSuggestion(a) {\n this.searchKeyword = '';\n this.agentSuggestions = [];\n this.showAgentSuggestions = false;\n this.$emit('start-chat-from-search', a);\n },\n onSessionClick(s) {\n // 移动端完全由 touch 事件处理导航和长按,click 仅作为 PC 端兜底\n if (this.isMobile) return;\n this.$emit('switch-session', s);\n },\n onSessionTouchStart(s, e) {\n if (!this.isMobile) return;\n this.touchStartX = e.touches[0].clientX;\n this.touchStartY = e.touches[0].clientY;\n this.touchTarget = s;\n this.longPressed = false;\n this.touchMoved = false;\n clearTimeout(this.longPressTimer);\n this.longPressTimer = setTimeout(() => {\n this.longPressed = true;\n // 触觉反馈(支持振动 API 的设备)\n if (window.navigator && window.navigator.vibrate) {\n window.navigator.vibrate(25);\n }\n this.$emit('delete-session', s);\n }, 600);\n },\n onSessionTouchMove(e) {\n if (!this.longPressTimer) return;\n const moveX = e.touches[0].clientX;\n const moveY = e.touches[0].clientY;\n const diffX = Math.abs(moveX - this.touchStartX);\n const diffY = Math.abs(moveY - this.touchStartY);\n // 手指移动超过 8px → 取消长按,标记为滚动不触发点击\n if (diffX > 8 || diffY > 8) {\n clearTimeout(this.longPressTimer);\n this.longPressTimer = null;\n this.touchMoved = true;\n }\n },\n onSessionTouchEnd(e) {\n clearTimeout(this.longPressTimer);\n this.longPressTimer = null;\n\n // 长按已触发删除 或 手指移动过(滚动)→ 不执行任何操作\n if (this.longPressed || this.touchMoved) return;\n\n // 短按 → 阻止后续 click 冒泡,直接导航\n if (this.touchTarget) {\n e.preventDefault();\n this.$emit('switch-session', this.touchTarget);\n }\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/ChatSidebar.vue?./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!./node_modules/_babel-loader@8.4.1@babel-loader/lib!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
967
967
|
|
|
968
968
|
/***/ }),
|
|
969
969
|
|
|
@@ -975,7 +975,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
975
975
|
/***/ (function(module, exports, __webpack_require__) {
|
|
976
976
|
|
|
977
977
|
"use strict";
|
|
978
|
-
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.map.js\");\nvar _apichat = __webpack_require__(/*! @lib/api/apichat */ \"./src/lib/api/apichat.js\");\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _ChatSidebar = _interopRequireDefault(__webpack_require__(/*! ./ChatSidebar.vue */ \"./src/lib/components/chatMain/ChatSidebar.vue\"));\nvar _AgentSelector = _interopRequireDefault(__webpack_require__(/*! ./AgentSelector.vue */ \"./src/lib/components/chatMain/AgentSelector.vue\"));\nvar _ChatDetail = _interopRequireDefault(__webpack_require__(/*! ./ChatDetail.vue */ \"./src/lib/components/chatMain/ChatDetail.vue\"));\nvar _default = exports.default = {\n name: 'ChatMain',\n components: {\n ChatSidebar: _ChatSidebar.default,\n AgentSelector: _AgentSelector.default,\n ChatDetail: _ChatDetail.default\n },\n props: {\n Ak: {\n type: String,\n default: ''\n },\n Sk: {\n type: String,\n default: ''\n },\n imAccount: {\n type: String,\n default: ''\n },\n companyNo: {\n type: String,\n default: ''\n },\n isIntelShow: {\n default: false,\n type: Boolean\n },\n chatImToken: {\n default: '',\n type: String\n }\n },\n data() {\n // 首次渲染前检测窗口宽度,避免 H5 端先显示 PC 布局再切换导致闪烁\n const _isMobile = typeof window !== 'undefined' && window.innerWidth <= 768;\n return {\n agentList: [],\n currentAgent: '',\n currentAgentDesc: '',\n sessionsLoaded: false,\n sessionList: [],\n activeSessionId: '',\n loadingMore: false,\n showAgentSelect: !_isMobile,\n isMobile: _isMobile,\n showSidebar: false,\n showH5List: _isMobile,\n agentInfo: {},\n sessionsLoading: true,\n _swipeStartX: 0,\n _swipeStartY: 0,\n _swipeHandled: false\n };\n },\n created() {\n if (this.Ak || this.Sk) {\n (0, _apichat.setApiAuth)(this.Ak, this.Sk, this.imAccount, this.companyNo, this.chatImToken);\n }\n this.loadAgents();\n this.loadSessions();\n },\n mounted() {\n this.updateViewportState();\n window.addEventListener('resize', this.updateViewportState, {\n passive: true\n });\n // Android WebView 兼容:在 document 级别监听 touchmove/touchend\n // 避免可滚动子元素消费事件后不冒泡到父级\n document.addEventListener('touchmove', this._onSwipeMove, {\n passive: true\n });\n document.addEventListener('touchend', this._onSwipeEnd, {\n passive: true\n });\n // 拦截 Android 系统返回手势:通过 history.pushState + popstate\n window.addEventListener('popstate', this._onPopState);\n // Android 键盘弹出适配:visualViewport 精确反映可视区域高度\n this._setupAndroidKeyboardFix();\n },\n watch: {},\n methods: {\n // ── H5 侧滑手势 ──\n onSwipeTouchStart(e) {\n if (!this.isMobile) return;\n this._swipeStartX = e.touches[0].clientX;\n this._swipeStartY = e.touches[0].clientY;\n this._swipeHandled = false;\n },\n // 在 touchmove 中实时检测\n // 注意:不限制触摸起点位置(移除边缘限制),以兼容 Android 系统手势导航在左边缘的拦截\n _onSwipeMove(e) {\n if (!this.isMobile || this._swipeHandled) return;\n const moveX = e.touches[0].clientX;\n const moveY = e.touches[0].clientY;\n const diffX = moveX - this._swipeStartX;\n const diffY = moveY - this._swipeStartY;\n\n // 向右滑动超过 60px,且水平距离明显大于垂直距离(排除上下滚动干扰)\n if (diffX < 60) return;\n if (Math.abs(diffX) < Math.abs(diffY) * 2) return;\n this._swipeHandled = true;\n this._triggerSwipeAction();\n },\n // touchend 检测(兜底,兼容不支持 touchmove 的场景)\n _onSwipeEnd(e) {\n if (!this.isMobile || this._swipeHandled) return;\n const endX = e.changedTouches[0].clientX;\n const endY = e.changedTouches[0].clientY;\n const diffX = endX - this._swipeStartX;\n const diffY = endY - this._swipeStartY;\n\n // 向右滑动超过 60px,且水平距离明显大于垂直距离\n if (diffX < 60) return;\n if (Math.abs(diffX) < Math.abs(diffY) * 2) return;\n this._swipeHandled = true;\n this._triggerSwipeAction();\n },\n _triggerSwipeAction() {\n if (this.showH5List) {\n // 列表页 → 原生返回\n this.handleNativeBack();\n } else if (!this.showAgentSelect) {\n // 详情页/欢迎页 → 返回列表\n this.goBackToList();\n }\n },\n // 拦截 Android 系统返回手势(通过 history.pushState + popstate)\n // 当用户在详情页触发系统返回时,WebView 先回退历史栈触发 popstate,\n // 我们在这里拦截并导航到列表页,避免 Activity 被直接关闭\n _onPopState() {\n if (!this.isMobile) return;\n // 如果当前在详情页(非列表页、非智能体选择页),拦截系统返回\n if (!this.showH5List && !this.showAgentSelect) {\n this.goBackToList();\n }\n // 如果在列表页(showH5List=true),不做拦截,让系统正常关闭\n },\n handleNewSessionInternal() {\n if (!this.currentAgent) return;\n if (this.activeSessionId) this.closeOldSession();\n (0, _apichat.startSession)(this.currentAgent).then(res => {\n this.activeSessionId = res.sessionId || '';\n this.loadSessions();\n const agent = this.agentList.find(a => a.agentCode === this.currentAgent);\n if (agent) this.addWelcomeMessage(agent);\n }).catch(() => {\n this.sessionsLoading = false;\n });\n },\n updateViewportState() {\n if (typeof window === 'undefined') return;\n const nextIsMobile = window.innerWidth <= 768;\n const wasMobile = this.isMobile;\n this.isMobile = nextIsMobile;\n if (!nextIsMobile) {\n this.showSidebar = false;\n this.showH5List = false;\n } else if (!wasMobile && nextIsMobile) {\n if (this.sessionList.length > 0 && !this.activeSessionId) {\n this.showH5List = true;\n this.showAgentSelect = false;\n }\n }\n },\n toggleSidebar() {\n if (!this.isMobile) return;\n this.showSidebar = !this.showSidebar;\n },\n closeSidebar() {\n this.showSidebar = false;\n },\n handleNativeBack() {\n if (this.$hybrid && typeof this.$hybrid.closePage === 'function') {\n this.$hybrid.closePage();\n } else if (window.history.length > 1) {\n window.history.back();\n }\n },\n handleSidebarBack() {\n this.handleNativeBack();\n },\n agentjumpclick() {\n const cd = this.$refs.chatDetail;\n if (cd && cd.sending) {\n this.$message.warning('AI正在生成内容,暂时请不要切换对话');\n return;\n }\n this.currentAgent = '';\n this.currentAgentDesc = '';\n this.activeSessionId = '';\n this.showAgentSelect = true;\n this.showH5List = false;\n this.closeSidebar();\n },\n goBackToList() {\n const cd = this.$refs.chatDetail;\n if (cd && cd.sending) {\n this.$message.warning('AI正在生成内容,暂时请不要切换对话');\n return;\n }\n if (cd) {\n if (cd.eventSource) {\n cd.eventSource.close();\n cd.eventSource = null;\n }\n if (cd.sseAbortController) {\n cd.sseAbortController.abort();\n cd.sseAbortController = null;\n }\n cd.sending = false;\n cd.clearWaitTimer();\n cd.messages = [];\n cd.contentCache = {};\n }\n this.activeSessionId = '';\n this.currentAgent = '';\n this.currentAgentDesc = '';\n this.agentInfo = {};\n this.showH5List = true;\n this.showAgentSelect = false;\n this.closeSidebar();\n },\n loadAgents() {\n (0, _apichat.getChatAgents)().then(list => {\n this.agentList = list || [];\n }).catch(() => {\n this.sessionsLoading = false;\n });\n },\n loadSessions() {\n this.sessionsLoading = true;\n (0, _apichat.getSessionList)().then(list => {\n this.sessionsLoading = false;\n if (!this.activeSessionId) {\n this.sessionList = list || [];\n if (this.sessionList.length > 0) {\n if (this.isMobile) {\n this.showAgentSelect = false;\n this.showH5List = true;\n this.showSidebar = false;\n } else {\n this.switchSession(this.sessionList[0]);\n }\n }\n if (this.sessionList.length === 0) {\n this.showAgentSelect = true;\n this.showH5List = false;\n }\n } else {\n this.sessionList = list || [];\n let _item = list.find(res => res.sessionId == this.activeSessionId);\n try {\n if (_item && _item.suggestedQuestions) {\n _item.suggestedQuestions = JSON.parse(_item.suggestedQuestions);\n }\n _item && (this.agentInfo = _item);\n } catch (err) {\n this.agentInfo.questionArr = [];\n console.warn('快捷提问解析失败', err);\n }\n }\n }).catch(() => {\n this.sessionsLoading = false;\n });\n },\n startChatWithAgent(agent) {\n console.log('选择了助手', agent.agentCode, this.currentAgent);\n if (agent.agentCode == this.currentAgent) {\n return;\n }\n this.currentAgent = agent.agentCode;\n this.currentAgentDesc = agent.description || '';\n this.agentInfo = {};\n this.showAgentSelect = false;\n this.closeSidebar();\n if (this.isMobile) {\n this.showH5List = false;\n }\n const existing = this.sessionList.find(s => s.agentCode === agent.agentCode);\n if (existing) {\n this.switchSession(existing);\n } else {\n this.handleNewSession();\n }\n },\n handleNewSession() {\n if (!this.currentAgent) return;\n if (this.activeSessionId) this.closeOldSession();\n (0, _apichat.startSession)(this.currentAgent).then(res => {\n this.activeSessionId = res.sessionId || '';\n this.loadSessions();\n const agent = this.agentList.find(a => a.agentCode === this.currentAgent);\n if (agent) this.addWelcomeMessage(agent);\n }).catch(() => {});\n },\n addWelcomeMessage(agent) {\n const cd = this.$refs.chatDetail;\n if (cd) {\n const _agent = this.agentList.find(x => x.agentCode === this.currentAgent);\n cd.greeting = _agent ? _agent.greeting || '很高兴为您服务,请问有什么可以帮到您?' : '';\n }\n },\n async switchSession(s) {\n let cd = this.$refs.chatDetail;\n if (cd && cd.sending) {\n this.$message.warning('AI正在生成内容,暂时请不要切换对话');\n return;\n }\n this.showAgentSelect = false;\n this.closeSidebar();\n if (this.isMobile) {\n this.showH5List = false;\n // 推入历史状态,拦截 Android 系统返回手势\n // 系统返回会触发 WebView 历史回退 → popstate → 我们拦截后 goBackToList\n history.pushState({\n page: 'chatDetail'\n }, '');\n }\n if (this.activeSessionId === s.sessionId) return;\n\n // 移动端刚切换 showH5List=false,ChatDetail 尚未渲染完成,需要等待 nextTick\n if (!cd) {\n await this.$nextTick();\n cd = this.$refs.chatDetail;\n }\n if (cd) {\n cd.contentCache = {};\n cd.messages = [];\n cd.msgPage = 1;\n cd.msgTotal = 0;\n cd.loadingSessionMsg = true;\n }\n this.activeSessionId = s.sessionId;\n this.currentAgent = s.agentCode;\n this.agentInfo = s;\n try {\n if (s.suggestedQuestions) {\n this.agentInfo.suggestedQuestions = JSON.parse(s.suggestedQuestions);\n } else {\n this.agentInfo.suggestedQuestions = [];\n }\n } catch (err) {\n this.agentInfo.questionArr = [];\n console.warn('快捷提问解析失败', err);\n }\n const agent = this.agentList.find(a => a.agentCode === s.agentCode);\n this.currentAgentDesc = agent ? agent.description || '' : '';\n (0, _apichat.syncToken)((0, _cookie.getToken)(), s.sessionId);\n try {\n const res = await (0, _apichat.getSessionMessages)(s.sessionId, 1, 10);\n const list = Array.isArray(res) ? res : res.list || [];\n if (cd) {\n cd.msgTotal = res.total || list.length;\n cd.msgPage = 1;\n const asAsc = (list || []).slice().reverse();\n cd.messages = asAsc.map(m => ({\n role: m.role,\n content: m.content || '',\n thinking: m.thinking || '',\n toolCalls: [],\n agentName: m.role === 'assistant' ? s.agentName || '' : '',\n createTime: m.createTime || null,\n _key: m.createTime ? 'msg_' + m.createTime : 'msg_' + Date.now() + '_' + Math.random()\n }));\n if (cd.messages.length === 0 && agent) {\n const _agent = this.agentList.find(x => x.agentCode === this.currentAgent);\n cd.greeting = _agent ? _agent.greeting || '很高兴为您服务,请问有什么可以帮到您?' : '';\n }\n cd.loadingSessionMsg = false;\n await this.$nextTick();\n this.$nextTick(() => {\n cd.scrollToBottomOnce();\n cd.checkScrollBottom();\n });\n }\n } catch (e) {\n if (cd) {\n cd.messages = [];\n cd.loadingSessionMsg = false;\n }\n }\n },\n handleDeleteSession(s) {\n this.$confirm(`确认删除「${s.agentName || s.agentCode}」的会话?`, '提示', {\n type: 'warning'\n }).then(() => {\n (0, _apichat.deleteSession)(s.sessionId).then(() => {\n if (this.activeSessionId === s.sessionId) {\n this.activeSessionId = '';\n this.currentAgent = '';\n this.currentAgentDesc = '';\n const cd = this.$refs.chatDetail;\n if (cd) {\n cd.messages = [];\n cd.contentCache = {};\n }\n if (this.isMobile) {\n this.showH5List = false;\n this.showAgentSelect = true;\n } else {\n this.showAgentSelect = true;\n }\n }\n this.loadSessions();\n });\n }).catch(() => {});\n },\n closeOldSession() {},\n // ── Android 键盘弹出 & 底部导航栏适配 ──\n _setupAndroidKeyboardFix() {\n const vvp = window.visualViewport;\n if (!vvp || !this.isMobile) return;\n const applyHeight = height => {\n document.documentElement.style.height = height + 'px';\n document.body.style.height = height + 'px';\n window.scrollTo(0, 0);\n };\n this._onVvpResize = () => {\n const diff = window.innerHeight - vvp.height;\n // diff > 50 ≈ 键盘弹出 → 使用 visualViewport 精确高度\n if (Math.abs(diff) > 50) {\n applyHeight(vvp.height);\n } else {\n // 键盘收起 → 使用 innerHeight(已排除底部导航栏区域)\n applyHeight(window.innerHeight);\n }\n };\n vvp.addEventListener('resize', this._onVvpResize);\n\n // 首次加载时确保高度正确(避免底部导航栏导致页面偏移)\n this.$nextTick(() => {\n const diff = window.innerHeight - vvp.height;\n if (Math.abs(diff) > 50) {\n applyHeight(vvp.height);\n } else {\n applyHeight(window.innerHeight);\n }\n });\n },\n _teardownAndroidKeyboardFix() {\n const vvp = window.visualViewport;\n if (vvp && this._onVvpResize) {\n vvp.removeEventListener('resize', this._onVvpResize);\n }\n this._onVvpResize = null;\n document.documentElement.style.height = '';\n document.body.style.height = '';\n }\n },\n beforeDestroy() {\n window.removeEventListener('resize', this.updateViewportState);\n document.removeEventListener('touchmove', this._onSwipeMove);\n document.removeEventListener('touchend', this._onSwipeEnd);\n window.removeEventListener('popstate', this._onPopState);\n this._teardownAndroidKeyboardFix();\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/index.vue?./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!./node_modules/_babel-loader@8.4.1@babel-loader/lib!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
978
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.map.js\");\nvar _apichat = __webpack_require__(/*! @lib/api/apichat */ \"./src/lib/api/apichat.js\");\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _ChatSidebar = _interopRequireDefault(__webpack_require__(/*! ./ChatSidebar.vue */ \"./src/lib/components/chatMain/ChatSidebar.vue\"));\nvar _AgentSelector = _interopRequireDefault(__webpack_require__(/*! ./AgentSelector.vue */ \"./src/lib/components/chatMain/AgentSelector.vue\"));\nvar _ChatDetail = _interopRequireDefault(__webpack_require__(/*! ./ChatDetail.vue */ \"./src/lib/components/chatMain/ChatDetail.vue\"));\nvar _default = exports.default = {\n name: 'ChatMain',\n components: {\n ChatSidebar: _ChatSidebar.default,\n AgentSelector: _AgentSelector.default,\n ChatDetail: _ChatDetail.default\n },\n props: {\n Ak: {\n type: String,\n default: ''\n },\n Sk: {\n type: String,\n default: ''\n },\n imAccount: {\n type: String,\n default: ''\n },\n companyNo: {\n type: String,\n default: ''\n },\n isIntelShow: {\n default: false,\n type: Boolean\n },\n chatImToken: {\n default: '',\n type: String\n }\n },\n data() {\n // 首次渲染前检测窗口宽度,避免 H5 端先显示 PC 布局再切换导致闪烁\n const _isMobile = typeof window !== 'undefined' && window.innerWidth <= 768;\n return {\n agentList: [],\n currentAgent: '',\n currentAgentDesc: '',\n sessionsLoaded: false,\n sessionList: [],\n activeSessionId: '',\n loadingMore: false,\n showAgentSelect: !_isMobile,\n isMobile: _isMobile,\n showSidebar: false,\n showH5List: _isMobile,\n agentInfo: {},\n sessionsLoading: true,\n _swipeStartX: 0,\n _swipeStartY: 0,\n _swipeHandled: false\n };\n },\n created() {\n if (this.Ak || this.Sk) {\n (0, _apichat.setApiAuth)(this.Ak, this.Sk, this.imAccount, this.companyNo, this.chatImToken);\n }\n this.loadAgents();\n this.loadSessions();\n },\n mounted() {\n this.updateViewportState();\n window.addEventListener('resize', this.updateViewportState, {\n passive: true\n });\n // Android WebView 兼容:在 document 级别监听 touchmove/touchend\n // 避免可滚动子元素消费事件后不冒泡到父级\n document.addEventListener('touchmove', this._onSwipeMove, {\n passive: true\n });\n document.addEventListener('touchend', this._onSwipeEnd, {\n passive: true\n });\n // 拦截 Android 系统返回手势:通过 history.pushState + popstate\n window.addEventListener('popstate', this._onPopState);\n },\n watch: {},\n methods: {\n // ── H5 侧滑手势 ──\n onSwipeTouchStart(e) {\n if (!this.isMobile) return;\n this._swipeStartX = e.touches[0].clientX;\n this._swipeStartY = e.touches[0].clientY;\n this._swipeHandled = false;\n },\n // 在 touchmove 中实时检测\n // 注意:不限制触摸起点位置(移除边缘限制),以兼容 Android 系统手势导航在左边缘的拦截\n _onSwipeMove(e) {\n if (!this.isMobile || this._swipeHandled) return;\n const moveX = e.touches[0].clientX;\n const moveY = e.touches[0].clientY;\n const diffX = moveX - this._swipeStartX;\n const diffY = moveY - this._swipeStartY;\n\n // 向右滑动超过 60px,且水平距离明显大于垂直距离(排除上下滚动干扰)\n if (diffX < 60) return;\n if (Math.abs(diffX) < Math.abs(diffY) * 2) return;\n this._swipeHandled = true;\n this._triggerSwipeAction();\n },\n // touchend 检测(兜底,兼容不支持 touchmove 的场景)\n _onSwipeEnd(e) {\n if (!this.isMobile || this._swipeHandled) return;\n const endX = e.changedTouches[0].clientX;\n const endY = e.changedTouches[0].clientY;\n const diffX = endX - this._swipeStartX;\n const diffY = endY - this._swipeStartY;\n\n // 向右滑动超过 60px,且水平距离明显大于垂直距离\n if (diffX < 60) return;\n if (Math.abs(diffX) < Math.abs(diffY) * 2) return;\n this._swipeHandled = true;\n this._triggerSwipeAction();\n },\n _triggerSwipeAction() {\n if (this.showH5List) {\n // 列表页 → 原生返回\n this.handleNativeBack();\n } else if (!this.showAgentSelect) {\n // 详情页/欢迎页 → 返回列表\n this.goBackToList();\n }\n },\n // 拦截 Android 系统返回手势(通过 history.pushState + popstate)\n // 当用户在详情页触发系统返回时,WebView 先回退历史栈触发 popstate,\n // 我们在这里拦截并导航到列表页,避免 Activity 被直接关闭\n _onPopState() {\n if (!this.isMobile) return;\n // 如果当前在详情页(非列表页、非智能体选择页),拦截系统返回\n if (!this.showH5List && !this.showAgentSelect) {\n this.goBackToList();\n }\n // 如果在列表页(showH5List=true),不做拦截,让系统正常关闭\n },\n handleNewSessionInternal() {\n if (!this.currentAgent) return;\n if (this.activeSessionId) this.closeOldSession();\n (0, _apichat.startSession)(this.currentAgent).then(res => {\n this.activeSessionId = res.sessionId || '';\n this.loadSessions();\n const agent = this.agentList.find(a => a.agentCode === this.currentAgent);\n if (agent) this.addWelcomeMessage(agent);\n }).catch(() => {\n this.sessionsLoading = false;\n });\n },\n updateViewportState() {\n if (typeof window === 'undefined') return;\n const nextIsMobile = window.innerWidth <= 768;\n const wasMobile = this.isMobile;\n this.isMobile = nextIsMobile;\n if (!nextIsMobile) {\n this.showSidebar = false;\n this.showH5List = false;\n } else if (!wasMobile && nextIsMobile) {\n if (this.sessionList.length > 0 && !this.activeSessionId) {\n this.showH5List = true;\n this.showAgentSelect = false;\n }\n }\n },\n toggleSidebar() {\n if (!this.isMobile) return;\n this.showSidebar = !this.showSidebar;\n },\n closeSidebar() {\n this.showSidebar = false;\n },\n handleNativeBack() {\n if (this.$hybrid && typeof this.$hybrid.closePage === 'function') {\n this.$hybrid.closePage();\n } else if (window.history.length > 1) {\n window.history.back();\n }\n },\n handleSidebarBack() {\n this.handleNativeBack();\n },\n agentjumpclick() {\n const cd = this.$refs.chatDetail;\n if (cd && cd.sending) {\n this.$message.warning('AI正在生成内容,暂时请不要切换对话');\n return;\n }\n this.currentAgent = '';\n this.currentAgentDesc = '';\n this.activeSessionId = '';\n this.showAgentSelect = true;\n this.showH5List = false;\n this.closeSidebar();\n },\n goBackToList() {\n const cd = this.$refs.chatDetail;\n if (cd && cd.sending) {\n this.$message.warning('AI正在生成内容,暂时请不要切换对话');\n return;\n }\n if (cd) {\n if (cd.eventSource) {\n cd.eventSource.close();\n cd.eventSource = null;\n }\n cd.sending = false;\n cd.clearWaitTimer();\n cd.messages = [];\n cd.contentCache = {};\n }\n this.activeSessionId = '';\n this.currentAgent = '';\n this.currentAgentDesc = '';\n this.agentInfo = {};\n this.showH5List = true;\n this.showAgentSelect = false;\n this.closeSidebar();\n },\n loadAgents() {\n (0, _apichat.getChatAgents)().then(list => {\n this.agentList = list || [];\n }).catch(() => {\n this.sessionsLoading = false;\n });\n },\n loadSessions() {\n this.sessionsLoading = true;\n (0, _apichat.getSessionList)().then(list => {\n this.sessionsLoading = false;\n if (!this.activeSessionId) {\n this.sessionList = list || [];\n if (this.sessionList.length > 0) {\n if (this.isMobile) {\n this.showAgentSelect = false;\n this.showH5List = true;\n this.showSidebar = false;\n } else {\n this.switchSession(this.sessionList[0]);\n }\n }\n if (this.sessionList.length === 0) {\n this.showAgentSelect = true;\n this.showH5List = false;\n }\n } else {\n this.sessionList = list || [];\n let _item = list.find(res => res.sessionId == this.activeSessionId);\n try {\n if (_item && _item.suggestedQuestions) {\n _item.suggestedQuestions = JSON.parse(_item.suggestedQuestions);\n }\n _item && (this.agentInfo = _item);\n } catch (err) {\n this.agentInfo.questionArr = [];\n console.warn('快捷提问解析失败', err);\n }\n }\n }).catch(() => {\n this.sessionsLoading = false;\n });\n },\n startChatWithAgent(agent) {\n console.log('选择了助手', agent.agentCode, this.currentAgent);\n if (agent.agentCode == this.currentAgent) {\n return;\n }\n this.currentAgent = agent.agentCode;\n this.currentAgentDesc = agent.description || '';\n this.agentInfo = {};\n this.showAgentSelect = false;\n this.closeSidebar();\n if (this.isMobile) {\n this.showH5List = false;\n }\n const existing = this.sessionList.find(s => s.agentCode === agent.agentCode);\n if (existing) {\n this.switchSession(existing);\n } else {\n this.handleNewSession();\n }\n },\n handleNewSession() {\n if (!this.currentAgent) return;\n if (this.activeSessionId) this.closeOldSession();\n (0, _apichat.startSession)(this.currentAgent).then(res => {\n this.activeSessionId = res.sessionId || '';\n this.loadSessions();\n const agent = this.agentList.find(a => a.agentCode === this.currentAgent);\n if (agent) this.addWelcomeMessage(agent);\n }).catch(() => {});\n },\n addWelcomeMessage(agent) {\n const cd = this.$refs.chatDetail;\n if (cd) {\n const _agent = this.agentList.find(x => x.agentCode === this.currentAgent);\n cd.greeting = _agent ? _agent.greeting || '很高兴为您服务,请问有什么可以帮到您?' : '';\n }\n },\n async switchSession(s) {\n let cd = this.$refs.chatDetail;\n if (cd && cd.sending) {\n this.$message.warning('AI正在生成内容,暂时请不要切换对话');\n return;\n }\n this.showAgentSelect = false;\n this.closeSidebar();\n if (this.isMobile) {\n this.showH5List = false;\n // 推入历史状态,拦截 Android 系统返回手势\n // 系统返回会触发 WebView 历史回退 → popstate → 我们拦截后 goBackToList\n history.pushState({\n page: 'chatDetail'\n }, '');\n }\n if (this.activeSessionId === s.sessionId) return;\n\n // 移动端刚切换 showH5List=false,ChatDetail 尚未渲染完成,需要等待 nextTick\n if (!cd) {\n await this.$nextTick();\n cd = this.$refs.chatDetail;\n }\n if (cd) {\n cd.contentCache = {};\n cd.messages = [];\n cd.msgPage = 1;\n cd.msgTotal = 0;\n cd.loadingSessionMsg = true;\n }\n this.activeSessionId = s.sessionId;\n this.currentAgent = s.agentCode;\n this.agentInfo = s;\n try {\n if (s.suggestedQuestions) {\n this.agentInfo.suggestedQuestions = JSON.parse(s.suggestedQuestions);\n } else {\n this.agentInfo.suggestedQuestions = [];\n }\n } catch (err) {\n this.agentInfo.questionArr = [];\n console.warn('快捷提问解析失败', err);\n }\n const agent = this.agentList.find(a => a.agentCode === s.agentCode);\n this.currentAgentDesc = agent ? agent.description || '' : '';\n (0, _apichat.syncToken)((0, _cookie.getToken)(), s.sessionId);\n try {\n const res = await (0, _apichat.getSessionMessages)(s.sessionId, 1, 10);\n const list = Array.isArray(res) ? res : res.list || [];\n if (cd) {\n cd.msgTotal = res.total || list.length;\n cd.msgPage = 1;\n const asAsc = (list || []).slice().reverse();\n cd.messages = asAsc.map(m => ({\n role: m.role,\n content: m.content || '',\n thinking: m.thinking || '',\n toolCalls: [],\n agentName: m.role === 'assistant' ? s.agentName || '' : '',\n createTime: m.createTime || null,\n _key: m.createTime ? 'msg_' + m.createTime : 'msg_' + Date.now() + '_' + Math.random()\n }));\n if (cd.messages.length === 0 && agent) {\n const _agent = this.agentList.find(x => x.agentCode === this.currentAgent);\n cd.greeting = _agent ? _agent.greeting || '很高兴为您服务,请问有什么可以帮到您?' : '';\n }\n cd.loadingSessionMsg = false;\n await this.$nextTick();\n this.$nextTick(() => {\n cd.scrollToBottomOnce();\n cd.checkScrollBottom();\n });\n }\n } catch (e) {\n if (cd) {\n cd.messages = [];\n cd.loadingSessionMsg = false;\n }\n }\n },\n handleDeleteSession(s) {\n this.$confirm(`确认删除「${s.agentName || s.agentCode}」的会话?`, '提示', {\n type: 'warning'\n }).then(() => {\n (0, _apichat.deleteSession)(s.sessionId).then(() => {\n if (this.activeSessionId === s.sessionId) {\n this.activeSessionId = '';\n this.currentAgent = '';\n this.currentAgentDesc = '';\n const cd = this.$refs.chatDetail;\n if (cd) {\n cd.messages = [];\n cd.contentCache = {};\n }\n if (this.isMobile) {\n this.showH5List = false;\n this.showAgentSelect = true;\n } else {\n this.showAgentSelect = true;\n }\n }\n this.loadSessions();\n });\n }).catch(() => {});\n },\n closeOldSession() {}\n },\n beforeDestroy() {\n window.removeEventListener('resize', this.updateViewportState);\n document.removeEventListener('touchmove', this._onSwipeMove);\n document.removeEventListener('touchend', this._onSwipeEnd);\n window.removeEventListener('popstate', this._onPopState);\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/index.vue?./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!./node_modules/_babel-loader@8.4.1@babel-loader/lib!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
979
979
|
|
|
980
980
|
/***/ }),
|
|
981
981
|
|
|
@@ -1047,7 +1047,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
1047
1047
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1048
1048
|
|
|
1049
1049
|
"use strict";
|
|
1050
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.staticRenderFns = exports.render = void 0;\nvar render = exports.render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"chat-sidebar\",\n class: {\n open: _vm.showSidebar || _vm.isMobile && _vm.showH5List\n }\n }, [!_vm.isIntelShow ? _c(\"div\", {\n staticClass: \"sidebar-header\"\n }, [_vm.isMobile ? _c(\"button\", {\n staticClass: \"sidebar-back-btn\",\n on: {\n click: function ($event) {\n return _vm.$emit(\"sidebar-back\");\n }\n }\n }, [_c(\"svg\", {\n attrs: {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 24 24\",\n fill: \"none\"\n }\n }, [_c(\"path\", {\n attrs: {\n d: \"M15 18l-6-6 6-6\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }\n })])]) : _vm._e(), _c(\"span\", {\n staticClass: \"sidebar-title\"\n }, [_vm._v(_vm._s(_vm.isMobile ? \"AI\" : \"AI助理(内测版)\"))]), _c(\"img\", {\n attrs: {\n src: __webpack_require__(/*! @/assets/aiagent/AImessage.png */ \"./src/assets/aiagent/AImessage.png\"),\n alt: \"\"\n },\n on: {\n click: function ($event) {\n return _vm.$emit(\"agent-jump-click\");\n }\n }\n })]) : _vm._e(), _c(\"div\", {\n staticClass: \"sidebar-search\"\n }, [_c(\"div\", {\n staticClass: \"search-wrap\"\n }, [_c(\"svg\", {\n staticClass: \"search-icon\",\n attrs: {\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 24 24\",\n fill: \"none\"\n }\n }, [_c(\"circle\", {\n attrs: {\n cx: \"11\",\n cy: \"11\",\n r: \"7\",\n stroke: \"#999\",\n \"stroke-width\": \"2\"\n }\n }), _c(\"path\", {\n attrs: {\n d: \"M21 21l-4.35-4.35\",\n stroke: \"#999\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n }\n })]), _c(\"input\", {\n directives: [{\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.searchKeyword,\n expression: \"searchKeyword\"\n }],\n staticClass: \"search-input\",\n attrs: {\n type: \"text\",\n placeholder: \"搜索助手...\"\n },\n domProps: {\n value: _vm.searchKeyword\n },\n on: {\n input: function ($event) {\n if ($event.target.composing) return;\n _vm.searchKeyword = $event.target.value;\n }\n }\n }), _vm.searchKeyword ? _c(\"svg\", {\n staticClass: \"search-clear\",\n attrs: {\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 24 24\",\n fill: \"none\"\n },\n on: {\n click: _vm.onSearchClear,\n touchend: function ($event) {\n $event.preventDefault();\n return _vm.onSearchClear.apply(null, arguments);\n }\n }\n }, [_c(\"circle\", {\n attrs: {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n fill: \"#ccc\"\n }\n }), _c(\"path\", {\n attrs: {\n d: \"M9 9l6 6M15 9l-6 6\",\n stroke: \"#fff\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n }\n })]) : _vm._e()]), _vm.showAgentSuggestions && _vm.agentSuggestions.length > 0 && _vm.searchKeyword ? _c(\"div\", {\n staticClass: \"search-suggestions\"\n }, _vm._l(_vm.agentSuggestions, function (a) {\n return _c(\"div\", {\n key: a.agentCode,\n staticClass: \"suggestion-item\",\n on: {\n click: function ($event) {\n return _vm.selectSuggestion(a);\n }\n }\n }, [_c(\"div\", {\n staticClass: \"agent-list-avatar suggestion-avatar\",\n class: {\n \"has-agent-img\": a.avatar\n },\n style: {\n width: \"20px\",\n height: \"20px\",\n background: a.color || \"linear-gradient(135deg, #1677ff, #4096ff)\"\n }\n }, [a.avatar ? _c(\"img\", {\n staticClass: \"avatar-pic\",\n attrs: {\n src: a.avatar,\n alt: \"\"\n }\n }) : [_vm._v(_vm._s(_vm.getInitial(a.agentName || a.agentCode)))]], 2), _c(\"span\", {\n staticClass: \"suggestion-name\"\n }, [_vm._v(_vm._s(a.agentName || a.agentCode))]), _c(\"span\", {\n staticClass: \"suggestion-desc\"\n }, [_vm._v(_vm._s(a.description ? a.description.substring(0, 30) : \"\"))])]);\n }), 0) : _vm._e()]), _vm.localFilteredSessions.length > 0 ? _c(\"div\", {\n staticClass: \"sidebar-list\"\n }, _vm._l(_vm.localFilteredSessions, function (s) {\n return _c(\"div\", {\n key: s.sessionId,\n staticClass: \"session-item\",\n class: {\n active: s.sessionId === _vm.activeSessionId\n },\n on: {\n click: function ($event) {\n return _vm.onSessionClick(s);\n },\n touchstart: function ($event) {\n return _vm.onSessionTouchStart(s, $event);\n },\n touchend: function ($event) {\n return _vm.onSessionTouchEnd($event, s);\n },\n touchmove: _vm.onSessionTouchMove,\n contextmenu: function ($event) {\n $event.preventDefault();\n }\n }\n }, [_c(\"div\", {\n staticClass: \"agent-list-avatar session-avatar session-left-item\",\n class: {\n \"has-agent-img\": s.avatar\n },\n style: {\n background: s.color || \"linear-gradient(135deg, #1677ff, #4096ff)\"\n }\n }, [s.avatar ? _c(\"img\", {\n staticClass: \"avatar-pic\",\n attrs: {\n src: s.avatar,\n alt: \"\"\n }\n }) : [_vm._v(_vm._s(_vm.getInitial(s.agentName || s.agentCode)))]], 2), _c(\"div\", {\n staticClass: \"session-info\"\n }, [_c(\"div\", {\n staticClass: \"session-agent\"\n }, [_vm._v(_vm._s(s.agentName || s.agentCode))]), _c(\"div\", {\n staticClass: \"session-preview\"\n }, [_vm._v(_vm._s(s.greeting || s.lastContent || \"空会话\"))])]), _c(\"button\", {\n staticClass: \"session-delete\",\n on: {\n click: function ($event) {\n $event.stopPropagation();\n return _vm.$emit(\"delete-session\", s);\n }\n }\n }, [_c(\"svg\", {\n attrs: {\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 24 24\",\n fill: \"none\"\n }\n }, [_c(\"path\", {\n attrs: {\n d: \"M6 7h12M9 7V5a1 1 0 011-1h4a1 1 0 011 1v2M10 11v6M14 11v6M7 7l1 13a1 1 0 001 1h6a1 1 0 001-1l1-13\",\n stroke: \"currentColor\",\n \"stroke-width\": \"1.5\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }\n })])])]);\n }), 0) : _vm.loading ? _c(\"div\", {\n staticClass: \"sidebar-loading\"\n }, [_c(\"div\", {\n staticClass: \"loading-spinner\"\n }), _c(\"div\", [_vm._v(\"加载中...\")])]) : _c(\"div\", {\n staticClass: \"sidebar-empty\"\n }, [_c(\"div\", {\n staticClass: \"empty-icon\"\n }, [_vm._v(\"💬\")]), _c(\"div\", [_vm._v(_vm._s(_vm.searchKeyword ? \"没有匹配的会话\" : \"暂无会话\"))]), _c(\"div\", {\n staticClass: \"empty-hint\"\n }, [_vm._v(_vm._s(_vm.searchKeyword ? \"试试其他关键词\" : \"选择助手开始对话\"))])])]);\n};\nvar staticRenderFns = exports.staticRenderFns = [];\nrender._withStripped = true;\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/ChatSidebar.vue?./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%224b66220e-vue-loader-template%22%7D!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!./node_modules/_babel-loader@8.4.1@babel-loader/lib!./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
1050
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.staticRenderFns = exports.render = void 0;\nvar render = exports.render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"chat-sidebar\",\n class: {\n open: _vm.showSidebar || _vm.isMobile && _vm.showH5List\n }\n }, [!_vm.isIntelShow ? _c(\"div\", {\n staticClass: \"sidebar-header\"\n }, [_vm.isMobile ? _c(\"button\", {\n staticClass: \"sidebar-back-btn\",\n on: {\n click: function ($event) {\n return _vm.$emit(\"sidebar-back\");\n }\n }\n }, [_c(\"svg\", {\n attrs: {\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 24 24\",\n fill: \"none\"\n }\n }, [_c(\"path\", {\n attrs: {\n d: \"M15 18l-6-6 6-6\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }\n })])]) : _vm._e(), _c(\"span\", {\n staticClass: \"sidebar-title\"\n }, [_vm._v(_vm._s(_vm.isMobile ? \"AI\" : \"AI助理(内测版)\"))]), _c(\"img\", {\n attrs: {\n src: __webpack_require__(/*! @/assets/aiagent/AImessage.png */ \"./src/assets/aiagent/AImessage.png\"),\n alt: \"\"\n },\n on: {\n click: function ($event) {\n return _vm.$emit(\"agent-jump-click\");\n }\n }\n })]) : _vm._e(), _c(\"div\", {\n staticClass: \"sidebar-search\"\n }, [_c(\"div\", {\n staticClass: \"search-wrap\"\n }, [_c(\"svg\", {\n staticClass: \"search-icon\",\n attrs: {\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 24 24\",\n fill: \"none\"\n }\n }, [_c(\"circle\", {\n attrs: {\n cx: \"11\",\n cy: \"11\",\n r: \"7\",\n stroke: \"#999\",\n \"stroke-width\": \"2\"\n }\n }), _c(\"path\", {\n attrs: {\n d: \"M21 21l-4.35-4.35\",\n stroke: \"#999\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n }\n })]), _c(\"input\", {\n directives: [{\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.searchKeyword,\n expression: \"searchKeyword\"\n }],\n staticClass: \"search-input\",\n attrs: {\n type: \"text\",\n placeholder: \"搜索助手...\"\n },\n domProps: {\n value: _vm.searchKeyword\n },\n on: {\n input: function ($event) {\n if ($event.target.composing) return;\n _vm.searchKeyword = $event.target.value;\n }\n }\n }), _vm.searchKeyword ? _c(\"svg\", {\n staticClass: \"search-clear\",\n attrs: {\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 24 24\",\n fill: \"none\"\n },\n on: {\n click: _vm.onSearchClear,\n touchend: function ($event) {\n $event.preventDefault();\n return _vm.onSearchClear.apply(null, arguments);\n }\n }\n }, [_c(\"circle\", {\n attrs: {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n fill: \"#ccc\"\n }\n }), _c(\"path\", {\n attrs: {\n d: \"M9 9l6 6M15 9l-6 6\",\n stroke: \"#fff\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n }\n })]) : _vm._e()]), _vm.showAgentSuggestions && _vm.agentSuggestions.length > 0 && _vm.searchKeyword ? _c(\"div\", {\n staticClass: \"search-suggestions\"\n }, _vm._l(_vm.agentSuggestions, function (a) {\n return _c(\"div\", {\n key: a.agentCode,\n staticClass: \"suggestion-item\",\n on: {\n click: function ($event) {\n return _vm.selectSuggestion(a);\n }\n }\n }, [_c(\"div\", {\n staticClass: \"agent-list-avatar suggestion-avatar\",\n class: {\n \"has-agent-img\": a.avatar\n },\n style: {\n width: \"20px\",\n height: \"20px\",\n background: a.color || \"linear-gradient(135deg, #1677ff, #4096ff)\"\n }\n }, [a.avatar ? _c(\"img\", {\n staticClass: \"avatar-pic\",\n attrs: {\n src: a.avatar,\n alt: \"\"\n }\n }) : [_vm._v(_vm._s(_vm.getInitial(a.agentName || a.agentCode)))]], 2), _c(\"span\", {\n staticClass: \"suggestion-name\"\n }, [_vm._v(_vm._s(a.agentName || a.agentCode))]), _c(\"span\", {\n staticClass: \"suggestion-desc\"\n }, [_vm._v(_vm._s(a.description ? a.description.substring(0, 30) : \"\"))])]);\n }), 0) : _vm._e()]), _vm.localFilteredSessions.length > 0 ? _c(\"div\", {\n staticClass: \"sidebar-list\"\n }, _vm._l(_vm.localFilteredSessions, function (s) {\n return _c(\"div\", {\n key: s.sessionId,\n staticClass: \"session-item\",\n class: {\n active: s.sessionId === _vm.activeSessionId\n },\n on: {\n click: function ($event) {\n return _vm.onSessionClick(s);\n },\n \"&touchstart\": function ($event) {\n return _vm.onSessionTouchStart(s, $event);\n },\n touchend: function ($event) {\n return _vm.onSessionTouchEnd($event, s);\n },\n touchmove: _vm.onSessionTouchMove,\n contextmenu: function ($event) {\n $event.preventDefault();\n }\n }\n }, [_c(\"div\", {\n staticClass: \"agent-list-avatar session-avatar session-left-item\",\n class: {\n \"has-agent-img\": s.avatar\n },\n style: {\n background: s.color || \"linear-gradient(135deg, #1677ff, #4096ff)\"\n }\n }, [s.avatar ? _c(\"img\", {\n staticClass: \"avatar-pic\",\n attrs: {\n src: s.avatar,\n alt: \"\"\n }\n }) : [_vm._v(_vm._s(_vm.getInitial(s.agentName || s.agentCode)))]], 2), _c(\"div\", {\n staticClass: \"session-info\"\n }, [_c(\"div\", {\n staticClass: \"session-agent\"\n }, [_vm._v(_vm._s(s.agentName || s.agentCode))]), _c(\"div\", {\n staticClass: \"session-preview\"\n }, [_vm._v(_vm._s(s.greeting || s.lastContent || \"空会话\"))])]), _c(\"button\", {\n staticClass: \"session-delete\",\n on: {\n click: function ($event) {\n $event.stopPropagation();\n return _vm.$emit(\"delete-session\", s);\n }\n }\n }, [_c(\"svg\", {\n attrs: {\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 24 24\",\n fill: \"none\"\n }\n }, [_c(\"path\", {\n attrs: {\n d: \"M6 7h12M9 7V5a1 1 0 011-1h4a1 1 0 011 1v2M10 11v6M14 11v6M7 7l1 13a1 1 0 001 1h6a1 1 0 001-1l1-13\",\n stroke: \"currentColor\",\n \"stroke-width\": \"1.5\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }\n })])])]);\n }), 0) : _vm.loading ? _c(\"div\", {\n staticClass: \"sidebar-loading\"\n }, [_c(\"div\", {\n staticClass: \"loading-spinner\"\n }), _c(\"div\", [_vm._v(\"加载中...\")])]) : _c(\"div\", {\n staticClass: \"sidebar-empty\"\n }, [_c(\"div\", {\n staticClass: \"empty-icon\"\n }, [_vm._v(\"💬\")]), _c(\"div\", [_vm._v(_vm._s(_vm.searchKeyword ? \"没有匹配的会话\" : \"暂无会话\"))]), _c(\"div\", {\n staticClass: \"empty-hint\"\n }, [_vm._v(_vm._s(_vm.searchKeyword ? \"试试其他关键词\" : \"选择助手开始对话\"))])])]);\n};\nvar staticRenderFns = exports.staticRenderFns = [];\nrender._withStripped = true;\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/ChatSidebar.vue?./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%224b66220e-vue-loader-template%22%7D!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!./node_modules/_babel-loader@8.4.1@babel-loader/lib!./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
1051
1051
|
|
|
1052
1052
|
/***/ }),
|
|
1053
1053
|
|
|
@@ -3335,7 +3335,7 @@ eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../.
|
|
|
3335
3335
|
/*! no static exports found */
|
|
3336
3336
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3337
3337
|
|
|
3338
|
-
eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../node_modules/_css-loader@3.6.0@css-loader/dist/runtime/api.js */ \"./node_modules/_css-loader@3.6.0@css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"\\n.chat-main[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n min-width: 0;\\r\\n min-height: 0;\\n}\\r\\n\\r\\n/* ── Header ── */\\n.chat-header[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: space-between;\\r\\n padding: 10px 20px;\\r\\n background: #fff;\\r\\n border-bottom: 1px solid #e8e8e8;\\r\\n flex-shrink: 0;\\r\\n z-index: 10;\\n}\\n.header-left[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 10px;\\r\\n min-width: 0;\\r\\n flex: 1;\\n}\\n.header-actions[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n flex-shrink: 0;\\n}\\n.agent-info[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 10px;\\n}\\n.agent-icon[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n border-radius: 8px;\\r\\n background: linear-gradient(135deg, #1677ff, #4096ff);\\r\\n color: #fff;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n font-size: 16px;\\r\\n font-weight: 600;\\r\\n flex-shrink: 0;\\n}\\n.agent-info:nth-child(4n + 2) .agent-icon-avatar[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #52c41a, #73d13d);\\n}\\n.agent-info:nth-child(4n + 3) .agent-icon-avatar[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #fa8c16, #ffa940);\\n}\\n.agent-info:nth-child(4n + 4) .agent-icon-avatar[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #722ed1, #b37feb);\\n}\\n.agent-text[data-v-9693c11e] {\\r\\n min-width: 0;\\n}\\n.agent-name[data-v-9693c11e] {\\r\\n font-size: 15px;\\r\\n font-weight: 600;\\r\\n color: #333;\\r\\n line-height: 1.3;\\n}\\n.agent-desc[data-v-9693c11e] {\\r\\n font-size: 12px;\\r\\n color: #999;\\r\\n overflow: hidden;\\r\\n text-overflow: ellipsis;\\r\\n white-space: nowrap;\\r\\n max-width: min(300px, 45vw);\\n}\\n.header-right[data-v-9693c11e] {\\r\\n flex-shrink: 0;\\n}\\n.manage-link[data-v-9693c11e] {\\r\\n font-size: 13px;\\r\\n color: #1677ff;\\r\\n text-decoration: none;\\n}\\n.manage-link[data-v-9693c11e]:hover {\\r\\n color: #4096ff;\\n}\\r\\n\\r\\n/* ── Chat Body ── */\\n.chat-body[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n overflow-y: auto;\\r\\n padding: 16px clamp(12px, 3vw, 40px);\\r\\n scroll-behavior: auto;\\r\\n position: relative;\\r\\n -webkit-overflow-scrolling: touch;\\r\\n background: url(https://qiguanbang.obs.cn-east-3.myhuaweicloud.com/production/image/AlAgent/agentbackground.png) 100% no-repeat;\\r\\n background-size: 100% 100%;\\r\\n background-position: center;\\r\\n background-size: cover;\\r\\n min-height: 0;\\n}\\n.welcome[data-v-9693c11e] {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n height: 100%;\\r\\n color: #bbb;\\r\\n margin: 0 -20px;\\n}\\n.welcome-icon[data-v-9693c11e] {\\r\\n margin-bottom: 12px;\\r\\n opacity: 0.7;\\n}\\n.welcome-text[data-v-9693c11e] {\\r\\n font-size: 15px;\\n}\\n.welcome-default .welcome-icon[data-v-9693c11e] {\\r\\n margin-bottom: 16px;\\n}\\n.welcome-title[data-v-9693c11e] {\\r\\n font-size: 20px;\\r\\n font-weight: 600;\\r\\n color: #333;\\r\\n margin-bottom: 8px;\\n}\\r\\n\\r\\n/* ── Message Row ── */\\n.msg-row[data-v-9693c11e] {\\r\\n width: 100%;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n padding: 20px 16px;\\r\\n box-sizing: border-box;\\r\\n align-items: center;\\n}\\n.msg-main[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: flex-start;\\r\\n gap: 10px;\\r\\n max-width: 85%;\\r\\n width: min(100%, 860px) !important;\\r\\n max-width: 860px;\\n}\\n.msg-row.user .msg-main[data-v-9693c11e] {\\r\\n flex-direction: row-reverse;\\n}\\n.msg-row.assistant[data-v-9693c11e] {\\r\\n justify-content: center;\\n}\\n.load-more[data-v-9693c11e] {\\r\\n text-align: center;\\r\\n font-size: 12px;\\r\\n color: #999;\\r\\n padding: 4px 0;\\n}\\n.msg-time[data-v-9693c11e] {\\r\\n font-size: 11px;\\r\\n color: #bbb;\\r\\n margin-top: 2px;\\r\\n padding-left: 4px;\\n}\\n.msg-row.user .msg-time[data-v-9693c11e] {\\r\\n text-align: right;\\r\\n padding-right: 4px;\\n}\\n.msg-actions[data-v-9693c11e] {\\r\\n display: flex;\\r\\n gap: 4px;\\r\\n margin-top: 4px;\\r\\n padding-left: 4px;\\n}\\n.action-btn[data-v-9693c11e] {\\r\\n font-size: 12px;\\r\\n color: #999;\\r\\n cursor: pointer;\\r\\n padding: 2px 6px 2px 0;\\r\\n border-radius: 4px;\\r\\n transition: all 0.2s;\\r\\n -webkit-user-select: none;\\r\\n -moz-user-select: none;\\r\\n user-select: none;\\n}\\n.action-btn[data-v-9693c11e]:hover {\\r\\n color: #1677ff;\\r\\n background: #f0f5ff;\\n}\\r\\n\\r\\n/* ── STT 语音转文字状态 ── */\\n.stt-status-block[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 8px;\\r\\n font-size: 14px;\\r\\n line-height: 1.5;\\n}\\n.stt-bubble-wrap[data-v-9693c11e] {\\r\\n position: relative;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n font-size: 15px;\\r\\n line-height: 1.4;\\n}\\n.stt-outside-icon[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n right: 100%;\\r\\n top: 50%;\\r\\n margin-top: -9px;\\r\\n margin-right: 20px;\\n}\\n.stt-spinner[data-v-9693c11e] {\\r\\n display: inline-block;\\r\\n width: 18px;\\r\\n height: 18px;\\r\\n border: 2.5px solid #d9d9d9;\\r\\n border-top-color: #1677ff;\\r\\n border-right-color: #4096ff;\\r\\n border-radius: 50%;\\r\\n animation: stt-spin-9693c11e 0.6s linear infinite;\\r\\n flex-shrink: 0;\\r\\n box-sizing: border-box;\\n}\\n@keyframes stt-spin-9693c11e {\\nto { transform: rotate(360deg);\\n}\\n}\\n.stt-error-icon[data-v-9693c11e] {\\r\\n display: inline-flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n width: 18px;\\r\\n height: 18px;\\r\\n background: #ff4d4f;\\r\\n color: #fff;\\r\\n font-size: 12px;\\r\\n font-weight: 700;\\r\\n border-radius: 50%;\\r\\n line-height: 1;\\r\\n flex-shrink: 0;\\n}\\n.stt-bubble-text[data-v-9693c11e] {\\r\\n font-size: 15px;\\r\\n line-height: 1.4;\\r\\n color: #fff;\\r\\n white-space: nowrap;\\r\\n margin: 6px 0;\\n}\\n.msg-avatar[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n border-radius: 50%;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n font-size: 13px;\\r\\n font-weight: 700;\\r\\n flex-shrink: 0;\\r\\n color: #fff;\\n}\\n.msg-avatar.user[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #1677ff, #4096ff);\\r\\n color: #fff;\\n}\\n.msg-avatar.assistant[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #52c41a, #73d13d);\\r\\n color: #fff;\\n}\\n.msg-agent-label[data-v-9693c11e] {\\r\\n font-size: 12px;\\r\\n color: #999;\\r\\n margin-bottom: 2px;\\n}\\n.msg-content[data-v-9693c11e] {\\r\\n width: 100% !important;\\r\\n max-width: 100%;\\r\\n box-sizing: border-box;\\r\\n overflow: hidden;\\n}\\r\\n\\r\\n/* ── Bubble ── */\\n.bubble[data-v-9693c11e] {\\r\\n max-width: 100%;\\r\\n min-width: 30px;\\r\\n width: -moz-fit-content;\\r\\n width: fit-content;\\r\\n padding: 8px 14px;\\r\\n border-radius: 12px;\\r\\n line-height: 1.4;\\r\\n font-size: 15px;\\r\\n word-break: break-word;\\r\\n white-space: normal;\\r\\n text-align: left;\\r\\n overflow-wrap: anywhere;\\n}\\n.bubble[data-v-9693c11e]:has(.typing) {\\r\\n padding: 16px 20px;\\n}\\n.bubble.user[data-v-9693c11e] {\\r\\n background: #1677ff;\\r\\n color: #fff;\\r\\n border-bottom-right-radius: 4px;\\r\\n box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);\\r\\n float: none;\\r\\n margin-left: auto;\\r\\n max-width: min(100%, 520px);\\n}\\n.bubble.assistant[data-v-9693c11e] {\\r\\n background: #fff;\\r\\n color: #333;\\r\\n border-bottom-left-radius: 4px;\\r\\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);\\r\\n text-align: left;\\r\\n width: 100%;\\r\\n box-sizing: border-box;\\n}\\n.bubble[data-v-9693c11e] table {\\r\\n border-collapse: collapse;\\r\\n width: 100%;\\r\\n margin: 6px 0;\\r\\n font-size: 14px;\\n}\\n.bubble[data-v-9693c11e] th,\\r\\n.bubble[data-v-9693c11e] td {\\r\\n border: 1px solid #e8e8e8;\\r\\n padding: 5px 8px;\\r\\n text-align: left;\\n}\\n.bubble[data-v-9693c11e] th {\\r\\n background: #fafafa;\\r\\n font-weight: 600;\\n}\\n.bubble[data-v-9693c11e] code {\\r\\n padding: 1px 5px;\\r\\n border-radius: 3px;\\r\\n font-size: 14px;\\n}\\n.bubble[data-v-9693c11e] pre {\\r\\n background: #f6f8fa;\\r\\n color: #333;\\r\\n padding: 12px;\\r\\n border-radius: 6px;\\r\\n overflow-x: auto;\\r\\n font-size: 13px;\\r\\n border: 1px solid #e8e8e8;\\r\\n margin: 8px 0;\\r\\n line-height: 1.5;\\r\\n white-space: pre;\\n}\\n.bubble[data-v-9693c11e] ul,\\r\\n.bubble[data-v-9693c11e] ol {\\r\\n padding-left: 20px;\\r\\n margin: 4px 0;\\n}\\n.bubble[data-v-9693c11e] li {\\r\\n margin: 2px 0;\\n}\\n.bubble[data-v-9693c11e] p {\\r\\n margin: 6px 0;\\n}\\r\\n\\r\\n/* ── Thinking ── */\\n.thinking-details[data-v-9693c11e] {\\r\\n margin-bottom: 10px;\\r\\n border: 1px solid #e8e8e8;\\r\\n border-radius: 8px;\\r\\n overflow: hidden;\\r\\n background: #fafafa;\\n}\\n.thinking-summary[data-v-9693c11e] {\\r\\n font-size: 12px;\\r\\n color: #888;\\r\\n cursor: pointer;\\r\\n padding: 6px 10px;\\r\\n -webkit-user-select: none;\\r\\n -moz-user-select: none;\\r\\n user-select: none;\\n}\\n.thinking-summary[data-v-9693c11e]:hover {\\r\\n color: #1677ff;\\n}\\n.thinking-body[data-v-9693c11e] {\\r\\n font-size: 14px;\\r\\n color: #666;\\r\\n padding: 8px 12px;\\r\\n line-height: 1.6;\\r\\n border-top: 1px solid #f0f0f0;\\r\\n text-align: left;\\r\\n white-space: pre-wrap;\\r\\n word-break: break-word;\\r\\n overflow-wrap: break-word;\\r\\n overflow-wrap: anywhere;\\n}\\n.final-content[data-v-9693c11e] {\\r\\n word-break: break-word;\\r\\n overflow-wrap: break-word;\\r\\n overflow-wrap: anywhere;\\n}\\n.thinking-body[data-v-9693c11e] p {\\r\\n margin: 4px 0;\\n}\\r\\n\\r\\n/* ── Typing ── */\\n.typing[data-v-9693c11e] {\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: center;\\r\\n gap: 8px;\\r\\n min-height: 24px;\\r\\n justify-content: flex-start;\\r\\n padding: 4px 0;\\n}\\n.typing .phrase[data-v-9693c11e] {\\r\\n font-size: 14px;\\r\\n color: #888;\\r\\n white-space: nowrap;\\r\\n animation: phraseFade-9693c11e 0.5s ease;\\r\\n letter-spacing: 0.5px;\\n}\\n.typing .dots[data-v-9693c11e] {\\r\\n display: flex;\\r\\n gap: 5px;\\r\\n align-items: center;\\r\\n justify-content: center;\\n}\\n.typing .dots span[data-v-9693c11e] {\\r\\n width: 8px;\\r\\n height: 8px;\\r\\n background: #bbb;\\r\\n border-radius: 50%;\\r\\n animation: dtTyping-9693c11e 1.3s infinite ease-in-out;\\n}\\n.typing .dots span[data-v-9693c11e]:nth-child(2) {\\r\\n animation-delay: 0.16s;\\n}\\n.typing .dots span[data-v-9693c11e]:nth-child(3) {\\r\\n animation-delay: 0.32s;\\n}\\n@keyframes phraseFade-9693c11e {\\nfrom {\\r\\n opacity: 0.2;\\r\\n transform: translateY(4px);\\n}\\nto {\\r\\n opacity: 1;\\r\\n transform: translateY(0);\\n}\\n}\\n@keyframes dtTyping-9693c11e {\\n0%,\\r\\n 60%,\\r\\n 100% {\\r\\n transform: translateY(0);\\r\\n opacity: 0.3;\\n}\\n30% {\\r\\n transform: translateY(-5px);\\r\\n opacity: 1;\\n}\\n}\\r\\n\\r\\n/* ── Wait Timer ── */\\n.typing.wait-5 .dots span[data-v-9693c11e] {\\r\\n width: 8px;\\r\\n height: 8px;\\r\\n animation-duration: 1s;\\n}\\n.typing.wait-5 .phrase[data-v-9693c11e] {\\r\\n color: #888;\\n}\\n.typing.wait-10 .dots span[data-v-9693c11e] {\\r\\n width: 9px;\\r\\n height: 9px;\\r\\n animation-duration: 0.8s;\\r\\n background: #909399;\\n}\\n.typing.wait-10 .phrase[data-v-9693c11e] {\\r\\n color: #909399;\\n}\\n.typing.wait-10 .dots[data-v-9693c11e] {\\r\\n animation: dtPulse-9693c11e 1s infinite ease-in-out;\\n}\\n.typing.wait-15 .dots span[data-v-9693c11e] {\\r\\n width: 10px;\\r\\n height: 10px;\\r\\n animation-duration: 0.6s;\\r\\n background: #1677ff;\\n}\\n.typing.wait-15 .phrase[data-v-9693c11e] {\\r\\n color: #1677ff;\\n}\\n.typing.wait-15 .dots[data-v-9693c11e] {\\r\\n animation: dtPulse-9693c11e 0.6s infinite ease-in-out;\\n}\\n@keyframes dtPulse-9693c11e {\\n0%,\\r\\n 100% {\\r\\n transform: scale(1);\\n}\\n50% {\\r\\n transform: scale(1.05);\\n}\\n}\\r\\n\\r\\n/* ── Tool Calls ── */\\n.tool-calls[data-v-9693c11e] {\\r\\n margin-top: 8px;\\n}\\n.tool-item[data-v-9693c11e] {\\r\\n background: #f5f5f5;\\r\\n border-radius: 6px;\\r\\n padding: 6px 10px;\\r\\n margin-bottom: 4px;\\r\\n font-size: 12px;\\n}\\n.tool-badge[data-v-9693c11e] {\\r\\n display: inline-block;\\r\\n margin-bottom: 2px;\\r\\n font-size: 11px;\\r\\n color: #fa8c16;\\r\\n font-weight: 500;\\n}\\n.tool-item pre[data-v-9693c11e] {\\r\\n margin: 0;\\r\\n white-space: pre-wrap;\\r\\n word-break: break-all;\\r\\n font-size: 12px;\\r\\n color: #666;\\r\\n max-height: 120px;\\r\\n overflow-y: auto;\\n}\\r\\n\\r\\n/* ── Scroll Buttons ── */\\n.scroll-btns[data-v-9693c11e] {\\r\\n position: sticky;\\r\\n left: 50%;\\r\\n transform: translateX(-50%);\\r\\n bottom: 20px;\\r\\n z-index: 99;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n margin-top: 10px;\\r\\n pointer-events: none;\\n}\\n.scroll-btn[data-v-9693c11e] {\\r\\n pointer-events: auto;\\r\\n width: 38px;\\r\\n height: 38px;\\r\\n border-radius: 50%;\\r\\n background: #fff;\\r\\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n cursor: pointer;\\n}\\n.scroll-btn i[data-v-9693c11e] {\\r\\n font-size: 16px;\\r\\n color: #333;\\n}\\r\\n\\r\\n/* ── Footer ── */\\n.chat-footer[data-v-9693c11e] {\\r\\n flex-shrink: 0;\\r\\n border-top: none;\\r\\n padding: 30px 0;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n margin: 0 auto;\\r\\n width: 100%;\\n}\\n.input-area[data-v-9693c11e] {\\r\\n position: relative;\\r\\n display: flex;\\r\\n align-items: flex-end;\\r\\n gap: 6px;\\r\\n background: #fff;\\r\\n border-radius: 24px;\\r\\n margin: 0 24px;\\r\\n padding: 18px 20px;\\r\\n border: 1px solid #b3d8ff;\\r\\n transition: border-color 0.2s;\\r\\n flex-wrap: wrap;\\r\\n width: min(100%, 1000px) !important;\\r\\n box-sizing: border-box;\\n}\\n.input-area[data-v-9693c11e]:focus-within {\\r\\n border-color: #1677ff;\\r\\n background: #fff;\\r\\n box-shadow: none;\\n}\\n.input-area[data-v-9693c11e]::after {\\r\\n content: \\\"Enter 发送,Ctrl+Enter 换行\\\";\\r\\n position: absolute;\\r\\n right: 100px;\\r\\n bottom: 28px;\\r\\n font-size: 14px;\\r\\n color: #8c8c8c;\\r\\n pointer-events: none;\\n}\\n.scroll-bottom-wrap[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n left: 50%;\\r\\n transform: translateX(-50%);\\r\\n bottom: calc(100% + 30px);\\r\\n z-index: 99;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n pointer-events: none;\\n}\\n.scroll-bottom-btn[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n border-radius: 50%;\\r\\n background: #fff;\\r\\n border: 1px solid #e5e7eb;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n cursor: pointer;\\r\\n pointer-events: auto;\\r\\n position: relative;\\r\\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);\\n}\\n.scroll-bottom-btn svg[data-v-9693c11e] {\\r\\n color: #4e5969;\\n}\\n.scroll-bottom-btn[data-v-9693c11e]:hover {\\r\\n transform: scale(1.1);\\n}\\n.loading-circle[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n inset: 3px;\\r\\n border-radius: 50%;\\r\\n border: 1.5px solid transparent;\\r\\n border-top: 1.5px solid #1677ff;\\r\\n animation: circle-spin-9693c11e 1.5s linear infinite;\\n}\\n@keyframes circle-spin-9693c11e {\\nfrom {\\r\\n transform: rotate(0deg);\\n}\\nto {\\r\\n transform: rotate(360deg);\\n}\\n}\\n.chat-textarea[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n border: none;\\r\\n outline: none;\\r\\n background: transparent;\\r\\n resize: none;\\r\\n font-size: 16px;\\r\\n line-height: 24px;\\r\\n min-height: 38px;\\r\\n height: 100px;\\r\\n max-height: 100px;\\r\\n overflow-y: auto;\\r\\n padding: 0;\\r\\n box-sizing: border-box;\\r\\n font-family: inherit;\\r\\n color: #333;\\r\\n flex: 1 1 320px;\\r\\n min-width: 0;\\n}\\n.chat-textarea[data-v-9693c11e]::-moz-placeholder {\\r\\n color: #999;\\r\\n font-size: 16px;\\n}\\n.chat-textarea[data-v-9693c11e]::placeholder {\\r\\n color: #999;\\r\\n font-size: 16px;\\n}\\n.send-btn[data-v-9693c11e] {\\r\\n width: auto;\\r\\n height: 40px;\\r\\n padding: 0 21px;\\r\\n border-radius: 6px;\\r\\n border: none;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\r\\n transition: all 0.2s;\\r\\n background: #1677ff;\\r\\n color: #fff;\\r\\n font-size: 14px;\\n}\\n.send-btn svg[data-v-9693c11e] {\\r\\n display: none;\\n}\\n.send-btn[data-v-9693c11e]::after {\\r\\n content: \\\"发送\\\";\\n}\\n.send-btn.active[data-v-9693c11e] {\\r\\n background: #1677ff;\\n}\\n.send-btn.active[data-v-9693c11e]:hover {\\r\\n background: #4096ff;\\n}\\n.send-btn[data-v-9693c11e]:disabled {\\r\\n background: #88bfff;\\r\\n cursor: not-allowed;\\n}\\n.stop-btn[data-v-9693c11e] {\\r\\n width: 35px;\\r\\n height: 35px;\\r\\n border-radius: 50%;\\r\\n border: none;\\r\\n cursor: pointer;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n background: #ff4d4f;\\r\\n color: #fff;\\r\\n flex-shrink: 0;\\r\\n transition: all 0.2s;\\n}\\n.stop-btn[data-v-9693c11e]:hover {\\r\\n background: #ff7875;\\n}\\r\\n\\r\\n/* ── Voice ── */\\n.voice-btn[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n min-width: 36px;\\r\\n border: none;\\r\\n background: transparent;\\r\\n border-radius: 50%;\\r\\n color: #333;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\r\\n transition: background 0.2s;\\r\\n padding: 0;\\n}\\n.voice-btn[data-v-9693c11e]:active {\\r\\n background: rgba(0,0,0,0.05);\\n}\\n.voice-btn[data-v-9693c11e]:disabled {\\r\\n opacity: 0.4;\\r\\n cursor: not-allowed;\\n}\\n.hold-talk-btn[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n gap: 6px;\\r\\n height: 36px;\\r\\n min-height: 36px;\\r\\n margin: 0 4px;\\r\\n border-radius: 18px;\\r\\n background: #EBEBEB;\\r\\n border: none;\\r\\n font-size: 14px;\\r\\n color: #666;\\r\\n cursor: pointer;\\r\\n -moz-user-select: none;\\r\\n user-select: none;\\r\\n -webkit-user-select: none;\\r\\n transition: background 0.15s;\\n}\\n.hold-talk-btn[data-v-9693c11e]:active {\\r\\n background: #ddd;\\n}\\n.hold-talk-btn.recording[data-v-9693c11e] {\\r\\n background: #e8f0fe;\\r\\n color: #333;\\n}\\n.hold-talk-btn .hold-talk-icon[data-v-9693c11e] {\\r\\n flex-shrink: 0;\\n}\\r\\n\\r\\n/* ── Voice Recording Overlay ── */\\n.voice-recording-overlay[data-v-9693c11e] {\\r\\n position: fixed;\\r\\n left: 0;\\r\\n right: 0;\\r\\n top: 0;\\r\\n bottom: 0;\\r\\n z-index: 1000;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n background: rgba(0,0,0,0.35);\\r\\n animation: fadeIn-9693c11e 0.15s ease;\\n}\\n.voice-recording-card[data-v-9693c11e] {\\r\\n width: 200px;\\r\\n padding: 32px 24px 24px;\\r\\n background: #fff;\\r\\n border-radius: 20px;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: center;\\r\\n gap: 16px;\\r\\n box-shadow: 0 8px 32px rgba(0,0,0,0.15);\\n}\\n.voice-recording-wave[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n height: 40px;\\n}\\n.voice-recording-wave span[data-v-9693c11e] {\\r\\n width: 4px;\\r\\n background: #1677ff;\\r\\n border-radius: 2px;\\r\\n animation: waveAnim-9693c11e 0.6s ease-in-out infinite alternate;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(1) { height: 16px; animation-delay: 0s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(2) { height: 28px; animation-delay: 0.1s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(3) { height: 40px; animation-delay: 0.2s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(4) { height: 28px; animation-delay: 0.3s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(5) { height: 16px; animation-delay: 0.4s;\\n}\\n@keyframes waveAnim-9693c11e {\\n0% { transform: scaleY(0.6);\\n}\\n100% { transform: scaleY(1);\\n}\\n}\\n.voice-recording-duration[data-v-9693c11e] {\\r\\n font-size: 32px;\\r\\n font-weight: 600;\\r\\n color: #333;\\r\\n line-height: 1;\\n}\\n.voice-recording-duration .unit[data-v-9693c11e] {\\r\\n font-size: 18px;\\r\\n font-weight: 400;\\r\\n color: #999;\\r\\n margin-left: 2px;\\n}\\n.voice-recording-hint[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n font-size: 13px;\\r\\n color: #999;\\n}\\n.voice-recording-hint.cancel[data-v-9693c11e] {\\r\\n color: #ff4d4f;\\n}\\n@keyframes fadeIn-9693c11e {\\nfrom { opacity: 0;\\n}\\nto { opacity: 1;\\n}\\n}\\r\\n\\r\\n/* ── Chat Agent Avatar ── */\\n.chat-agent-avatar-wrapper div[data-v-9693c11e] {\\r\\n width: 44px;\\r\\n height: 44px;\\n}\\r\\n\\r\\n/* ── Agent List Avatar ── */\\n.agent-list-avatar[data-v-9693c11e] {\\r\\n background-repeat: no-repeat;\\r\\n background-position: center;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n color: #fff;\\r\\n font-size: 22px;\\r\\n font-weight: 600;\\r\\n border-radius: 8px;\\n}\\n.agent-list-avatar.has-agent-img[data-v-9693c11e] {\\r\\n width: 97px;\\r\\n height: 126px;\\r\\n background-size: cover;\\n}\\n.agent-list-avatar[data-v-9693c11e]:not(.has-agent-img) {\\r\\n width: 76px;\\r\\n height: 108px;\\r\\n transform: translateX(9px);\\n}\\n.session-avatar[data-v-9693c11e] {\\r\\n width: 44px !important;\\r\\n height: 44px !important;\\r\\n border-radius: 50% !important;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n font-size: 16px !important;\\r\\n font-weight: 600;\\r\\n color: #fff;\\r\\n flex-shrink: 0;\\r\\n overflow: hidden;\\n}\\n.avatar-pic[data-v-9693c11e] {\\r\\n width: 85%;\\r\\n height: 85%;\\r\\n -o-object-fit: contain;\\r\\n object-fit: contain;\\n}\\r\\n\\r\\n/* ── Mobile Buttons ── */\\n.mobile-menu-btn[data-v-9693c11e],\\r\\n.mobile-back-btn[data-v-9693c11e],\\r\\n.mobile-header-btn[data-v-9693c11e] {\\r\\n display: inline-flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n border: none;\\r\\n border-radius: 10px;\\r\\n background: #f5f7fa;\\r\\n color: #333;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\n}\\n.mobile-menu-btn i[data-v-9693c11e],\\r\\n.mobile-back-btn i[data-v-9693c11e],\\r\\n.mobile-header-btn i[data-v-9693c11e] {\\r\\n font-size: 18px;\\n}\\n.mobile-back-btn i[data-v-9693c11e] {\\r\\n font-size: 20px;\\r\\n font-weight: 600;\\n}\\r\\n/* ── 聊天空白欢迎页(匹配蓝湖移动端聊天首页) ── */\\n.chat-empty-welcome[data-v-9693c11e] {\\r\\n width: 100%;\\r\\n padding: 40px 20px;\\r\\n box-sizing: border-box;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n gap: 0px;\\r\\n max-width: 600px;\\r\\n margin: 80px auto;\\n}\\r\\n\\r\\n/* 顶部渐变欢迎卡片 */\\n.welcome-card[data-v-9693c11e] {\\r\\n position: relative;\\r\\n background: linear-gradient(296deg, #D6EDFF 20%, #E8EBFF 80%);\\r\\nborder-radius: 16px 16px 0px 0px;\\r\\n padding: 24px 24px 24px 150px;\\r\\n overflow: visible;\\n}\\r\\n/* 左侧探出头像容器 */\\n.welcome-avatar-box[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n left: 15px;\\r\\n bottom: 0px;\\r\\n width: 110px;\\r\\n height: 137px;\\n}\\n.welcome-avatar[data-v-9693c11e] {\\r\\n width: 100%;\\r\\n height: 100%;\\r\\n border-radius: 12px;\\r\\n background-size: cover;\\r\\n background-position: center;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n font-size: 20px;\\r\\n color: #fff;\\r\\n font-weight: 600;\\n}\\n.welcome-avatar.has-chat-agent-img[data-v-9693c11e] {\\r\\n background: transparent;\\r\\n background-repeat: no-repeat;\\r\\n background-position: center;\\n}\\n.welcome-text-group[data-v-9693c11e] {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n gap: 6px;\\n}\\n.welcome-text-group .text-sm[data-v-9693c11e] {\\r\\nfont-weight: 400;font-size: 12px;color: #666666;\\r\\ntext-align: left;\\r\\nfont-style: normal;\\n}\\n.welcome-text-group .text-lg[data-v-9693c11e] {\\r\\n \\r\\n font-weight: 500;\\r\\nfont-size: 16px;\\r\\ncolor: #000000;\\n}\\r\\n\\r\\n/* 猜你想问容器 */\\n.guess-box[data-v-9693c11e] {\\r\\n border-top: 1px solid #fff;\\r\\n background: linear-gradient(180deg, #B8DCFF 0%, #DFF0FF 50%, #FFFFFF 100%);\\r\\n border-radius: 0 0 16px 16px;\\r\\n padding: 20px;\\n}\\n.guess-title[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n font-size: 16px;\\r\\n font-weight: 500;\\r\\n color: #222;\\r\\n margin-bottom: 16px;\\n}\\n.tag-wrap[data-v-9693c11e] {\\r\\n display: flex;\\r\\n flex-wrap: wrap;\\r\\n gap: 10px;\\n}\\n.quick-tag[data-v-9693c11e] {\\r\\n padding: 8px 14px;\\r\\n background: #F2FAFF;\\r\\n border-radius: 8px;\\r\\n font-size: 14px;\\r\\n color: #333;\\r\\n cursor: pointer;\\r\\n border: 1px solid #e0eaff;\\r\\n transition: all 0.2s;\\r\\n white-space: nowrap;\\n}\\r\\n/* .quick-tag:hover {\\r\\n background: #f0f7ff;\\r\\n border-color: #1677ff;\\r\\n} */\\n.chat-agent-avatar-wrapper div[data-v-9693c11e]{\\r\\n width: 44px;\\r\\n height: 44px;\\n}\\r\\n/* ── Responsive ── */\\n@media screen and (max-width: 768px) {\\n.chat-header[data-v-9693c11e] {\\r\\n padding: 10px 12px;\\r\\n background: transparent;\\r\\n border-bottom: none;\\n}\\n.chat-header .chat-agent-avatar-wrapper[data-v-9693c11e] {\\r\\n display: none;\\n}\\n.chat-header .agent-desc[data-v-9693c11e] {\\r\\n display: none;\\n}\\n.chat-header .header-left[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n justify-content: center;\\r\\n position: relative;\\n}\\n.chat-header .header-left .mobile-back-btn[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n left: 12px;\\r\\n background: transparent;\\n}\\n.chat-header .header-actions .mobile-header-btn[data-v-9693c11e] {\\r\\n background: transparent;\\n}\\n.chat-body[data-v-9693c11e] {\\r\\n padding: 12px;\\r\\n background-position: center top;\\n}\\n.msg-row[data-v-9693c11e] {\\r\\n padding: 12px 0;\\n}\\n.msg-main[data-v-9693c11e] {\\r\\n width: 100% !important;\\r\\n max-width: 100%;\\n}\\n.bubble[data-v-9693c11e] {\\r\\n font-size: 14px;\\n}\\n.bubble.user[data-v-9693c11e] {\\r\\n max-width: 88%;\\n}\\n.chat-footer[data-v-9693c11e] {\\r\\n padding: 12px 0 max(12px, env(safe-area-inset-bottom, 0px));\\r\\n flex-shrink: 0;\\r\\n background: #f5f5f5;\\n}\\r\\n /* 安全区域由 .chat-footer 统一处理,.chat-body 不需要重复加 padding */\\n.input-area[data-v-9693c11e] {\\r\\n width: calc(100% - 24px) !important;\\r\\n margin: 0 12px;\\r\\n padding: 6px 6px 6px 4px;\\r\\n border-radius: 24px;\\r\\n border: none;\\r\\n background: #f5f5f5;\\r\\n box-shadow: 0 2px 8px rgba(0,0,0,0.06);\\r\\n flex-wrap: nowrap;\\r\\n align-items: center;\\n}\\n.input-area[data-v-9693c11e]:focus-within {\\r\\n border-color: transparent;\\r\\n background: #f5f5f5;\\r\\n box-shadow: 0 2px 8px rgba(0,0,0,0.06);\\n}\\n.input-area[data-v-9693c11e]::after {\\r\\n display: none;\\n}\\n.voice-btn[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n min-width: 36px;\\r\\n border: none;\\r\\n background: transparent;\\r\\n border-radius: 50%;\\r\\n color: #333;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\r\\n transition: background 0.2s;\\r\\n padding: 0;\\n}\\n.voice-btn[data-v-9693c11e]:active {\\r\\n background: rgba(0,0,0,0.05);\\n}\\n.voice-btn[data-v-9693c11e]:disabled {\\r\\n opacity: 0.4;\\r\\n cursor: not-allowed;\\n}\\n.chat-textarea[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n flex-basis: 0;\\r\\n height: 36px;\\r\\n min-height: 36px;\\r\\n max-height: 100px;\\r\\n font-size: 15px;\\r\\n background: #EBEBEB;\\r\\n border-radius: 18px;\\r\\n padding: 0 14px;\\r\\n line-height: 36px;\\r\\n margin: 0 4px;\\r\\n color: #333;\\n}\\n.chat-textarea[data-v-9693c11e]::-moz-placeholder {\\r\\n color: #999;\\r\\n font-size: 15px;\\n}\\n.chat-textarea[data-v-9693c11e]::placeholder {\\r\\n color: #999;\\r\\n font-size: 15px;\\n}\\n.send-btn[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n min-width: 36px;\\r\\n padding: 0;\\r\\n border-radius: 50%;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n background: #1677ff;\\r\\n color: #fff;\\r\\n border: none;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\n}\\n.send-btn svg[data-v-9693c11e] {\\r\\n display: block;\\n}\\n.send-btn[data-v-9693c11e]::after {\\r\\n content: none;\\n}\\n.send-btn.active[data-v-9693c11e] {\\r\\n background: #1677ff;\\n}\\n.send-btn[data-v-9693c11e]:disabled {\\r\\n background: #88bfff;\\r\\n cursor: not-allowed;\\n}\\n.send-btn[data-v-9693c11e]:active {\\r\\n transform: scale(0.92);\\n}\\n.stop-btn[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n min-width: 36px;\\n}\\n.guess-box[data-v-9693c11e] {\\r\\n padding: 16px;\\n}\\r\\n\\r\\n /* H5 语音模式 */\\n.hold-talk-btn[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n gap: 6px;\\r\\n height: 36px;\\r\\n min-height: 36px;\\r\\n margin: 0 4px;\\r\\n border-radius: 18px;\\r\\n background: #EBEBEB;\\r\\n border: none;\\r\\n font-size: 14px;\\r\\n color: #666;\\r\\n cursor: pointer;\\r\\n -moz-user-select: none;\\r\\n user-select: none;\\r\\n -webkit-user-select: none;\\r\\n transition: background 0.15s;\\n}\\n.hold-talk-btn[data-v-9693c11e]:active {\\r\\n background: #ddd;\\n}\\n.hold-talk-btn.recording[data-v-9693c11e] {\\r\\n background: #e8f0fe;\\r\\n color: #333;\\n}\\n.hold-talk-btn .hold-talk-icon[data-v-9693c11e] {\\r\\n flex-shrink: 0;\\n}\\r\\n\\r\\n /* 语音录制浮层 */\\n.voice-recording-overlay[data-v-9693c11e] {\\r\\n position: fixed;\\r\\n left: 0;\\r\\n right: 0;\\r\\n top: 0;\\r\\n bottom: 0;\\r\\n z-index: 1000;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n background: rgba(0,0,0,0.35);\\r\\n animation: fadeIn-9693c11e 0.15s ease;\\n}\\n.voice-recording-card[data-v-9693c11e] {\\r\\n width: 200px;\\r\\n padding: 32px 24px 24px;\\r\\n background: #fff;\\r\\n border-radius: 20px;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: center;\\r\\n gap: 16px;\\r\\n box-shadow: 0 8px 32px rgba(0,0,0,0.15);\\n}\\n.voice-recording-wave[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n height: 40px;\\n}\\n.voice-recording-wave span[data-v-9693c11e] {\\r\\n width: 4px;\\r\\n background: #1677ff;\\r\\n border-radius: 2px;\\r\\n animation: waveAnim-9693c11e 0.6s ease-in-out infinite alternate;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(1) { height: 16px; animation-delay: 0s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(2) { height: 28px; animation-delay: 0.1s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(3) { height: 40px; animation-delay: 0.2s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(4) { height: 28px; animation-delay: 0.3s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(5) { height: 16px; animation-delay: 0.4s;\\n}\\n@keyframes waveAnim-9693c11e {\\n0% { transform: scaleY(0.6);\\n}\\n100% { transform: scaleY(1);\\n}\\n}\\n.voice-recording-duration[data-v-9693c11e] {\\r\\n font-size: 32px;\\r\\n font-weight: 600;\\r\\n color: #333;\\r\\n line-height: 1;\\n}\\n.voice-recording-duration .unit[data-v-9693c11e] {\\r\\n font-size: 18px;\\r\\n font-weight: 400;\\r\\n color: #999;\\r\\n margin-left: 2px;\\n}\\n.voice-recording-hint[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n font-size: 13px;\\r\\n color: #999;\\n}\\n.voice-recording-hint.cancel[data-v-9693c11e] {\\r\\n color: #ff4d4f;\\n}\\n@keyframes fadeIn-9693c11e {\\nfrom { opacity: 0;\\n}\\nto { opacity: 1;\\n}\\n}\\n}\\n@media screen and (max-width: 480px) {\\n.agent-name[data-v-9693c11e] {\\r\\n font-size: 14px;\\n}\\n.agent-desc[data-v-9693c11e] {\\r\\n max-width: calc(100vw - 132px);\\n}\\n.mobile-menu-btn[data-v-9693c11e],\\r\\n .mobile-header-btn[data-v-9693c11e] {\\r\\n width: 32px;\\r\\n height: 32px;\\n}\\n}\\r\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/ChatDetail.vue?./node_modules/_css-loader@3.6.0@css-loader/dist/cjs.js??ref--7-oneOf-1-1!./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/stylePostLoader.js!./node_modules/_postcss-loader@3.0.0@postcss-loader/src??ref--7-oneOf-1-2!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
3338
|
+
eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../node_modules/_css-loader@3.6.0@css-loader/dist/runtime/api.js */ \"./node_modules/_css-loader@3.6.0@css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"\\n.chat-main[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n min-width: 0;\\r\\n min-height: 0;\\n}\\r\\n\\r\\n/* ── Header ── */\\n.chat-header[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: space-between;\\r\\n padding: 10px 20px;\\r\\n background: #fff;\\r\\n border-bottom: 1px solid #e8e8e8;\\r\\n flex-shrink: 0;\\r\\n z-index: 10;\\n}\\n.header-left[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 10px;\\r\\n min-width: 0;\\r\\n flex: 1;\\n}\\n.header-actions[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n flex-shrink: 0;\\n}\\n.agent-info[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 10px;\\n}\\n.agent-icon[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n border-radius: 8px;\\r\\n background: linear-gradient(135deg, #1677ff, #4096ff);\\r\\n color: #fff;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n font-size: 16px;\\r\\n font-weight: 600;\\r\\n flex-shrink: 0;\\n}\\n.agent-info:nth-child(4n + 2) .agent-icon-avatar[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #52c41a, #73d13d);\\n}\\n.agent-info:nth-child(4n + 3) .agent-icon-avatar[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #fa8c16, #ffa940);\\n}\\n.agent-info:nth-child(4n + 4) .agent-icon-avatar[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #722ed1, #b37feb);\\n}\\n.agent-text[data-v-9693c11e] {\\r\\n min-width: 0;\\n}\\n.agent-name[data-v-9693c11e] {\\r\\n font-size: 15px;\\r\\n font-weight: 600;\\r\\n color: #333;\\r\\n line-height: 1.3;\\n}\\n.agent-desc[data-v-9693c11e] {\\r\\n font-size: 12px;\\r\\n color: #999;\\r\\n overflow: hidden;\\r\\n text-overflow: ellipsis;\\r\\n white-space: nowrap;\\r\\n max-width: min(300px, 45vw);\\n}\\n.header-right[data-v-9693c11e] {\\r\\n flex-shrink: 0;\\n}\\n.manage-link[data-v-9693c11e] {\\r\\n font-size: 13px;\\r\\n color: #1677ff;\\r\\n text-decoration: none;\\n}\\n.manage-link[data-v-9693c11e]:hover {\\r\\n color: #4096ff;\\n}\\r\\n\\r\\n/* ── Chat Body ── */\\n.chat-body[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n overflow-y: auto;\\r\\n padding: 16px clamp(12px, 3vw, 40px);\\r\\n scroll-behavior: auto;\\r\\n position: relative;\\r\\n -webkit-overflow-scrolling: touch;\\r\\n background: url(https://qiguanbang.obs.cn-east-3.myhuaweicloud.com/production/image/AlAgent/agentbackground.png) 100% no-repeat;\\r\\n background-size: 100% 100%;\\r\\n background-position: center;\\r\\n background-size: cover;\\r\\n min-height: 0;\\n}\\n.welcome[data-v-9693c11e] {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n height: 100%;\\r\\n color: #bbb;\\r\\n margin: 0 -20px;\\n}\\n.welcome-icon[data-v-9693c11e] {\\r\\n margin-bottom: 12px;\\r\\n opacity: 0.7;\\n}\\n.welcome-text[data-v-9693c11e] {\\r\\n font-size: 15px;\\n}\\n.welcome-default .welcome-icon[data-v-9693c11e] {\\r\\n margin-bottom: 16px;\\n}\\n.welcome-title[data-v-9693c11e] {\\r\\n font-size: 20px;\\r\\n font-weight: 600;\\r\\n color: #333;\\r\\n margin-bottom: 8px;\\n}\\r\\n\\r\\n/* ── Message Row ── */\\n.msg-row[data-v-9693c11e] {\\r\\n width: 100%;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n padding: 20px 16px;\\r\\n box-sizing: border-box;\\r\\n align-items: center;\\n}\\n.msg-main[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: flex-start;\\r\\n gap: 10px;\\r\\n max-width: 85%;\\r\\n width: min(100%, 860px) !important;\\r\\n max-width: 860px;\\n}\\n.msg-row.user .msg-main[data-v-9693c11e] {\\r\\n flex-direction: row-reverse;\\n}\\n.msg-row.assistant[data-v-9693c11e] {\\r\\n justify-content: center;\\n}\\n.load-more[data-v-9693c11e] {\\r\\n text-align: center;\\r\\n font-size: 12px;\\r\\n color: #999;\\r\\n padding: 4px 0;\\n}\\n.msg-time[data-v-9693c11e] {\\r\\n font-size: 11px;\\r\\n color: #bbb;\\r\\n margin-top: 2px;\\r\\n padding-left: 4px;\\n}\\n.msg-row.user .msg-time[data-v-9693c11e] {\\r\\n text-align: right;\\r\\n padding-right: 4px;\\n}\\n.msg-actions[data-v-9693c11e] {\\r\\n display: flex;\\r\\n gap: 4px;\\r\\n margin-top: 4px;\\r\\n padding-left: 4px;\\n}\\n.action-btn[data-v-9693c11e] {\\r\\n font-size: 12px;\\r\\n color: #999;\\r\\n cursor: pointer;\\r\\n padding: 2px 6px 2px 0;\\r\\n border-radius: 4px;\\r\\n transition: all 0.2s;\\r\\n -webkit-user-select: none;\\r\\n -moz-user-select: none;\\r\\n user-select: none;\\n}\\n.action-btn[data-v-9693c11e]:hover {\\r\\n color: #1677ff;\\r\\n background: #f0f5ff;\\n}\\r\\n\\r\\n/* ── STT 语音转文字状态 ── */\\n.stt-status-block[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 8px;\\r\\n font-size: 14px;\\r\\n line-height: 1.5;\\n}\\n.stt-bubble-wrap[data-v-9693c11e] {\\r\\n position: relative;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n font-size: 15px;\\r\\n line-height: 1.4;\\n}\\n.stt-outside-icon[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n right: 100%;\\r\\n top: 50%;\\r\\n margin-top: -9px;\\r\\n margin-right: 20px;\\n}\\n.stt-spinner[data-v-9693c11e] {\\r\\n display: inline-block;\\r\\n width: 18px;\\r\\n height: 18px;\\r\\n border: 2.5px solid #d9d9d9;\\r\\n border-top-color: #1677ff;\\r\\n border-right-color: #4096ff;\\r\\n border-radius: 50%;\\r\\n animation: stt-spin-9693c11e 0.6s linear infinite;\\r\\n flex-shrink: 0;\\r\\n box-sizing: border-box;\\n}\\n@keyframes stt-spin-9693c11e {\\nto { transform: rotate(360deg);\\n}\\n}\\n.stt-error-icon[data-v-9693c11e] {\\r\\n display: inline-flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n width: 18px;\\r\\n height: 18px;\\r\\n background: #ff4d4f;\\r\\n color: #fff;\\r\\n font-size: 12px;\\r\\n font-weight: 700;\\r\\n border-radius: 50%;\\r\\n line-height: 1;\\r\\n flex-shrink: 0;\\n}\\n.stt-bubble-text[data-v-9693c11e] {\\r\\n font-size: 15px;\\r\\n line-height: 1.4;\\r\\n color: #fff;\\r\\n white-space: nowrap;\\r\\n margin: 6px 0;\\n}\\n.msg-avatar[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n border-radius: 50%;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n font-size: 13px;\\r\\n font-weight: 700;\\r\\n flex-shrink: 0;\\r\\n color: #fff;\\n}\\n.msg-avatar.user[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #1677ff, #4096ff);\\r\\n color: #fff;\\n}\\n.msg-avatar.assistant[data-v-9693c11e] {\\r\\n background: linear-gradient(135deg, #52c41a, #73d13d);\\r\\n color: #fff;\\n}\\n.msg-agent-label[data-v-9693c11e] {\\r\\n font-size: 12px;\\r\\n color: #999;\\r\\n margin-bottom: 2px;\\n}\\n.msg-content[data-v-9693c11e] {\\r\\n width: 100% !important;\\r\\n max-width: 100%;\\r\\n box-sizing: border-box;\\r\\n overflow: hidden;\\n}\\r\\n\\r\\n/* ── Bubble ── */\\n.bubble[data-v-9693c11e] {\\r\\n max-width: 100%;\\r\\n min-width: 30px;\\r\\n width: -moz-fit-content;\\r\\n width: fit-content;\\r\\n padding: 8px 14px;\\r\\n border-radius: 12px;\\r\\n line-height: 1.4;\\r\\n font-size: 15px;\\r\\n word-break: break-word;\\r\\n white-space: normal;\\r\\n text-align: left;\\r\\n overflow-wrap: anywhere;\\n}\\n.bubble[data-v-9693c11e]:has(.typing) {\\r\\n padding: 16px 20px;\\n}\\n.bubble.user[data-v-9693c11e] {\\r\\n background: #1677ff;\\r\\n color: #fff;\\r\\n border-bottom-right-radius: 4px;\\r\\n box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);\\r\\n float: none;\\r\\n margin-left: auto;\\r\\n max-width: min(100%, 520px);\\n}\\n.bubble.assistant[data-v-9693c11e] {\\r\\n background: #fff;\\r\\n color: #333;\\r\\n border-bottom-left-radius: 4px;\\r\\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);\\r\\n text-align: left;\\r\\n width: 100%;\\r\\n box-sizing: border-box;\\n}\\n.bubble[data-v-9693c11e] table {\\r\\n border-collapse: collapse;\\r\\n width: 100%;\\r\\n margin: 6px 0;\\r\\n font-size: 14px;\\n}\\n.bubble[data-v-9693c11e] th,\\r\\n.bubble[data-v-9693c11e] td {\\r\\n border: 1px solid #e8e8e8;\\r\\n padding: 5px 8px;\\r\\n text-align: left;\\n}\\n.bubble[data-v-9693c11e] th {\\r\\n background: #fafafa;\\r\\n font-weight: 600;\\n}\\n.bubble[data-v-9693c11e] code {\\r\\n padding: 1px 5px;\\r\\n border-radius: 3px;\\r\\n font-size: 14px;\\n}\\n.bubble[data-v-9693c11e] pre {\\r\\n background: #f6f8fa;\\r\\n color: #333;\\r\\n padding: 12px;\\r\\n border-radius: 6px;\\r\\n overflow-x: auto;\\r\\n font-size: 13px;\\r\\n border: 1px solid #e8e8e8;\\r\\n margin: 8px 0;\\r\\n line-height: 1.5;\\r\\n white-space: pre;\\n}\\n.bubble[data-v-9693c11e] ul,\\r\\n.bubble[data-v-9693c11e] ol {\\r\\n padding-left: 20px;\\r\\n margin: 4px 0;\\n}\\n.bubble[data-v-9693c11e] li {\\r\\n margin: 2px 0;\\n}\\n.bubble[data-v-9693c11e] p {\\r\\n margin: 6px 0;\\n}\\r\\n\\r\\n/* ── Thinking ── */\\n.thinking-details[data-v-9693c11e] {\\r\\n margin-bottom: 10px;\\r\\n border: 1px solid #e8e8e8;\\r\\n border-radius: 8px;\\r\\n overflow: hidden;\\r\\n background: #fafafa;\\n}\\n.thinking-summary[data-v-9693c11e] {\\r\\n font-size: 12px;\\r\\n color: #888;\\r\\n cursor: pointer;\\r\\n padding: 6px 10px;\\r\\n -webkit-user-select: none;\\r\\n -moz-user-select: none;\\r\\n user-select: none;\\n}\\n.thinking-summary[data-v-9693c11e]:hover {\\r\\n color: #1677ff;\\n}\\n.thinking-body[data-v-9693c11e] {\\r\\n font-size: 14px;\\r\\n color: #666;\\r\\n padding: 8px 12px;\\r\\n line-height: 1.6;\\r\\n border-top: 1px solid #f0f0f0;\\r\\n text-align: left;\\r\\n white-space: pre-wrap;\\r\\n word-break: break-word;\\r\\n overflow-wrap: break-word;\\r\\n overflow-wrap: anywhere;\\n}\\n.final-content[data-v-9693c11e] {\\r\\n word-break: break-word;\\r\\n overflow-wrap: break-word;\\r\\n overflow-wrap: anywhere;\\n}\\n.thinking-body[data-v-9693c11e] p {\\r\\n margin: 4px 0;\\n}\\r\\n\\r\\n/* ── Typing ── */\\n.typing[data-v-9693c11e] {\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: center;\\r\\n gap: 8px;\\r\\n min-height: 24px;\\r\\n justify-content: flex-start;\\r\\n padding: 4px 0;\\n}\\n.typing .phrase[data-v-9693c11e] {\\r\\n font-size: 14px;\\r\\n color: #888;\\r\\n white-space: nowrap;\\r\\n animation: phraseFade-9693c11e 0.5s ease;\\r\\n letter-spacing: 0.5px;\\n}\\n.typing .dots[data-v-9693c11e] {\\r\\n display: flex;\\r\\n gap: 5px;\\r\\n align-items: center;\\r\\n justify-content: center;\\n}\\n.typing .dots span[data-v-9693c11e] {\\r\\n width: 8px;\\r\\n height: 8px;\\r\\n background: #bbb;\\r\\n border-radius: 50%;\\r\\n animation: dtTyping-9693c11e 1.3s infinite ease-in-out;\\n}\\n.typing .dots span[data-v-9693c11e]:nth-child(2) {\\r\\n animation-delay: 0.16s;\\n}\\n.typing .dots span[data-v-9693c11e]:nth-child(3) {\\r\\n animation-delay: 0.32s;\\n}\\n@keyframes phraseFade-9693c11e {\\nfrom {\\r\\n opacity: 0.2;\\r\\n transform: translateY(4px);\\n}\\nto {\\r\\n opacity: 1;\\r\\n transform: translateY(0);\\n}\\n}\\n@keyframes dtTyping-9693c11e {\\n0%,\\r\\n 60%,\\r\\n 100% {\\r\\n transform: translateY(0);\\r\\n opacity: 0.3;\\n}\\n30% {\\r\\n transform: translateY(-5px);\\r\\n opacity: 1;\\n}\\n}\\r\\n\\r\\n/* ── Wait Timer ── */\\n.typing.wait-5 .dots span[data-v-9693c11e] {\\r\\n width: 8px;\\r\\n height: 8px;\\r\\n animation-duration: 1s;\\n}\\n.typing.wait-5 .phrase[data-v-9693c11e] {\\r\\n color: #888;\\n}\\n.typing.wait-10 .dots span[data-v-9693c11e] {\\r\\n width: 9px;\\r\\n height: 9px;\\r\\n animation-duration: 0.8s;\\r\\n background: #909399;\\n}\\n.typing.wait-10 .phrase[data-v-9693c11e] {\\r\\n color: #909399;\\n}\\n.typing.wait-10 .dots[data-v-9693c11e] {\\r\\n animation: dtPulse-9693c11e 1s infinite ease-in-out;\\n}\\n.typing.wait-15 .dots span[data-v-9693c11e] {\\r\\n width: 10px;\\r\\n height: 10px;\\r\\n animation-duration: 0.6s;\\r\\n background: #1677ff;\\n}\\n.typing.wait-15 .phrase[data-v-9693c11e] {\\r\\n color: #1677ff;\\n}\\n.typing.wait-15 .dots[data-v-9693c11e] {\\r\\n animation: dtPulse-9693c11e 0.6s infinite ease-in-out;\\n}\\n@keyframes dtPulse-9693c11e {\\n0%,\\r\\n 100% {\\r\\n transform: scale(1);\\n}\\n50% {\\r\\n transform: scale(1.05);\\n}\\n}\\r\\n\\r\\n/* ── Tool Calls ── */\\n.tool-calls[data-v-9693c11e] {\\r\\n margin-top: 8px;\\n}\\n.tool-item[data-v-9693c11e] {\\r\\n background: #f5f5f5;\\r\\n border-radius: 6px;\\r\\n padding: 6px 10px;\\r\\n margin-bottom: 4px;\\r\\n font-size: 12px;\\n}\\n.tool-badge[data-v-9693c11e] {\\r\\n display: inline-block;\\r\\n margin-bottom: 2px;\\r\\n font-size: 11px;\\r\\n color: #fa8c16;\\r\\n font-weight: 500;\\n}\\n.tool-item pre[data-v-9693c11e] {\\r\\n margin: 0;\\r\\n white-space: pre-wrap;\\r\\n word-break: break-all;\\r\\n font-size: 12px;\\r\\n color: #666;\\r\\n max-height: 120px;\\r\\n overflow-y: auto;\\n}\\r\\n\\r\\n/* ── Scroll Buttons ── */\\n.scroll-btns[data-v-9693c11e] {\\r\\n position: sticky;\\r\\n left: 50%;\\r\\n transform: translateX(-50%);\\r\\n bottom: 20px;\\r\\n z-index: 99;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n margin-top: 10px;\\r\\n pointer-events: none;\\n}\\n.scroll-btn[data-v-9693c11e] {\\r\\n pointer-events: auto;\\r\\n width: 38px;\\r\\n height: 38px;\\r\\n border-radius: 50%;\\r\\n background: #fff;\\r\\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n cursor: pointer;\\n}\\n.scroll-btn i[data-v-9693c11e] {\\r\\n font-size: 16px;\\r\\n color: #333;\\n}\\r\\n\\r\\n/* ── Footer ── */\\n.chat-footer[data-v-9693c11e] {\\r\\n flex-shrink: 0;\\r\\n border-top: none;\\r\\n padding: 30px 0;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n margin: 0 auto;\\r\\n width: 100%;\\n}\\n.input-area[data-v-9693c11e] {\\r\\n position: relative;\\r\\n display: flex;\\r\\n align-items: flex-end;\\r\\n gap: 6px;\\r\\n background: #fff;\\r\\n border-radius: 24px;\\r\\n margin: 0 24px;\\r\\n padding: 18px 20px;\\r\\n border: 1px solid #b3d8ff;\\r\\n transition: border-color 0.2s;\\r\\n flex-wrap: wrap;\\r\\n width: min(100%, 1000px) !important;\\r\\n box-sizing: border-box;\\n}\\n.input-area[data-v-9693c11e]:focus-within {\\r\\n border-color: #1677ff;\\r\\n background: #fff;\\r\\n box-shadow: none;\\n}\\n.input-area[data-v-9693c11e]::after {\\r\\n content: \\\"Enter 发送,Ctrl+Enter 换行\\\";\\r\\n position: absolute;\\r\\n right: 100px;\\r\\n bottom: 28px;\\r\\n font-size: 14px;\\r\\n color: #8c8c8c;\\r\\n pointer-events: none;\\n}\\n.scroll-bottom-wrap[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n left: 50%;\\r\\n transform: translateX(-50%);\\r\\n bottom: calc(100% + 30px);\\r\\n z-index: 99;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n pointer-events: none;\\n}\\n.scroll-bottom-btn[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n border-radius: 50%;\\r\\n background: #fff;\\r\\n border: 1px solid #e5e7eb;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n cursor: pointer;\\r\\n pointer-events: auto;\\r\\n position: relative;\\r\\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);\\n}\\n.scroll-bottom-btn svg[data-v-9693c11e] {\\r\\n color: #4e5969;\\n}\\n.scroll-bottom-btn[data-v-9693c11e]:hover {\\r\\n transform: scale(1.1);\\n}\\n.loading-circle[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n inset: 3px;\\r\\n border-radius: 50%;\\r\\n border: 1.5px solid transparent;\\r\\n border-top: 1.5px solid #1677ff;\\r\\n animation: circle-spin-9693c11e 1.5s linear infinite;\\n}\\n@keyframes circle-spin-9693c11e {\\nfrom {\\r\\n transform: rotate(0deg);\\n}\\nto {\\r\\n transform: rotate(360deg);\\n}\\n}\\n.chat-textarea[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n border: none;\\r\\n outline: none;\\r\\n background: transparent;\\r\\n resize: none;\\r\\n font-size: 16px;\\r\\n line-height: 24px;\\r\\n min-height: 38px;\\r\\n height: 100px;\\r\\n max-height: 100px;\\r\\n overflow-y: auto;\\r\\n padding: 0;\\r\\n box-sizing: border-box;\\r\\n font-family: inherit;\\r\\n color: #333;\\r\\n flex: 1 1 320px;\\r\\n min-width: 0;\\n}\\n.chat-textarea[data-v-9693c11e]::-moz-placeholder {\\r\\n color: #999;\\r\\n font-size: 16px;\\n}\\n.chat-textarea[data-v-9693c11e]::placeholder {\\r\\n color: #999;\\r\\n font-size: 16px;\\n}\\n.send-btn[data-v-9693c11e] {\\r\\n width: auto;\\r\\n height: 40px;\\r\\n padding: 0 21px;\\r\\n border-radius: 6px;\\r\\n border: none;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\r\\n transition: all 0.2s;\\r\\n background: #1677ff;\\r\\n color: #fff;\\r\\n font-size: 14px;\\n}\\n.send-btn svg[data-v-9693c11e] {\\r\\n display: none;\\n}\\n.send-btn[data-v-9693c11e]::after {\\r\\n content: \\\"发送\\\";\\n}\\n.send-btn.active[data-v-9693c11e] {\\r\\n background: #1677ff;\\n}\\n.send-btn.active[data-v-9693c11e]:hover {\\r\\n background: #4096ff;\\n}\\n.send-btn[data-v-9693c11e]:disabled {\\r\\n background: #88bfff;\\r\\n cursor: not-allowed;\\n}\\n.stop-btn[data-v-9693c11e] {\\r\\n width: 35px;\\r\\n height: 35px;\\r\\n border-radius: 50%;\\r\\n border: none;\\r\\n cursor: pointer;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n background: #ff4d4f;\\r\\n color: #fff;\\r\\n flex-shrink: 0;\\r\\n transition: all 0.2s;\\n}\\n.stop-btn[data-v-9693c11e]:hover {\\r\\n background: #ff7875;\\n}\\r\\n\\r\\n/* ── Voice ── */\\n.voice-btn[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n min-width: 36px;\\r\\n border: none;\\r\\n background: transparent;\\r\\n border-radius: 50%;\\r\\n color: #333;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\r\\n transition: background 0.2s;\\r\\n padding: 0;\\n}\\n.voice-btn[data-v-9693c11e]:active {\\r\\n background: rgba(0,0,0,0.05);\\n}\\n.voice-btn[data-v-9693c11e]:disabled {\\r\\n opacity: 0.4;\\r\\n cursor: not-allowed;\\n}\\n.hold-talk-btn[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n gap: 6px;\\r\\n height: 36px;\\r\\n min-height: 36px;\\r\\n margin: 0 4px;\\r\\n border-radius: 18px;\\r\\n background: #EBEBEB;\\r\\n border: none;\\r\\n font-size: 14px;\\r\\n color: #666;\\r\\n cursor: pointer;\\r\\n -moz-user-select: none;\\r\\n user-select: none;\\r\\n -webkit-user-select: none;\\r\\n transition: background 0.15s;\\n}\\n.hold-talk-btn[data-v-9693c11e]:active {\\r\\n background: #ddd;\\n}\\n.hold-talk-btn.recording[data-v-9693c11e] {\\r\\n background: #e8f0fe;\\r\\n color: #333;\\n}\\n.hold-talk-btn .hold-talk-icon[data-v-9693c11e] {\\r\\n flex-shrink: 0;\\n}\\r\\n\\r\\n/* ── Voice Recording Overlay ── */\\n.voice-recording-overlay[data-v-9693c11e] {\\r\\n position: fixed;\\r\\n left: 0;\\r\\n right: 0;\\r\\n top: 0;\\r\\n bottom: 0;\\r\\n z-index: 1000;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n background: rgba(0,0,0,0.35);\\r\\n animation: fadeIn-9693c11e 0.15s ease;\\n}\\n.voice-recording-card[data-v-9693c11e] {\\r\\n width: 200px;\\r\\n padding: 32px 24px 24px;\\r\\n background: #fff;\\r\\n border-radius: 20px;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: center;\\r\\n gap: 16px;\\r\\n box-shadow: 0 8px 32px rgba(0,0,0,0.15);\\n}\\n.voice-recording-wave[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n height: 40px;\\n}\\n.voice-recording-wave span[data-v-9693c11e] {\\r\\n width: 4px;\\r\\n background: #1677ff;\\r\\n border-radius: 2px;\\r\\n animation: waveAnim-9693c11e 0.6s ease-in-out infinite alternate;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(1) { height: 16px; animation-delay: 0s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(2) { height: 28px; animation-delay: 0.1s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(3) { height: 40px; animation-delay: 0.2s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(4) { height: 28px; animation-delay: 0.3s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(5) { height: 16px; animation-delay: 0.4s;\\n}\\n@keyframes waveAnim-9693c11e {\\n0% { transform: scaleY(0.6);\\n}\\n100% { transform: scaleY(1);\\n}\\n}\\n.voice-recording-duration[data-v-9693c11e] {\\r\\n font-size: 32px;\\r\\n font-weight: 600;\\r\\n color: #333;\\r\\n line-height: 1;\\n}\\n.voice-recording-duration .unit[data-v-9693c11e] {\\r\\n font-size: 18px;\\r\\n font-weight: 400;\\r\\n color: #999;\\r\\n margin-left: 2px;\\n}\\n.voice-recording-hint[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n font-size: 13px;\\r\\n color: #999;\\n}\\n.voice-recording-hint.cancel[data-v-9693c11e] {\\r\\n color: #ff4d4f;\\n}\\n@keyframes fadeIn-9693c11e {\\nfrom { opacity: 0;\\n}\\nto { opacity: 1;\\n}\\n}\\r\\n\\r\\n/* ── Chat Agent Avatar ── */\\n.chat-agent-avatar-wrapper div[data-v-9693c11e] {\\r\\n width: 44px;\\r\\n height: 44px;\\n}\\r\\n\\r\\n/* ── Agent List Avatar ── */\\n.agent-list-avatar[data-v-9693c11e] {\\r\\n background-repeat: no-repeat;\\r\\n background-position: center;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n color: #fff;\\r\\n font-size: 22px;\\r\\n font-weight: 600;\\r\\n border-radius: 8px;\\n}\\n.agent-list-avatar.has-agent-img[data-v-9693c11e] {\\r\\n width: 97px;\\r\\n height: 126px;\\r\\n background-size: cover;\\n}\\n.agent-list-avatar[data-v-9693c11e]:not(.has-agent-img) {\\r\\n width: 76px;\\r\\n height: 108px;\\r\\n transform: translateX(9px);\\n}\\n.session-avatar[data-v-9693c11e] {\\r\\n width: 44px !important;\\r\\n height: 44px !important;\\r\\n border-radius: 50% !important;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n font-size: 16px !important;\\r\\n font-weight: 600;\\r\\n color: #fff;\\r\\n flex-shrink: 0;\\r\\n overflow: hidden;\\n}\\n.avatar-pic[data-v-9693c11e] {\\r\\n width: 85%;\\r\\n height: 85%;\\r\\n -o-object-fit: contain;\\r\\n object-fit: contain;\\n}\\r\\n\\r\\n/* ── Mobile Buttons ── */\\n.mobile-menu-btn[data-v-9693c11e],\\r\\n.mobile-back-btn[data-v-9693c11e],\\r\\n.mobile-header-btn[data-v-9693c11e] {\\r\\n display: inline-flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n border: none;\\r\\n border-radius: 10px;\\r\\n background: #f5f7fa;\\r\\n color: #333;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\n}\\n.mobile-menu-btn i[data-v-9693c11e],\\r\\n.mobile-back-btn i[data-v-9693c11e],\\r\\n.mobile-header-btn i[data-v-9693c11e] {\\r\\n font-size: 18px;\\n}\\n.mobile-back-btn i[data-v-9693c11e] {\\r\\n font-size: 20px;\\r\\n font-weight: 600;\\n}\\r\\n/* ── 聊天空白欢迎页(匹配蓝湖移动端聊天首页) ── */\\n.chat-empty-welcome[data-v-9693c11e] {\\r\\n width: 100%;\\r\\n padding: 40px 20px;\\r\\n box-sizing: border-box;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n gap: 0px;\\r\\n max-width: 600px;\\r\\n margin: 80px auto;\\n}\\r\\n\\r\\n/* 顶部渐变欢迎卡片 */\\n.welcome-card[data-v-9693c11e] {\\r\\n position: relative;\\r\\n background: linear-gradient(296deg, #D6EDFF 20%, #E8EBFF 80%);\\r\\nborder-radius: 16px 16px 0px 0px;\\r\\n padding: 24px 24px 24px 150px;\\r\\n overflow: visible;\\n}\\r\\n/* 左侧探出头像容器 */\\n.welcome-avatar-box[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n left: 15px;\\r\\n bottom: 0px;\\r\\n width: 110px;\\r\\n height: 137px;\\n}\\n.welcome-avatar[data-v-9693c11e] {\\r\\n width: 100%;\\r\\n height: 100%;\\r\\n border-radius: 12px;\\r\\n background-size: cover;\\r\\n background-position: center;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n font-size: 20px;\\r\\n color: #fff;\\r\\n font-weight: 600;\\n}\\n.welcome-avatar.has-chat-agent-img[data-v-9693c11e] {\\r\\n background: transparent;\\r\\n background-repeat: no-repeat;\\r\\n background-position: center;\\n}\\n.welcome-text-group[data-v-9693c11e] {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n gap: 6px;\\n}\\n.welcome-text-group .text-sm[data-v-9693c11e] {\\r\\nfont-weight: 400;font-size: 12px;color: #666666;\\r\\ntext-align: left;\\r\\nfont-style: normal;\\n}\\n.welcome-text-group .text-lg[data-v-9693c11e] {\\r\\n \\r\\n font-weight: 500;\\r\\nfont-size: 16px;\\r\\ncolor: #000000;\\n}\\r\\n\\r\\n/* 猜你想问容器 */\\n.guess-box[data-v-9693c11e] {\\r\\n border-top: 1px solid #fff;\\r\\n background: linear-gradient(180deg, #B8DCFF 0%, #DFF0FF 50%, #FFFFFF 100%);\\r\\n border-radius: 0 0 16px 16px;\\r\\n padding: 20px;\\n}\\n.guess-title[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n font-size: 16px;\\r\\n font-weight: 500;\\r\\n color: #222;\\r\\n margin-bottom: 16px;\\n}\\n.tag-wrap[data-v-9693c11e] {\\r\\n display: flex;\\r\\n flex-wrap: wrap;\\r\\n gap: 10px;\\n}\\n.quick-tag[data-v-9693c11e] {\\r\\n padding: 8px 14px;\\r\\n background: #F2FAFF;\\r\\n border-radius: 8px;\\r\\n font-size: 14px;\\r\\n color: #333;\\r\\n cursor: pointer;\\r\\n border: 1px solid #e0eaff;\\r\\n transition: all 0.2s;\\r\\n white-space: nowrap;\\n}\\r\\n/* .quick-tag:hover {\\r\\n background: #f0f7ff;\\r\\n border-color: #1677ff;\\r\\n} */\\n.chat-agent-avatar-wrapper div[data-v-9693c11e]{\\r\\n width: 44px;\\r\\n height: 44px;\\n}\\r\\n/* ── Responsive ── */\\n@media screen and (max-width: 768px) {\\n.chat-header[data-v-9693c11e] {\\r\\n padding: 10px 12px;\\r\\n background: transparent;\\r\\n border-bottom: none;\\n}\\n.chat-header .chat-agent-avatar-wrapper[data-v-9693c11e] {\\r\\n display: none;\\n}\\n.chat-header .agent-desc[data-v-9693c11e] {\\r\\n display: none;\\n}\\n.chat-header .header-left[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n justify-content: center;\\r\\n position: relative;\\n}\\n.chat-header .header-left .mobile-back-btn[data-v-9693c11e] {\\r\\n position: absolute;\\r\\n left: 12px;\\r\\n background: transparent;\\n}\\n.chat-header .header-actions .mobile-header-btn[data-v-9693c11e] {\\r\\n background: transparent;\\n}\\n.chat-body[data-v-9693c11e] {\\r\\n padding: 12px;\\r\\n background-position: center top;\\n}\\n.msg-row[data-v-9693c11e] {\\r\\n padding: 12px 0;\\n}\\n.msg-main[data-v-9693c11e] {\\r\\n width: 100% !important;\\r\\n max-width: 100%;\\n}\\n.bubble[data-v-9693c11e] {\\r\\n font-size: 14px;\\n}\\n.bubble.user[data-v-9693c11e] {\\r\\n max-width: 88%;\\n}\\n.chat-footer[data-v-9693c11e] {\\r\\n padding: 12px 0;\\r\\n flex-shrink: 0;\\r\\n background: #f5f5f5;\\n}\\r\\n /* 安全区域由 .chat-footer 统一处理,.chat-body 不需要重复加 padding */\\n.input-area[data-v-9693c11e] {\\r\\n width: calc(100% - 24px) !important;\\r\\n margin: 0 12px;\\r\\n padding: 6px 6px 6px 4px;\\r\\n border-radius: 24px;\\r\\n border: none;\\r\\n background: #f5f5f5;\\r\\n box-shadow: 0 2px 8px rgba(0,0,0,0.06);\\r\\n flex-wrap: nowrap;\\r\\n align-items: center;\\n}\\n.input-area[data-v-9693c11e]:focus-within {\\r\\n border-color: transparent;\\r\\n background: #f5f5f5;\\r\\n box-shadow: 0 2px 8px rgba(0,0,0,0.06);\\n}\\n.input-area[data-v-9693c11e]::after {\\r\\n display: none;\\n}\\n.voice-btn[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n min-width: 36px;\\r\\n border: none;\\r\\n background: transparent;\\r\\n border-radius: 50%;\\r\\n color: #333;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\r\\n transition: background 0.2s;\\r\\n padding: 0;\\n}\\n.voice-btn[data-v-9693c11e]:active {\\r\\n background: rgba(0,0,0,0.05);\\n}\\n.voice-btn[data-v-9693c11e]:disabled {\\r\\n opacity: 0.4;\\r\\n cursor: not-allowed;\\n}\\n.chat-textarea[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n flex-basis: 0;\\r\\n height: 36px;\\r\\n min-height: 36px;\\r\\n max-height: 100px;\\r\\n font-size: 15px;\\r\\n background: #EBEBEB;\\r\\n border-radius: 18px;\\r\\n padding: 0 14px;\\r\\n line-height: 36px;\\r\\n margin: 0 4px;\\r\\n color: #333;\\n}\\n.chat-textarea[data-v-9693c11e]::-moz-placeholder {\\r\\n color: #999;\\r\\n font-size: 15px;\\n}\\n.chat-textarea[data-v-9693c11e]::placeholder {\\r\\n color: #999;\\r\\n font-size: 15px;\\n}\\n.send-btn[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n min-width: 36px;\\r\\n padding: 0;\\r\\n border-radius: 50%;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n background: #1677ff;\\r\\n color: #fff;\\r\\n border: none;\\r\\n cursor: pointer;\\r\\n flex-shrink: 0;\\n}\\n.send-btn svg[data-v-9693c11e] {\\r\\n display: block;\\n}\\n.send-btn[data-v-9693c11e]::after {\\r\\n content: none;\\n}\\n.send-btn.active[data-v-9693c11e] {\\r\\n background: #1677ff;\\n}\\n.send-btn[data-v-9693c11e]:disabled {\\r\\n background: #88bfff;\\r\\n cursor: not-allowed;\\n}\\n.send-btn[data-v-9693c11e]:active {\\r\\n transform: scale(0.92);\\n}\\n.stop-btn[data-v-9693c11e] {\\r\\n width: 36px;\\r\\n height: 36px;\\r\\n min-width: 36px;\\n}\\n.guess-box[data-v-9693c11e] {\\r\\n padding: 16px;\\n}\\r\\n\\r\\n /* H5 语音模式 */\\n.hold-talk-btn[data-v-9693c11e] {\\r\\n flex: 1;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n gap: 6px;\\r\\n height: 36px;\\r\\n min-height: 36px;\\r\\n margin: 0 4px;\\r\\n border-radius: 18px;\\r\\n background: #EBEBEB;\\r\\n border: none;\\r\\n font-size: 14px;\\r\\n color: #666;\\r\\n cursor: pointer;\\r\\n -moz-user-select: none;\\r\\n user-select: none;\\r\\n -webkit-user-select: none;\\r\\n transition: background 0.15s;\\n}\\n.hold-talk-btn[data-v-9693c11e]:active {\\r\\n background: #ddd;\\n}\\n.hold-talk-btn.recording[data-v-9693c11e] {\\r\\n background: #e8f0fe;\\r\\n color: #333;\\n}\\n.hold-talk-btn .hold-talk-icon[data-v-9693c11e] {\\r\\n flex-shrink: 0;\\n}\\r\\n\\r\\n /* 语音录制浮层 */\\n.voice-recording-overlay[data-v-9693c11e] {\\r\\n position: fixed;\\r\\n left: 0;\\r\\n right: 0;\\r\\n top: 0;\\r\\n bottom: 0;\\r\\n z-index: 1000;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: center;\\r\\n background: rgba(0,0,0,0.35);\\r\\n animation: fadeIn-9693c11e 0.15s ease;\\n}\\n.voice-recording-card[data-v-9693c11e] {\\r\\n width: 200px;\\r\\n padding: 32px 24px 24px;\\r\\n background: #fff;\\r\\n border-radius: 20px;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: center;\\r\\n gap: 16px;\\r\\n box-shadow: 0 8px 32px rgba(0,0,0,0.15);\\n}\\n.voice-recording-wave[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n height: 40px;\\n}\\n.voice-recording-wave span[data-v-9693c11e] {\\r\\n width: 4px;\\r\\n background: #1677ff;\\r\\n border-radius: 2px;\\r\\n animation: waveAnim-9693c11e 0.6s ease-in-out infinite alternate;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(1) { height: 16px; animation-delay: 0s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(2) { height: 28px; animation-delay: 0.1s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(3) { height: 40px; animation-delay: 0.2s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(4) { height: 28px; animation-delay: 0.3s;\\n}\\n.voice-recording-wave span[data-v-9693c11e]:nth-child(5) { height: 16px; animation-delay: 0.4s;\\n}\\n@keyframes waveAnim-9693c11e {\\n0% { transform: scaleY(0.6);\\n}\\n100% { transform: scaleY(1);\\n}\\n}\\n.voice-recording-duration[data-v-9693c11e] {\\r\\n font-size: 32px;\\r\\n font-weight: 600;\\r\\n color: #333;\\r\\n line-height: 1;\\n}\\n.voice-recording-duration .unit[data-v-9693c11e] {\\r\\n font-size: 18px;\\r\\n font-weight: 400;\\r\\n color: #999;\\r\\n margin-left: 2px;\\n}\\n.voice-recording-hint[data-v-9693c11e] {\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n font-size: 13px;\\r\\n color: #999;\\n}\\n.voice-recording-hint.cancel[data-v-9693c11e] {\\r\\n color: #ff4d4f;\\n}\\n@keyframes fadeIn-9693c11e {\\nfrom { opacity: 0;\\n}\\nto { opacity: 1;\\n}\\n}\\n}\\n@media screen and (max-width: 480px) {\\n.agent-name[data-v-9693c11e] {\\r\\n font-size: 14px;\\n}\\n.agent-desc[data-v-9693c11e] {\\r\\n max-width: calc(100vw - 132px);\\n}\\n.mobile-menu-btn[data-v-9693c11e],\\r\\n .mobile-header-btn[data-v-9693c11e] {\\r\\n width: 32px;\\r\\n height: 32px;\\n}\\n}\\r\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/components/chatMain/ChatDetail.vue?./node_modules/_css-loader@3.6.0@css-loader/dist/cjs.js??ref--7-oneOf-1-1!./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/stylePostLoader.js!./node_modules/_postcss-loader@3.0.0@postcss-loader/src??ref--7-oneOf-1-2!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--1-0!./node_modules/_vue-loader@15.11.1@vue-loader/lib??vue-loader-options");
|
|
3339
3339
|
|
|
3340
3340
|
/***/ }),
|
|
3341
3341
|
|
|
@@ -12608,7 +12608,7 @@ eval("module.exports = function(originalModule) {\n\tif (!originalModule.webpack
|
|
|
12608
12608
|
/*! exports provided: name, version, main, private, scripts, dependencies, devDependencies, browserslist, directories, keywords, license, default */
|
|
12609
12609
|
/***/ (function(module) {
|
|
12610
12610
|
|
|
12611
|
-
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"zj-plugin-intelligent\\\",\\\"version\\\":\\\"1.2.5-beta.
|
|
12611
|
+
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"zj-plugin-intelligent\\\",\\\"version\\\":\\\"1.2.5-beta.22\\\",\\\"main\\\":\\\"lib/ZjPluginIntelligent.umd.min.js\\\",\\\"private\\\":false,\\\"scripts\\\":{\\\"serve\\\":\\\"vue-cli-service serve\\\",\\\"build\\\":\\\"vue-cli-service build\\\",\\\"lib\\\":\\\"vue-cli-service build --target lib --name ZjPluginIntelligent --dest lib src/lib/index.js\\\",\\\"lib:test\\\":\\\"vue-cli-service build --mode test --target lib --name ZjPluginIntelligent --dest lib src/lib/index.js\\\"},\\\"dependencies\\\":{\\\"html2canvas\\\":\\\"^1.4.1\\\",\\\"markdown-it\\\":\\\"^14.1.0\\\"},\\\"devDependencies\\\":{\\\"@babel/preset-env\\\":\\\"^7.14.9\\\",\\\"@vue/cli-plugin-babel\\\":\\\"~4.5.0\\\",\\\"@vue/cli-plugin-eslint\\\":\\\"^4.5.13\\\",\\\"@vue/cli-plugin-vuex\\\":\\\"~4.5.0\\\",\\\"@vue/cli-service\\\":\\\"~4.5.0\\\",\\\"axios\\\":\\\"^0.27.2\\\",\\\"babel-eslint\\\":\\\"^10.1.0\\\",\\\"babel-plugin-component\\\":\\\"^1.1.1\\\",\\\"compression-webpack-plugin\\\":\\\"^6.0.3\\\",\\\"core-js\\\":\\\"^3.6.5\\\",\\\"element-ui\\\":\\\"^2.15.4\\\",\\\"eslint\\\":\\\"^7.30.0\\\",\\\"eslint-plugin-vue\\\":\\\"^7.13.0\\\",\\\"js-cookie\\\":\\\"^2.2.1\\\",\\\"node-sass\\\":\\\"^4.12.0\\\",\\\"obs-upload\\\":\\\"^1.0.4-alpha.0\\\",\\\"reconnecting-websocket\\\":\\\"^4.4.0\\\",\\\"sass-loader\\\":\\\"^8.0.2\\\",\\\"snowflake-id\\\":\\\"^1.1.0\\\",\\\"vue\\\":\\\"^2.6.11\\\",\\\"vue-template-compiler\\\":\\\"^2.6.11\\\",\\\"vuex\\\":\\\"^3.4.0\\\",\\\"pako\\\":\\\"^2.1.0\\\",\\\"webpack-bundle-analyzer\\\":\\\"^4.4.2\\\"},\\\"browserslist\\\":[\\\"> 1%\\\",\\\"last 2 versions\\\",\\\"not dead\\\"],\\\"directories\\\":{\\\"lib\\\":\\\"lib\\\"},\\\"keywords\\\":[],\\\"license\\\":\\\"ISC\\\"}\");\n\n//# sourceURL=webpack://ZjPluginIntelligent/./package.json?");
|
|
12612
12612
|
|
|
12613
12613
|
/***/ }),
|
|
12614
12614
|
|
|
@@ -13500,7 +13500,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
13500
13500
|
/***/ (function(module, exports, __webpack_require__) {
|
|
13501
13501
|
|
|
13502
13502
|
"use strict";
|
|
13503
|
-
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getAuth = getAuth;\nexports.setAuth = setAuth;\nexports.setBaseURL = setBaseURL;\nexports.setToken = setToken;\nexports.signQueryParams = signQueryParams;\n__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.filter.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.map.js\");\nvar _axios = _interopRequireDefault(__webpack_require__(/*! axios */ \"./node_modules/_axios@0.27.2@axios/index.js\"));\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _message = __webpack_require__(/*! @lib/utils/message.js */ \"./src/lib/utils/message.js\");\n/*\r\n * @Author: 高瑞廷 2419056691@qq.com\r\n * @Date: 2026-06-04 11:27:13\r\n * @LastEditors: 高瑞廷 2419056691@qq.com\r\n * @LastEditTime: 2026-07-15 18:
|
|
13503
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getAuth = getAuth;\nexports.setAuth = setAuth;\nexports.setBaseURL = setBaseURL;\nexports.setToken = setToken;\nexports.signQueryParams = signQueryParams;\n__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.filter.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.45.1@core-js/modules/es.iterator.map.js\");\nvar _axios = _interopRequireDefault(__webpack_require__(/*! axios */ \"./node_modules/_axios@0.27.2@axios/index.js\"));\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _message = __webpack_require__(/*! @lib/utils/message.js */ \"./src/lib/utils/message.js\");\n/*\r\n * @Author: 高瑞廷 2419056691@qq.com\r\n * @Date: 2026-06-04 11:27:13\r\n * @LastEditors: 高瑞廷 2419056691@qq.com\r\n * @LastEditTime: 2026-07-15 18:37:24\r\n * @FilePath: \\zjkj-nodejs-npm_customer-client\\src\\lib\\utils\\request.js\r\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\r\n */\n\nlet runtimeAK = Object({\"NODE_ENV\":\"test\",\"VUE_APP_API\":\"https://api.qgbtech.cn\",\"VUE_APP_BASE_API\":\"https://ai.jybtech.cn\",\"VUE_APP_NAME\":\"development\",\"BASE_URL\":\"/\"}).VUE_APP_BASE_AK || '';\nlet runtimeSK = Object({\"NODE_ENV\":\"test\",\"VUE_APP_API\":\"https://api.qgbtech.cn\",\"VUE_APP_BASE_API\":\"https://ai.jybtech.cn\",\"VUE_APP_NAME\":\"development\",\"BASE_URL\":\"/\"}).VUE_APP_BASE_SK || '';\nlet runtimeToken = '';\nlet _user = '';\nlet _companyNo = '';\nlet runtimeBaseURL = \"https://ai.jybtech.cn\" || false;\nconst CryptoJS = __webpack_require__(/*! crypto-js */ \"./node_modules/_crypto-js@4.2.0@crypto-js/index.js\");\nconst service = _axios.default.create({\n baseURL: runtimeBaseURL,\n timeout: 15000\n});\nfunction hmacSha256Base64(rawSignStr, sk) {\n const hmac = CryptoJS.HmacSHA256(rawSignStr, sk);\n // 转为 Base64\n return CryptoJS.enc.Base64.stringify(hmac);\n}\nfunction setAuth(ak, sk, user, companyNo, token) {\n runtimeAK = ak || '';\n runtimeSK = sk || '';\n _user = user;\n _companyNo = companyNo;\n runtimeToken = token || '';\n}\nfunction setToken(token) {\n runtimeToken = token || '';\n}\nfunction getAuth() {\n return {\n ak: runtimeAK,\n sk: runtimeSK,\n token: runtimeToken,\n user: _user,\n companyNo: _companyNo\n };\n}\nfunction setBaseURL(url) {\n runtimeBaseURL = url || '';\n service.defaults.baseURL = runtimeBaseURL;\n}\nfunction signQueryParams(params, secretKey) {\n const keys = Object.keys(params).filter(k => k !== 'ak' && k !== 'sign').sort();\n const raw = keys.map(k => `${k}=${params[k] || ''}`).join('&');\n return hmacSha256Base64(raw, secretKey);\n}\nservice.interceptors.request.use(config => {\n // 流式接口跳过 Header 签名\n if (config.url.includes('/chat/stream')) {\n return config;\n }\n const ts = Date.now().toString();\n const token = runtimeToken || (0, _cookie.getToken)();\n const externalUser = _user || '';\n const signParts = [];\n // 1. 第一位:token(有值才加入)\n if (_companyNo) {\n signParts.push(`companyNo=${_companyNo}`);\n }\n if (token) {\n signParts.push(`token=${token}`);\n }\n // 2. 第二位:user(有值才加入)\n if (externalUser) {\n signParts.push(`user=${externalUser}`);\n }\n // 3. 第三位:ts(必选,永远存在)\n signParts.push(`ts=${ts}`);\n\n // 拼接最终待签字符串\n const signStr = signParts.join('&');\n // 计算签名\n const sign = hmacSha256Base64(signStr, runtimeSK);\n if (_companyNo) {\n config.headers['X-Company-No'] = _companyNo;\n }\n\n // 设置请求头\n config.headers['X-AK'] = runtimeAK;\n config.headers['X-Ts'] = ts;\n config.headers['X-Sign'] = sign;\n if (token) {\n config.headers['X-Auth-Token'] = `${token}`;\n config.headers.Authorization = `Bearer ${token}`;\n }\n config.headers['X-External-User'] = externalUser;\n config.headers['Content-Type'] = 'application/json';\n\n // console.log('排序后key:', sortedKeys)\n\n return config;\n}, error => Promise.reject(error));\nservice.interceptors.response.use(response => {\n const res = response.data;\n if (res.code === 200) {\n return res;\n } else if (res.code === 40101) {\n (0, _message.showMessage)('登录已过期,请重新登录');\n return Promise.reject(new Error(res.message));\n } else {\n (0, _message.showMessage)(res.message || '请求失败');\n return Promise.reject(new Error(res.message));\n }\n}, error => {\n (0, _message.showMessage)(error.message || '网络异常');\n return Promise.reject(error);\n});\nvar _default = exports.default = service;\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/utils/request.js?");
|
|
13504
13504
|
|
|
13505
13505
|
/***/ }),
|
|
13506
13506
|
|