{"remainingRequest":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\components\\layout\\Layout.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\components\\layout\\Layout.vue","mtime":1720471236277},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.array.from\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.regexp.split\";\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport Navigator from \"./Navigator.vue\";\nimport SideMenu from \"./SideMenu.vue\";\nimport Main from \"./Main.vue\";\nexport default {\n components: {\n Navigator: Navigator,\n SideMenu: SideMenu,\n Main: Main\n },\n data: function data() {\n return {\n menuShow: true,\n // 侧边菜单收折flag\n transitionName: 'fold-right',\n // 页面切换动画名称\n navMode: 'sideMenu',\n // sideMenu 侧边菜单 | topMenu 顶部菜单 | topSideMenu-UD 顶部侧边联动菜单上下布局 | topSideMenu-LR 顶部侧边联动菜单左右布局\n aliasPath: [],\n // 当前路由菜单别名全路径\n bizMenuIndex: 0,\n //业务菜单一级属于前台菜单层级中的第几级\n bizMenuAlias: 'normal',\n // 业务菜单根别名\n showHeader: true,\n heartCheck: {},\n isCurrentWindow: true\n };\n },\n created: function created() {\n // 在外框架中获取所有前台菜单,组件中不再请求,直接读取vuex中数据\n this.getMenus();\n this.heartCheckFun();\n this.initWebSocket();\n },\n mounted: function mounted() {\n var _this = this;\n\n window.onresize = function () {\n _this.$root.$emit('resize');\n };\n\n this.$bus.$on('login', function () {\n _this.heartCheckFun();\n });\n },\n beforeDestroy: function beforeDestroy() {\n this.isCurrentWindow = false;\n },\n watch: {\n $route: 'activeAlias'\n },\n methods: {\n getMenus: function getMenus() {\n var _this2 = this;\n\n this.menuAll = [];\n this.$store.dispatch('menu/actionFrontMenus').then(function (data) {\n _this2.menuAll = data;\n _this2.menuReady = true;\n\n _this2.activeAlias();\n });\n },\n activeAlias: function activeAlias() {\n // 如果是顶部侧边联动部菜单则页面刷新时需要根据当前路由别名找到对应的父级节点\n if (this.navMode == 'topSideMenu-LR' || this.navMode == 'topSideMenu-UD') {\n // 根据路由别名刷新找到对应的父级菜单全路径\n var fullPath = this.$route.path;\n var path = fullPath.split('/');\n var urlAnchor = path[path.indexOf('platLayout') + 1];\n var aliasPath = [];\n this.filterRootParant(this.menuAll, urlAnchor, aliasPath);\n this.aliasPath = aliasPath;\n }\n\n this.$bus.$emit('menuPathReady', this.aliasPath);\n },\n // 找到对应的根父级菜单\n filterRootParant: function filterRootParant(data, urlAnchor, result) {\n var _iterator = _createForOfIteratorHelper(data),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n\n if (item.alias === urlAnchor) {\n // 如何找到了则说明这里是最后一级可以返回了,将查找到的目标数据加入结果数组中\n // 可根据需求unshift(item.id)或unshift(item)\n result.unshift(item.alias);\n return true;\n } else if (item.children && item.children.length > 0) {\n // 否则继续在子节点中查找\n var isFind = this.filterRootParant(item.children, urlAnchor, result); // 如果在当前节点的子字节点中找到了则将当前节点加入到结果数组中\n\n if (isFind) {\n result.unshift(item.alias);\n return true;\n }\n }\n } // 没找到目标\n\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return false;\n },\n initWebSocket: function initWebSocket() {\n // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https\n var token = this.$store.state.login.currentUser.token;\n var url = window.context.WebSocket.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket'; // ?token=' +\n // token\n\n console.log(url, 'url');\n this.websock = new WebSocket(url);\n this.websock.onopen = this.websocketOnopen;\n this.websock.onerror = this.websocketOnerror;\n this.websock.onmessage = this.websocketOnmessage;\n this.websock.onclose = this.websocketOnclose;\n },\n websocketOnopen: function websocketOnopen() {\n console.log('WebSocket连接成功');\n this.heartCheck.start();\n },\n websocketOnerror: function websocketOnerror(e) {\n console.log(e, 'WebSocket连接发生错误');\n this.reconnect();\n },\n websocketOnmessage: function websocketOnmessage(e) {\n var data = JSON.parse(e.data); //解析对象 eval('(' + e.data + ')');\n // 竞拍报价\n\n if (data.offerId !== undefined) {\n if (this.isCurrentWindow) {\n console.log('-----接收消息-------', data.offerId);\n this.$bus.$emit('JPBJMsg', data.offerId);\n }\n }\n\n this.heartCheck.reset();\n },\n websocketOnclose: function websocketOnclose(e) {\n console.log('connection closed (' + e.code + ')');\n this.reconnect();\n },\n websocketSend: function websocketSend(text) {\n // 数据发送\n try {\n this.websock.send(text);\n } catch (err) {\n console.log('send failed (' + err.code + ')');\n }\n },\n reconnect: function reconnect() {\n var _this3 = this;\n\n if (this.lockReconnect) return;\n this.lockReconnect = true; //没连接上会一直重连,设置延迟避免请求过多\n\n setTimeout(function () {\n console.info('尝试重连...');\n\n _this3.initWebSocket();\n\n _this3.lockReconnect = false;\n }, 5000);\n },\n heartCheckFun: function heartCheckFun() {\n var that = this; //心跳检测,每10分钟心跳一次\n\n this.heartCheck = {\n timeout: 1000 * 60 * 10,\n timeoutObj: null,\n serverTimeoutObj: null,\n reset: function reset() {\n clearTimeout(this.timeoutObj);\n this.start();\n return this;\n },\n start: function start() {\n var self = this;\n this.timeoutObj = setTimeout(function () {\n //这里发送一个心跳,后端收到后,返回一个心跳消息,\n //onmessage拿到返回的心跳就说明连接正常\n var account = JSON.parse(sessionStorage.getItem('currentUser')).account;\n that.websocketSend(\"{'messageType':'ping','message':'web'}\");\n console.info('客户端发送心跳'); //self.serverTimeoutObj = setTimeout(function(){//如果超过一定时间还没重置,说明后端主动断开了\n // that.websock.close();//如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次\n //}, self.timeout)\n }, this.timeout);\n }\n };\n }\n }\n};",null]}