zj-plugin-intelligent 1.2.6-beta.4 → 1.2.6-beta.6
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.
|
@@ -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.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.map.js\");\n__webpack_require__(/*! core-js/modules/es.json.parse.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.json.parse.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 _message = __webpack_require__(/*! @lib/utils/message.js */ \"./src/lib/utils/message.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.$hybrid && typeof this.$hybrid.closeLoading === 'function') {\n this.$hybrid.closeLoading();\n }\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 } 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 if (this.showAgentSelect) {\n // 智能体选择页 → 返回列表\n this.goBackToList();\n } else if (!this.showH5List) {\n // 详情页/欢迎页 → 返回列表\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 const confirmFn = this.$confirm || _message.showConfirm;\n confirmFn(`确认删除「${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");
|
|
978
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.map.js\");\n__webpack_require__(/*! core-js/modules/es.json.parse.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.json.parse.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 _message = __webpack_require__(/*! @lib/utils/message.js */ \"./src/lib/utils/message.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 } 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 if (this.showAgentSelect) {\n // 智能体选择页 → 返回列表\n this.goBackToList();\n } else if (!this.showH5List) {\n // 详情页/欢迎页 → 返回列表\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 const confirmFn = this.$confirm || _message.showConfirm;\n confirmFn(`确认删除「${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
|
|
|
@@ -987,7 +987,7 @@ eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@
|
|
|
987
987
|
/***/ (function(module, exports, __webpack_require__) {
|
|
988
988
|
|
|
989
989
|
"use strict";
|
|
990
|
-
eval("\n\nvar _interopRequireWildcard = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js\").default;\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _index = _interopRequireDefault(__webpack_require__(/*! @lib/components/chatMain/index.vue */ \"./src/lib/components/chatMain/index.vue\"));\nvar _spiderHack = __webpack_require__(/*! @lib/utils/spiderHack.js */ \"./src/lib/utils/spiderHack.js\");\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _package = _interopRequireDefault(__webpack_require__(/*! ../../../package.json */ \"./package.json\"));\nvar kfStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils.js */ \"./src/lib/store/utils.js\"));\nvar AiStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils */ \"./src/lib/store/utils.js\"));\n// 初始化连接\n// import { openIM, closeIM } from '@lib/socket/socket.js'\n// 工具\n// import { getOperationSys, getBrowser } from '@lib/utils/index.js'\n// import { insertAmap } from '@lib/utils/amap.js'\nvar _default = exports.default = {\n name: 'ZjkjIntelligent',\n components: {\n ChatMain: _index.default\n },\n provide() {\n return {\n superCtrl: this.superControl\n };\n },\n props: {\n imAccount: {\n type: [String, Object],\n // default: '201912241122274' // zl\n // default: '202012221604445' // ly\n // default: '201911121106061' // zlm\n // default: '202004121438164' // hrc\n default: \"\" //wkk\n },\n companyNo: {\n type: String,\n default: ''\n },\n isIntelShow: {\n default: false,\n type: Boolean\n },\n chatImToken: {\n type: [String, Function]\n },\n platformType: {\n type: String\n },\n selectActive: {\n type: String\n },\n Ak: {\n type: String,\n default: ''\n },\n Sk: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n imUser: {},\n // 传入的用户参数\n env: '',\n // 传入的当前环境\n title: 'Ai助理',\n //传入默认标题\n zIndex: 2000,\n userInfo: {\n launchPage: '',\n terminalSource: '',\n ipAddress: ''\n },\n visiable: true,\n // 显示隐藏\n showChat: false,\n // 显示聊天窗口\n addClass: false,\n // 添加class\n isFullScreen: false,\n // 是否全屏\n onClose: null,\n // 关闭回调\n errorType: 0,\n // 错误参数\n superControl: {\n priviewUrl: '',\n // 预览图片url\n privieShow: false,\n // 预览组件显示异常\n showEmoji: false // 显示表情版面\n },\n version: _package.default.version\n };\n },\n computed: {\n valideParams() {\n return {\n env: this.env,\n im: this.imUser\n };\n }\n },\n watch: {\n imAccount: {\n handler: function (val) {\n debugger;\n if (val) {\n AiStore.commit('SET_ACCOUNT', val);\n }\n },\n immediate: true\n },\n visiable(newVal) {\n if (newVal && !this.showChat) {\n this.setParams();\n }\n },\n showChat(newVal) {\n if (newVal) {\n setTimeout(() => {\n this.addClass = true;\n }, 100);\n } else {\n this.addClass = false;\n }\n }\n },\n methods: {\n agentClick() {\n // 存在实例才调用内部方法\n if (this.$refs.chatMainref) {\n console.log(this.$refs.chatMainref);\n this.$refs.chatMainref.agentjumpclick();\n }\n },\n // 验证参数\n validate() {\n if (!this.imUser.accountId) {\n this.errorType = 1;\n return false;\n } else if (!this.env) {\n this.errorType = 3;\n return false;\n }\n return true;\n },\n loadScript() {\n // insertAmap() // 加载amap\n (0, _spiderHack.loadSpider)(); // 加载spider\n },\n // 设置用户参数\n setUserParams() {\n // this.userInfo.launchPage = window.location.href\n // this.userInfo.terminalSource = getOperationSys() + '-' + getBrowser()\n this.userInfo.token = (0, _cookie.getToken)();\n kfStore.commit('SET_CURR_ENV', this.env); // 存储传入环境变量\n this.loadScript();\n // openIM(this.userInfo) // 建立会话\n },\n registComp() {\n this.$nextTick(() => {});\n },\n setParams() {\n if (!this.validate()) return;\n this.showChat = true;\n this.setUserParams();\n window.addEventListener('beforeunload', e => {\n this.close();\n });\n },\n // 点击工具栏按钮\n toolbarClick(data) {\n switch (data.type) {\n case 'mini':\n this.close(true);\n break;\n case 'zoom':\n this.isFullScreen = data.isFull;\n break;\n case 'close':\n this.close(false);\n break;\n }\n },\n // 关闭窗口\n close(isMinimized) {\n if (isMinimized) {\n this.onClose(isMinimized);\n } else {\n this.showChat = false;\n // closeIM(true)\n setTimeout(() => {\n this.doDestroy();\n }, 200);\n }\n },\n // 销毁\n doDestroy() {\n if (typeof this.onClose === 'function') {\n this.onClose();\n }\n this.$destroy(true);\n this.$el.parentNode.removeChild(this.$el);\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/layout/main.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");
|
|
990
|
+
eval("\n\nvar _interopRequireWildcard = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js\").default;\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _index = _interopRequireDefault(__webpack_require__(/*! @lib/components/chatMain/index.vue */ \"./src/lib/components/chatMain/index.vue\"));\nvar _spiderHack = __webpack_require__(/*! @lib/utils/spiderHack.js */ \"./src/lib/utils/spiderHack.js\");\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _package = _interopRequireDefault(__webpack_require__(/*! ../../../package.json */ \"./package.json\"));\nvar kfStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils.js */ \"./src/lib/store/utils.js\"));\nvar AiStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils */ \"./src/lib/store/utils.js\"));\n// 初始化连接\n// import { openIM, closeIM } from '@lib/socket/socket.js'\n// 工具\n// import { getOperationSys, getBrowser } from '@lib/utils/index.js'\n// import { insertAmap } from '@lib/utils/amap.js'\nvar _default = exports.default = {\n name: 'ZjkjIntelligent',\n components: {\n ChatMain: _index.default\n },\n provide() {\n return {\n superCtrl: this.superControl\n };\n },\n props: {\n imAccount: {\n type: [String, Object],\n // default: '201912241122274' // zl\n // default: '202012221604445' // ly\n // default: '201911121106061' // zlm\n // default: '202004121438164' // hrc\n default: \"\" //wkk\n },\n companyNo: {\n type: String,\n default: ''\n },\n isIntelShow: {\n default: false,\n type: Boolean\n },\n chatImToken: {\n type: [String, Function]\n },\n platformType: {\n type: String\n },\n selectActive: {\n type: String\n },\n Ak: {\n type: String,\n default: ''\n },\n Sk: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n imUser: {},\n // 传入的用户参数\n env: '',\n // 传入的当前环境\n title: 'Ai助理',\n //传入默认标题\n zIndex: 2000,\n userInfo: {\n launchPage: '',\n terminalSource: '',\n ipAddress: ''\n },\n visiable: true,\n // 显示隐藏\n showChat: false,\n // 显示聊天窗口\n addClass: false,\n // 添加class\n isFullScreen: false,\n // 是否全屏\n onClose: null,\n // 关闭回调\n errorType: 0,\n // 错误参数\n superControl: {\n priviewUrl: '',\n // 预览图片url\n privieShow: false,\n // 预览组件显示异常\n showEmoji: false // 显示表情版面\n },\n version: _package.default.version\n };\n },\n computed: {\n valideParams() {\n return {\n env: this.env,\n im: this.imUser\n };\n }\n },\n created() {\n if (this.$hybrid && typeof this.$hybrid.closeLoading === 'function') {\n this.$hybrid.closeLoading();\n }\n },\n watch: {\n imAccount: {\n handler: function (val) {\n debugger;\n if (val) {\n AiStore.commit('SET_ACCOUNT', val);\n }\n },\n immediate: true\n },\n visiable(newVal) {\n if (newVal && !this.showChat) {\n this.setParams();\n }\n },\n showChat(newVal) {\n if (newVal) {\n setTimeout(() => {\n this.addClass = true;\n }, 100);\n } else {\n this.addClass = false;\n }\n }\n },\n methods: {\n agentClick() {\n // 存在实例才调用内部方法\n if (this.$refs.chatMainref) {\n console.log(this.$refs.chatMainref);\n this.$refs.chatMainref.agentjumpclick();\n }\n },\n // 验证参数\n validate() {\n if (!this.imUser.accountId) {\n this.errorType = 1;\n return false;\n } else if (!this.env) {\n this.errorType = 3;\n return false;\n }\n return true;\n },\n loadScript() {\n // insertAmap() // 加载amap\n (0, _spiderHack.loadSpider)(); // 加载spider\n },\n // 设置用户参数\n setUserParams() {\n // this.userInfo.launchPage = window.location.href\n // this.userInfo.terminalSource = getOperationSys() + '-' + getBrowser()\n this.userInfo.token = (0, _cookie.getToken)();\n kfStore.commit('SET_CURR_ENV', this.env); // 存储传入环境变量\n this.loadScript();\n // openIM(this.userInfo) // 建立会话\n },\n registComp() {\n this.$nextTick(() => {});\n },\n setParams() {\n if (!this.validate()) return;\n this.showChat = true;\n this.setUserParams();\n window.addEventListener('beforeunload', e => {\n this.close();\n });\n },\n // 点击工具栏按钮\n toolbarClick(data) {\n switch (data.type) {\n case 'mini':\n this.close(true);\n break;\n case 'zoom':\n this.isFullScreen = data.isFull;\n break;\n case 'close':\n this.close(false);\n break;\n }\n },\n // 关闭窗口\n close(isMinimized) {\n if (isMinimized) {\n this.onClose(isMinimized);\n } else {\n this.showChat = false;\n // closeIM(true)\n setTimeout(() => {\n this.doDestroy();\n }, 200);\n }\n },\n // 销毁\n doDestroy() {\n if (typeof this.onClose === 'function') {\n this.onClose();\n }\n this.$destroy(true);\n this.$el.parentNode.removeChild(this.$el);\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/layout/main.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");
|
|
991
991
|
|
|
992
992
|
/***/ }),
|
|
993
993
|
|
|
@@ -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/AImore.png */ \"./src/assets/aiagent/AImore.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/AImore.png */ \"./src/assets/aiagent/AImore.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 && !_vm.isMobile ? _c(\"div\", {\n staticClass: \"sidebar-loading\"\n }, [_c(\"div\", {\n staticClass: \"loading-spinner\"\n }), _c(\"div\", [_vm._v(\"加载中...\")])]) : !_vm.loading ? _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 ? \"试试其他关键词\" : \"选择助手开始对话\"))])]) : _vm._e()]);\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
|
|
|
@@ -12716,7 +12716,7 @@ eval("module.exports = function(originalModule) {\n\tif (!originalModule.webpack
|
|
|
12716
12716
|
/*! exports provided: name, version, main, private, scripts, dependencies, devDependencies, browserslist, directories, keywords, license, default */
|
|
12717
12717
|
/***/ (function(module) {
|
|
12718
12718
|
|
|
12719
|
-
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"zj-plugin-intelligent\\\",\\\"version\\\":\\\"1.2.6-beta.
|
|
12719
|
+
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"zj-plugin-intelligent\\\",\\\"version\\\":\\\"1.2.6-beta.6\\\",\\\"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?");
|
|
12720
12720
|
|
|
12721
12721
|
/***/ }),
|
|
12722
12722
|
|
|
@@ -13608,7 +13608,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
13608
13608
|
/***/ (function(module, exports, __webpack_require__) {
|
|
13609
13609
|
|
|
13610
13610
|
"use strict";
|
|
13611
|
-
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.filter.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@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-23
|
|
13611
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.filter.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@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-23 18:09:42\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 = '';\n\n// let _user = '202007091611352'\n// let _companyNo = '201912241159840'\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?");
|
|
13612
13612
|
|
|
13613
13613
|
/***/ }),
|
|
13614
13614
|
|
|
@@ -984,7 +984,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
984
984
|
/***/ (function(module, exports, __webpack_require__) {
|
|
985
985
|
|
|
986
986
|
"use strict";
|
|
987
|
-
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.map.js\");\n__webpack_require__(/*! core-js/modules/es.json.parse.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.json.parse.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 _message = __webpack_require__(/*! @lib/utils/message.js */ \"./src/lib/utils/message.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.$hybrid && typeof this.$hybrid.closeLoading === 'function') {\n this.$hybrid.closeLoading();\n }\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 } 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 if (this.showAgentSelect) {\n // 智能体选择页 → 返回列表\n this.goBackToList();\n } else if (!this.showH5List) {\n // 详情页/欢迎页 → 返回列表\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 const confirmFn = this.$confirm || _message.showConfirm;\n confirmFn(`确认删除「${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");
|
|
987
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.map.js\");\n__webpack_require__(/*! core-js/modules/es.json.parse.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.json.parse.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 _message = __webpack_require__(/*! @lib/utils/message.js */ \"./src/lib/utils/message.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 } 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 if (this.showAgentSelect) {\n // 智能体选择页 → 返回列表\n this.goBackToList();\n } else if (!this.showH5List) {\n // 详情页/欢迎页 → 返回列表\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 const confirmFn = this.$confirm || _message.showConfirm;\n confirmFn(`确认删除「${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");
|
|
988
988
|
|
|
989
989
|
/***/ }),
|
|
990
990
|
|
|
@@ -996,7 +996,7 @@ eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@
|
|
|
996
996
|
/***/ (function(module, exports, __webpack_require__) {
|
|
997
997
|
|
|
998
998
|
"use strict";
|
|
999
|
-
eval("\n\nvar _interopRequireWildcard = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js\").default;\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _index = _interopRequireDefault(__webpack_require__(/*! @lib/components/chatMain/index.vue */ \"./src/lib/components/chatMain/index.vue\"));\nvar _spiderHack = __webpack_require__(/*! @lib/utils/spiderHack.js */ \"./src/lib/utils/spiderHack.js\");\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _package = _interopRequireDefault(__webpack_require__(/*! ../../../package.json */ \"./package.json\"));\nvar kfStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils.js */ \"./src/lib/store/utils.js\"));\nvar AiStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils */ \"./src/lib/store/utils.js\"));\n// 初始化连接\n// import { openIM, closeIM } from '@lib/socket/socket.js'\n// 工具\n// import { getOperationSys, getBrowser } from '@lib/utils/index.js'\n// import { insertAmap } from '@lib/utils/amap.js'\nvar _default = exports.default = {\n name: 'ZjkjIntelligent',\n components: {\n ChatMain: _index.default\n },\n provide() {\n return {\n superCtrl: this.superControl\n };\n },\n props: {\n imAccount: {\n type: [String, Object],\n // default: '201912241122274' // zl\n // default: '202012221604445' // ly\n // default: '201911121106061' // zlm\n // default: '202004121438164' // hrc\n default: \"\" //wkk\n },\n companyNo: {\n type: String,\n default: ''\n },\n isIntelShow: {\n default: false,\n type: Boolean\n },\n chatImToken: {\n type: [String, Function]\n },\n platformType: {\n type: String\n },\n selectActive: {\n type: String\n },\n Ak: {\n type: String,\n default: ''\n },\n Sk: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n imUser: {},\n // 传入的用户参数\n env: '',\n // 传入的当前环境\n title: 'Ai助理',\n //传入默认标题\n zIndex: 2000,\n userInfo: {\n launchPage: '',\n terminalSource: '',\n ipAddress: ''\n },\n visiable: true,\n // 显示隐藏\n showChat: false,\n // 显示聊天窗口\n addClass: false,\n // 添加class\n isFullScreen: false,\n // 是否全屏\n onClose: null,\n // 关闭回调\n errorType: 0,\n // 错误参数\n superControl: {\n priviewUrl: '',\n // 预览图片url\n privieShow: false,\n // 预览组件显示异常\n showEmoji: false // 显示表情版面\n },\n version: _package.default.version\n };\n },\n computed: {\n valideParams() {\n return {\n env: this.env,\n im: this.imUser\n };\n }\n },\n watch: {\n imAccount: {\n handler: function (val) {\n debugger;\n if (val) {\n AiStore.commit('SET_ACCOUNT', val);\n }\n },\n immediate: true\n },\n visiable(newVal) {\n if (newVal && !this.showChat) {\n this.setParams();\n }\n },\n showChat(newVal) {\n if (newVal) {\n setTimeout(() => {\n this.addClass = true;\n }, 100);\n } else {\n this.addClass = false;\n }\n }\n },\n methods: {\n agentClick() {\n // 存在实例才调用内部方法\n if (this.$refs.chatMainref) {\n console.log(this.$refs.chatMainref);\n this.$refs.chatMainref.agentjumpclick();\n }\n },\n // 验证参数\n validate() {\n if (!this.imUser.accountId) {\n this.errorType = 1;\n return false;\n } else if (!this.env) {\n this.errorType = 3;\n return false;\n }\n return true;\n },\n loadScript() {\n // insertAmap() // 加载amap\n (0, _spiderHack.loadSpider)(); // 加载spider\n },\n // 设置用户参数\n setUserParams() {\n // this.userInfo.launchPage = window.location.href\n // this.userInfo.terminalSource = getOperationSys() + '-' + getBrowser()\n this.userInfo.token = (0, _cookie.getToken)();\n kfStore.commit('SET_CURR_ENV', this.env); // 存储传入环境变量\n this.loadScript();\n // openIM(this.userInfo) // 建立会话\n },\n registComp() {\n this.$nextTick(() => {});\n },\n setParams() {\n if (!this.validate()) return;\n this.showChat = true;\n this.setUserParams();\n window.addEventListener('beforeunload', e => {\n this.close();\n });\n },\n // 点击工具栏按钮\n toolbarClick(data) {\n switch (data.type) {\n case 'mini':\n this.close(true);\n break;\n case 'zoom':\n this.isFullScreen = data.isFull;\n break;\n case 'close':\n this.close(false);\n break;\n }\n },\n // 关闭窗口\n close(isMinimized) {\n if (isMinimized) {\n this.onClose(isMinimized);\n } else {\n this.showChat = false;\n // closeIM(true)\n setTimeout(() => {\n this.doDestroy();\n }, 200);\n }\n },\n // 销毁\n doDestroy() {\n if (typeof this.onClose === 'function') {\n this.onClose();\n }\n this.$destroy(true);\n this.$el.parentNode.removeChild(this.$el);\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/layout/main.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");
|
|
999
|
+
eval("\n\nvar _interopRequireWildcard = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js\").default;\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _index = _interopRequireDefault(__webpack_require__(/*! @lib/components/chatMain/index.vue */ \"./src/lib/components/chatMain/index.vue\"));\nvar _spiderHack = __webpack_require__(/*! @lib/utils/spiderHack.js */ \"./src/lib/utils/spiderHack.js\");\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _package = _interopRequireDefault(__webpack_require__(/*! ../../../package.json */ \"./package.json\"));\nvar kfStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils.js */ \"./src/lib/store/utils.js\"));\nvar AiStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils */ \"./src/lib/store/utils.js\"));\n// 初始化连接\n// import { openIM, closeIM } from '@lib/socket/socket.js'\n// 工具\n// import { getOperationSys, getBrowser } from '@lib/utils/index.js'\n// import { insertAmap } from '@lib/utils/amap.js'\nvar _default = exports.default = {\n name: 'ZjkjIntelligent',\n components: {\n ChatMain: _index.default\n },\n provide() {\n return {\n superCtrl: this.superControl\n };\n },\n props: {\n imAccount: {\n type: [String, Object],\n // default: '201912241122274' // zl\n // default: '202012221604445' // ly\n // default: '201911121106061' // zlm\n // default: '202004121438164' // hrc\n default: \"\" //wkk\n },\n companyNo: {\n type: String,\n default: ''\n },\n isIntelShow: {\n default: false,\n type: Boolean\n },\n chatImToken: {\n type: [String, Function]\n },\n platformType: {\n type: String\n },\n selectActive: {\n type: String\n },\n Ak: {\n type: String,\n default: ''\n },\n Sk: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n imUser: {},\n // 传入的用户参数\n env: '',\n // 传入的当前环境\n title: 'Ai助理',\n //传入默认标题\n zIndex: 2000,\n userInfo: {\n launchPage: '',\n terminalSource: '',\n ipAddress: ''\n },\n visiable: true,\n // 显示隐藏\n showChat: false,\n // 显示聊天窗口\n addClass: false,\n // 添加class\n isFullScreen: false,\n // 是否全屏\n onClose: null,\n // 关闭回调\n errorType: 0,\n // 错误参数\n superControl: {\n priviewUrl: '',\n // 预览图片url\n privieShow: false,\n // 预览组件显示异常\n showEmoji: false // 显示表情版面\n },\n version: _package.default.version\n };\n },\n computed: {\n valideParams() {\n return {\n env: this.env,\n im: this.imUser\n };\n }\n },\n created() {\n if (this.$hybrid && typeof this.$hybrid.closeLoading === 'function') {\n this.$hybrid.closeLoading();\n }\n },\n watch: {\n imAccount: {\n handler: function (val) {\n debugger;\n if (val) {\n AiStore.commit('SET_ACCOUNT', val);\n }\n },\n immediate: true\n },\n visiable(newVal) {\n if (newVal && !this.showChat) {\n this.setParams();\n }\n },\n showChat(newVal) {\n if (newVal) {\n setTimeout(() => {\n this.addClass = true;\n }, 100);\n } else {\n this.addClass = false;\n }\n }\n },\n methods: {\n agentClick() {\n // 存在实例才调用内部方法\n if (this.$refs.chatMainref) {\n console.log(this.$refs.chatMainref);\n this.$refs.chatMainref.agentjumpclick();\n }\n },\n // 验证参数\n validate() {\n if (!this.imUser.accountId) {\n this.errorType = 1;\n return false;\n } else if (!this.env) {\n this.errorType = 3;\n return false;\n }\n return true;\n },\n loadScript() {\n // insertAmap() // 加载amap\n (0, _spiderHack.loadSpider)(); // 加载spider\n },\n // 设置用户参数\n setUserParams() {\n // this.userInfo.launchPage = window.location.href\n // this.userInfo.terminalSource = getOperationSys() + '-' + getBrowser()\n this.userInfo.token = (0, _cookie.getToken)();\n kfStore.commit('SET_CURR_ENV', this.env); // 存储传入环境变量\n this.loadScript();\n // openIM(this.userInfo) // 建立会话\n },\n registComp() {\n this.$nextTick(() => {});\n },\n setParams() {\n if (!this.validate()) return;\n this.showChat = true;\n this.setUserParams();\n window.addEventListener('beforeunload', e => {\n this.close();\n });\n },\n // 点击工具栏按钮\n toolbarClick(data) {\n switch (data.type) {\n case 'mini':\n this.close(true);\n break;\n case 'zoom':\n this.isFullScreen = data.isFull;\n break;\n case 'close':\n this.close(false);\n break;\n }\n },\n // 关闭窗口\n close(isMinimized) {\n if (isMinimized) {\n this.onClose(isMinimized);\n } else {\n this.showChat = false;\n // closeIM(true)\n setTimeout(() => {\n this.doDestroy();\n }, 200);\n }\n },\n // 销毁\n doDestroy() {\n if (typeof this.onClose === 'function') {\n this.onClose();\n }\n this.$destroy(true);\n this.$el.parentNode.removeChild(this.$el);\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/layout/main.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");
|
|
1000
1000
|
|
|
1001
1001
|
/***/ }),
|
|
1002
1002
|
|
|
@@ -1056,7 +1056,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
1056
1056
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1057
1057
|
|
|
1058
1058
|
"use strict";
|
|
1059
|
-
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/AImore.png */ \"./src/assets/aiagent/AImore.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");
|
|
1059
|
+
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/AImore.png */ \"./src/assets/aiagent/AImore.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 && !_vm.isMobile ? _c(\"div\", {\n staticClass: \"sidebar-loading\"\n }, [_c(\"div\", {\n staticClass: \"loading-spinner\"\n }), _c(\"div\", [_vm._v(\"加载中...\")])]) : !_vm.loading ? _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 ? \"试试其他关键词\" : \"选择助手开始对话\"))])]) : _vm._e()]);\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");
|
|
1060
1060
|
|
|
1061
1061
|
/***/ }),
|
|
1062
1062
|
|
|
@@ -12725,7 +12725,7 @@ eval("module.exports = function(originalModule) {\n\tif (!originalModule.webpack
|
|
|
12725
12725
|
/*! exports provided: name, version, main, private, scripts, dependencies, devDependencies, browserslist, directories, keywords, license, default */
|
|
12726
12726
|
/***/ (function(module) {
|
|
12727
12727
|
|
|
12728
|
-
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"zj-plugin-intelligent\\\",\\\"version\\\":\\\"1.2.6-beta.
|
|
12728
|
+
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"zj-plugin-intelligent\\\",\\\"version\\\":\\\"1.2.6-beta.6\\\",\\\"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?");
|
|
12729
12729
|
|
|
12730
12730
|
/***/ }),
|
|
12731
12731
|
|
|
@@ -13617,7 +13617,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
13617
13617
|
/***/ (function(module, exports, __webpack_require__) {
|
|
13618
13618
|
|
|
13619
13619
|
"use strict";
|
|
13620
|
-
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.filter.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@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-23
|
|
13620
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.filter.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@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-23 18:09:42\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 = '';\n\n// let _user = '202007091611352'\n// let _companyNo = '201912241159840'\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?");
|
|
13621
13621
|
|
|
13622
13622
|
/***/ }),
|
|
13623
13623
|
|
|
@@ -984,7 +984,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
984
984
|
/***/ (function(module, exports, __webpack_require__) {
|
|
985
985
|
|
|
986
986
|
"use strict";
|
|
987
|
-
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.map.js\");\n__webpack_require__(/*! core-js/modules/es.json.parse.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.json.parse.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 _message = __webpack_require__(/*! @lib/utils/message.js */ \"./src/lib/utils/message.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.$hybrid && typeof this.$hybrid.closeLoading === 'function') {\n this.$hybrid.closeLoading();\n }\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 } 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 if (this.showAgentSelect) {\n // 智能体选择页 → 返回列表\n this.goBackToList();\n } else if (!this.showH5List) {\n // 详情页/欢迎页 → 返回列表\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 const confirmFn = this.$confirm || _message.showConfirm;\n confirmFn(`确认删除「${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");
|
|
987
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.find.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.map.js\");\n__webpack_require__(/*! core-js/modules/es.json.parse.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.json.parse.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 _message = __webpack_require__(/*! @lib/utils/message.js */ \"./src/lib/utils/message.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 } 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 if (this.showAgentSelect) {\n // 智能体选择页 → 返回列表\n this.goBackToList();\n } else if (!this.showH5List) {\n // 详情页/欢迎页 → 返回列表\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 const confirmFn = this.$confirm || _message.showConfirm;\n confirmFn(`确认删除「${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");
|
|
988
988
|
|
|
989
989
|
/***/ }),
|
|
990
990
|
|
|
@@ -996,7 +996,7 @@ eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@
|
|
|
996
996
|
/***/ (function(module, exports, __webpack_require__) {
|
|
997
997
|
|
|
998
998
|
"use strict";
|
|
999
|
-
eval("\n\nvar _interopRequireWildcard = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js\").default;\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _index = _interopRequireDefault(__webpack_require__(/*! @lib/components/chatMain/index.vue */ \"./src/lib/components/chatMain/index.vue\"));\nvar _spiderHack = __webpack_require__(/*! @lib/utils/spiderHack.js */ \"./src/lib/utils/spiderHack.js\");\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _package = _interopRequireDefault(__webpack_require__(/*! ../../../package.json */ \"./package.json\"));\nvar kfStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils.js */ \"./src/lib/store/utils.js\"));\nvar AiStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils */ \"./src/lib/store/utils.js\"));\n// 初始化连接\n// import { openIM, closeIM } from '@lib/socket/socket.js'\n// 工具\n// import { getOperationSys, getBrowser } from '@lib/utils/index.js'\n// import { insertAmap } from '@lib/utils/amap.js'\nvar _default = exports.default = {\n name: 'ZjkjIntelligent',\n components: {\n ChatMain: _index.default\n },\n provide() {\n return {\n superCtrl: this.superControl\n };\n },\n props: {\n imAccount: {\n type: [String, Object],\n // default: '201912241122274' // zl\n // default: '202012221604445' // ly\n // default: '201911121106061' // zlm\n // default: '202004121438164' // hrc\n default: \"\" //wkk\n },\n companyNo: {\n type: String,\n default: ''\n },\n isIntelShow: {\n default: false,\n type: Boolean\n },\n chatImToken: {\n type: [String, Function]\n },\n platformType: {\n type: String\n },\n selectActive: {\n type: String\n },\n Ak: {\n type: String,\n default: ''\n },\n Sk: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n imUser: {},\n // 传入的用户参数\n env: '',\n // 传入的当前环境\n title: 'Ai助理',\n //传入默认标题\n zIndex: 2000,\n userInfo: {\n launchPage: '',\n terminalSource: '',\n ipAddress: ''\n },\n visiable: true,\n // 显示隐藏\n showChat: false,\n // 显示聊天窗口\n addClass: false,\n // 添加class\n isFullScreen: false,\n // 是否全屏\n onClose: null,\n // 关闭回调\n errorType: 0,\n // 错误参数\n superControl: {\n priviewUrl: '',\n // 预览图片url\n privieShow: false,\n // 预览组件显示异常\n showEmoji: false // 显示表情版面\n },\n version: _package.default.version\n };\n },\n computed: {\n valideParams() {\n return {\n env: this.env,\n im: this.imUser\n };\n }\n },\n watch: {\n imAccount: {\n handler: function (val) {\n debugger;\n if (val) {\n AiStore.commit('SET_ACCOUNT', val);\n }\n },\n immediate: true\n },\n visiable(newVal) {\n if (newVal && !this.showChat) {\n this.setParams();\n }\n },\n showChat(newVal) {\n if (newVal) {\n setTimeout(() => {\n this.addClass = true;\n }, 100);\n } else {\n this.addClass = false;\n }\n }\n },\n methods: {\n agentClick() {\n // 存在实例才调用内部方法\n if (this.$refs.chatMainref) {\n console.log(this.$refs.chatMainref);\n this.$refs.chatMainref.agentjumpclick();\n }\n },\n // 验证参数\n validate() {\n if (!this.imUser.accountId) {\n this.errorType = 1;\n return false;\n } else if (!this.env) {\n this.errorType = 3;\n return false;\n }\n return true;\n },\n loadScript() {\n // insertAmap() // 加载amap\n (0, _spiderHack.loadSpider)(); // 加载spider\n },\n // 设置用户参数\n setUserParams() {\n // this.userInfo.launchPage = window.location.href\n // this.userInfo.terminalSource = getOperationSys() + '-' + getBrowser()\n this.userInfo.token = (0, _cookie.getToken)();\n kfStore.commit('SET_CURR_ENV', this.env); // 存储传入环境变量\n this.loadScript();\n // openIM(this.userInfo) // 建立会话\n },\n registComp() {\n this.$nextTick(() => {});\n },\n setParams() {\n if (!this.validate()) return;\n this.showChat = true;\n this.setUserParams();\n window.addEventListener('beforeunload', e => {\n this.close();\n });\n },\n // 点击工具栏按钮\n toolbarClick(data) {\n switch (data.type) {\n case 'mini':\n this.close(true);\n break;\n case 'zoom':\n this.isFullScreen = data.isFull;\n break;\n case 'close':\n this.close(false);\n break;\n }\n },\n // 关闭窗口\n close(isMinimized) {\n if (isMinimized) {\n this.onClose(isMinimized);\n } else {\n this.showChat = false;\n // closeIM(true)\n setTimeout(() => {\n this.doDestroy();\n }, 200);\n }\n },\n // 销毁\n doDestroy() {\n if (typeof this.onClose === 'function') {\n this.onClose();\n }\n this.$destroy(true);\n this.$el.parentNode.removeChild(this.$el);\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/layout/main.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");
|
|
999
|
+
eval("\n\nvar _interopRequireWildcard = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireWildcard.js\").default;\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _index = _interopRequireDefault(__webpack_require__(/*! @lib/components/chatMain/index.vue */ \"./src/lib/components/chatMain/index.vue\"));\nvar _spiderHack = __webpack_require__(/*! @lib/utils/spiderHack.js */ \"./src/lib/utils/spiderHack.js\");\nvar _cookie = __webpack_require__(/*! @lib/utils/cookie.js */ \"./src/lib/utils/cookie.js\");\nvar _package = _interopRequireDefault(__webpack_require__(/*! ../../../package.json */ \"./package.json\"));\nvar kfStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils.js */ \"./src/lib/store/utils.js\"));\nvar AiStore = _interopRequireWildcard(__webpack_require__(/*! @lib/store/utils */ \"./src/lib/store/utils.js\"));\n// 初始化连接\n// import { openIM, closeIM } from '@lib/socket/socket.js'\n// 工具\n// import { getOperationSys, getBrowser } from '@lib/utils/index.js'\n// import { insertAmap } from '@lib/utils/amap.js'\nvar _default = exports.default = {\n name: 'ZjkjIntelligent',\n components: {\n ChatMain: _index.default\n },\n provide() {\n return {\n superCtrl: this.superControl\n };\n },\n props: {\n imAccount: {\n type: [String, Object],\n // default: '201912241122274' // zl\n // default: '202012221604445' // ly\n // default: '201911121106061' // zlm\n // default: '202004121438164' // hrc\n default: \"\" //wkk\n },\n companyNo: {\n type: String,\n default: ''\n },\n isIntelShow: {\n default: false,\n type: Boolean\n },\n chatImToken: {\n type: [String, Function]\n },\n platformType: {\n type: String\n },\n selectActive: {\n type: String\n },\n Ak: {\n type: String,\n default: ''\n },\n Sk: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n imUser: {},\n // 传入的用户参数\n env: '',\n // 传入的当前环境\n title: 'Ai助理',\n //传入默认标题\n zIndex: 2000,\n userInfo: {\n launchPage: '',\n terminalSource: '',\n ipAddress: ''\n },\n visiable: true,\n // 显示隐藏\n showChat: false,\n // 显示聊天窗口\n addClass: false,\n // 添加class\n isFullScreen: false,\n // 是否全屏\n onClose: null,\n // 关闭回调\n errorType: 0,\n // 错误参数\n superControl: {\n priviewUrl: '',\n // 预览图片url\n privieShow: false,\n // 预览组件显示异常\n showEmoji: false // 显示表情版面\n },\n version: _package.default.version\n };\n },\n computed: {\n valideParams() {\n return {\n env: this.env,\n im: this.imUser\n };\n }\n },\n created() {\n if (this.$hybrid && typeof this.$hybrid.closeLoading === 'function') {\n this.$hybrid.closeLoading();\n }\n },\n watch: {\n imAccount: {\n handler: function (val) {\n debugger;\n if (val) {\n AiStore.commit('SET_ACCOUNT', val);\n }\n },\n immediate: true\n },\n visiable(newVal) {\n if (newVal && !this.showChat) {\n this.setParams();\n }\n },\n showChat(newVal) {\n if (newVal) {\n setTimeout(() => {\n this.addClass = true;\n }, 100);\n } else {\n this.addClass = false;\n }\n }\n },\n methods: {\n agentClick() {\n // 存在实例才调用内部方法\n if (this.$refs.chatMainref) {\n console.log(this.$refs.chatMainref);\n this.$refs.chatMainref.agentjumpclick();\n }\n },\n // 验证参数\n validate() {\n if (!this.imUser.accountId) {\n this.errorType = 1;\n return false;\n } else if (!this.env) {\n this.errorType = 3;\n return false;\n }\n return true;\n },\n loadScript() {\n // insertAmap() // 加载amap\n (0, _spiderHack.loadSpider)(); // 加载spider\n },\n // 设置用户参数\n setUserParams() {\n // this.userInfo.launchPage = window.location.href\n // this.userInfo.terminalSource = getOperationSys() + '-' + getBrowser()\n this.userInfo.token = (0, _cookie.getToken)();\n kfStore.commit('SET_CURR_ENV', this.env); // 存储传入环境变量\n this.loadScript();\n // openIM(this.userInfo) // 建立会话\n },\n registComp() {\n this.$nextTick(() => {});\n },\n setParams() {\n if (!this.validate()) return;\n this.showChat = true;\n this.setUserParams();\n window.addEventListener('beforeunload', e => {\n this.close();\n });\n },\n // 点击工具栏按钮\n toolbarClick(data) {\n switch (data.type) {\n case 'mini':\n this.close(true);\n break;\n case 'zoom':\n this.isFullScreen = data.isFull;\n break;\n case 'close':\n this.close(false);\n break;\n }\n },\n // 关闭窗口\n close(isMinimized) {\n if (isMinimized) {\n this.onClose(isMinimized);\n } else {\n this.showChat = false;\n // closeIM(true)\n setTimeout(() => {\n this.doDestroy();\n }, 200);\n }\n },\n // 销毁\n doDestroy() {\n if (typeof this.onClose === 'function') {\n this.onClose();\n }\n this.$destroy(true);\n this.$el.parentNode.removeChild(this.$el);\n }\n }\n};\n\n//# sourceURL=webpack://ZjPluginIntelligent/./src/lib/layout/main.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");
|
|
1000
1000
|
|
|
1001
1001
|
/***/ }),
|
|
1002
1002
|
|
|
@@ -1056,7 +1056,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
1056
1056
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1057
1057
|
|
|
1058
1058
|
"use strict";
|
|
1059
|
-
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/AImore.png */ \"./src/assets/aiagent/AImore.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");
|
|
1059
|
+
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/AImore.png */ \"./src/assets/aiagent/AImore.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 && !_vm.isMobile ? _c(\"div\", {\n staticClass: \"sidebar-loading\"\n }, [_c(\"div\", {\n staticClass: \"loading-spinner\"\n }), _c(\"div\", [_vm._v(\"加载中...\")])]) : !_vm.loading ? _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 ? \"试试其他关键词\" : \"选择助手开始对话\"))])]) : _vm._e()]);\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");
|
|
1060
1060
|
|
|
1061
1061
|
/***/ }),
|
|
1062
1062
|
|
|
@@ -12725,7 +12725,7 @@ eval("module.exports = function(originalModule) {\n\tif (!originalModule.webpack
|
|
|
12725
12725
|
/*! exports provided: name, version, main, private, scripts, dependencies, devDependencies, browserslist, directories, keywords, license, default */
|
|
12726
12726
|
/***/ (function(module) {
|
|
12727
12727
|
|
|
12728
|
-
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"zj-plugin-intelligent\\\",\\\"version\\\":\\\"1.2.6-beta.
|
|
12728
|
+
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"zj-plugin-intelligent\\\",\\\"version\\\":\\\"1.2.6-beta.6\\\",\\\"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?");
|
|
12729
12729
|
|
|
12730
12730
|
/***/ }),
|
|
12731
12731
|
|
|
@@ -13617,7 +13617,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
13617
13617
|
/***/ (function(module, exports, __webpack_require__) {
|
|
13618
13618
|
|
|
13619
13619
|
"use strict";
|
|
13620
|
-
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.filter.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@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-23
|
|
13620
|
+
eval("\n\nvar _interopRequireDefault = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.29.7@@babel/runtime/helpers/interopRequireDefault.js */ \"./node_modules/_@babel_runtime@7.29.7@@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.49.0@core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.array.push.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/_core-js@3.49.0@core-js/modules/es.iterator.filter.js\");\n__webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/_core-js@3.49.0@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-23 18:09:42\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 = '';\n\n// let _user = '202007091611352'\n// let _companyNo = '201912241159840'\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?");
|
|
13621
13621
|
|
|
13622
13622
|
/***/ }),
|
|
13623
13623
|
|