{"remainingRequest":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\style-vw-loader\\index.js??ref--0-2!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\components\\common\\Header.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\components\\common\\Header.vue","mtime":1663828782921},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\babel.config.js","mtime":1663828782900},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\style-vw-loader\\index.js","mtime":1540864632000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport _defineProperty from \"C:/Users/100zone/Desktop/baizong/community/SmartCommunity/videoSurveillance/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\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 { mapState, mapGetters, mapMutations, mapActions } from 'vuex';\nimport envConfig from '@/config';\nimport vTags from \"./Tags.vue\";\nexport default {\n data: function data() {\n return {\n name: '',\n envConfig: envConfig,\n imgList: {\n 1: require('@/assets/img/icon_msg1.png'),\n 2: require('@/assets/img/icon_msg7.png'),\n 10: require('@/assets/img/icon_msg9.png'),\n 11: require('@/assets/img/icon_msg9.png'),\n 13: require('@/assets/img/icon_msg9.png')\n }\n };\n },\n components: {\n vTags: vTags\n },\n computed: _objectSpread(_objectSpread({\n cruUserInfo: function cruUserInfo() {\n return this.$store.getters['getCruUserInfo'];\n },\n collapse: function collapse() {\n return this.$store.getters['getCollapse'];\n }\n }, mapState(['messageNumber'])), mapState(['messageList'])),\n methods: {\n toUrl: function toUrl(type) {\n this.$router.push({\n path: '/msg'\n });\n },\n // 退出登录\n logOut: function logOut() {\n var _this = this;\n\n var access_token = localStorage.getItem('SC_token');\n this.$http.postForm('/sc-user-auth/user/logout', {\n access_token: access_token\n }).then(function (_ref) {\n var status = _ref.status,\n data = _ref.data,\n msg = _ref.msg;\n\n if (0 === status) {\n _this.$message({\n type: 'success',\n message: '您已退出登录'\n });\n\n localStorage.removeItem('SC_token');\n sessionStorage.removeItem('SC_listMuen');\n\n _this.$store.commit('setloginInfo', '');\n\n _this.$store.dispatch('tags', []);\n\n sessionStorage.removeItem('tabs');\n window.location.href = _this.envConfig.loginUrl;\n } else {\n _this.$message.error(msg);\n }\n });\n },\n getUserInfo: function getUserInfo(resolve) {\n var _this2 = this;\n\n this.$http.postForm('/sc-user-center/user/findLoginUserById').then(function (_ref2) {\n var status = _ref2.status,\n data = _ref2.data,\n msg = _ref2.msg;\n\n if (status === 0) {\n _this2.$store.commit('setcCruUserInfo', data);\n } else {\n _this2.$message.error('获取用户信息失败');\n }\n\n resolve && resolve(true);\n });\n },\n editUserInfo: function editUserInfo() {\n var _this3 = this;\n\n new Promise(function (resolve) {\n _this3.$store.dispatch('addPopup', {\n url: '/system/edituser.vue',\n width: '500px',\n height: '500px',\n props: {\n data: JSON.parse(JSON.stringify(_this3.cruUserInfo)),\n callback: resolve\n },\n title: '编辑用户信息'\n });\n }).then(function () {\n _this3.getUserInfo();\n });\n },\n goMessage: function goMessage(msg) {\n var messageStatus = 2; //全部\n\n if (msg == 'unread') {\n messageStatus = 0; //未读\n }\n\n this.$store.commit('setmessageStatus', messageStatus);\n this.$router.push({\n path: '/msg'\n });\n },\n //获取最新消息列表\n getMessageList: function getMessageList() {\n var _this4 = this;\n\n this.$http.postForm('/sc-message/message/queryLastMessage', {\n num: '5'\n }).then(function (_ref3) {\n var status = _ref3.status,\n data = _ref3.data,\n msg = _ref3.msg;\n\n if (status === 0) {\n _this4.$store.commit('setmessageList', data);\n }\n });\n },\n //查询未读消息数量\n getUnreadNumber: function getUnreadNumber() {\n var _this5 = this;\n\n this.$http.postForm('/sc-message/message/queryUnreadMessageStatic').then(function (_ref4) {\n var status = _ref4.status,\n data = _ref4.data,\n msg = _ref4.msg;\n\n if (status === 0) {\n data.map(function (item, index) {\n if (item.cn) {\n _this5.$store.commit('setmessageNumber', true);\n }\n });\n }\n });\n },\n //初始化websoket\n initWebSocket: function initWebSocket(id) {\n if ('WebSocket' in window) {\n var serviceIp = this.envConfig.websoketUrl;\n this.websocket = new WebSocket('ws://' + serviceIp + '/sc-message/webSocket/' + id);\n } else {\n console.log('当前浏览器 Not support websocket');\n }\n\n var that = this;\n this.interval = window.setInterval(function () {\n //每隔30秒钟发送一次心跳,避免websocket连接因超时而自动断开\n if (that.websocket != null) {// that.websocket.send('HeartBeat');\n // console.log('发送心跳包:HeartBeat');\n }\n }, 30000); //连接发生错误的回调方法\n\n this.websocket.onerror = function (ev) {\n console.log('WebSocket连接发生错误');\n }; //连接成功建立的回调方法\n\n\n this.websocket.onopen = function (ev) {\n console.log('WebSocket连接成功'); // this.send('addsocket');\n }; //接收到消息的回调方法\n\n\n this.websocket.onmessage = function (event) {\n try {\n var msg = JSON.parse(event.data); // let i = msg.typeId - 1;\n\n var i = msg.typeId;\n\n if (msg.userId) {\n that.$notify({\n dangerouslyUseHTMLString: true,\n showClose: true,\n customClass: 'notice_icon',\n offset: 50,\n duration: 3000,\n message: \"
新消息通知\" + '【' + msg.type + '】' + msg.content + '
'\n });\n that.getMessageList();\n that.getUnreadNumber();\n }\n } catch (e) {}\n }; //连接关闭的回调方法\n\n\n this.websocket.onclose = function (ev) {\n console.log('WebSocket连接关闭');\n this.websocket = null;\n };\n },\n send: function send(message) {\n if (this.websocket && this.websocket != null) {\n // this.websocket.send(message);\n console.log('发送的消息:' + message);\n }\n },\n //关闭WebSocket连接\n closeWebSocket: function closeWebSocket() {\n if (this.websocket != null) {\n this.websocket.close();\n }\n\n if (this.interval) {\n window.clearInterval(this.interval);\n }\n }\n },\n mounted: function mounted() {\n var vm = this;\n\n window.onbeforeunload = function () {\n vm.closeWebSocket();\n };\n },\n destoryed: function destoryed() {\n this.closeWebSocket();\n },\n created: function created() {\n var _this6 = this;\n\n new Promise(function (resolve) {\n _this6.getUserInfo(resolve);\n }).then(function (_) {\n var id = _this6.$store.state.cruUserInfo.id;\n\n _this6.initWebSocket(id);\n\n _this6.getMessageList();\n\n _this6.getUnreadNumber();\n });\n }\n};",{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA;AACA;AACA;AACA;AACAA,MADA,kBACA;AACA;AACAC,cADA;AAEAC,0BAFA;AAGAC;AACA,gDADA;AAEA,gDAFA;AAGA,iDAHA;AAIA,iDAJA;AAKA;AALA;AAHA;AAWA,GAbA;AAcAC;AACAC;AADA,GAdA;AAiBAC;AACAC,eADA,yBACA;AACA;AACA,KAHA;AAIAC,YAJA,sBAIA;AACA;AACA;AANA,KAOAC,2BAPA,GAQAA,yBARA,CAjBA;AA2BAC;AACAC,SADA,iBACAC,IADA,EACA;AACA;AACAC;AADA;AAGA,KALA;AAMA;AACAC,UAPA,oBAOA;AAAA;;AACA;AACA;AAAAC;AAAA;AAAA;AAAA;AAAA;;AACA;AACA;AACAH,2BADA;AAEAI;AAFA;;AAIAC;AACAC;;AACA;;AACA;;AAEAA;AACAC;AACA,SAZA,MAYA;AACA;AACA;AACA,OAhBA;AAiBA,KA1BA;AA2BAC,eA3BA,uBA2BAC,OA3BA,EA2BA;AAAA;;AACA;AAAA;AAAA;AAAA;;AACA;AACA;AACA,SAFA,MAEA;AACA;AACA;;AACAA;AACA,OAPA;AAQA,KApCA;AAqCAC,gBArCA,0BAqCA;AAAA;;AACA;AACA;AACAC,qCADA;AAEAC,wBAFA;AAGAC,yBAHA;AAIAC;AACA1B,gEADA;AAEA2B;AAFA,WAJA;AAQAC;AARA;AAUA,OAXA,EAWAC,IAXA,CAWA;AACA;AACA,OAbA;AAcA,KApDA;AAqDAC,aArDA,qBAqDAC,GArDA,EAqDA;AACA,4BADA,CACA;;AACA;AACAC,0BADA,CACA;AACA;;AACA;AACA;AACAnB;AADA;AAGA,KA9DA;AA+DA;AACAoB,kBAhEA,4BAgEA;AAAA;;AACA;AAAAC;AAAA;AAAA;AAAA;AAAA;;AACA;AACA;AACA;AACA,OAJA;AAKA,KAtEA;AAuEA;AACAC,mBAxEA,6BAwEA;AAAA;;AACA;AAAA;AAAA;AAAA;;AACA;AACAnC;AACA;AACA;AACA;AACA,WAJA;AAKA;AACA,OARA;AASA,KAlFA;AAmFA;AACAoC,iBApFA,yBAoFAC,EApFA,EAoFA;AACA;AACA;AACA;AACA,OAHA,MAGA;AACAC;AACA;;AACA;AACA;AACA;AACA,qCACA;AACA;AACA;AACA,OANA,EAMA,KANA,EARA,CAeA;;AACA;AACAA;AACA,OAFA,CAhBA,CAoBA;;;AACA;AACAA,qCADA,CAEA;AACA,OAHA,CArBA,CA0BA;;;AACA;AACA;AACA,2CADA,CAEA;;AACA;;AACA;AACAC;AACAC,4CADA;AAEAC,6BAFA;AAGAC,wCAHA;AAIAC,wBAJA;AAKAC,4BALA;AAMA5B,uBACA,kCACAuB,eADA,GAEA,iGAFA,GAGA,GAHA,GAIAR,QAJA,GAKA,GALA,GAMAA,WANA,GAOA;AAdA;AAgBAQ;AACAA;AACA;AACA,SAxBA,CAwBA;AACA,OA1BA,CA3BA,CAuDA;;;AACA;AACAD;AACA;AACA,OAHA;AAIA,KAhJA;AAiJAO,QAjJA,gBAiJA7B,OAjJA,EAiJA;AACA;AACA;AACAsB;AACA;AACA,KAtJA;AAuJA;AACAQ,kBAxJA,4BAwJA;AACA;AACA;AACA;;AACA;AACA3B;AACA;AACA;AA/JA,GA3BA;AA4LA4B,SA5LA,qBA4LA;AACA;;AACA5B;AACA6B;AACA,KAFA;AAGA,GAjMA;AAkMAC,WAlMA,uBAkMA;AACA;AACA,GApMA;AAqMAC,SArMA,qBAqMA;AAAA;;AACA;AACA;AACA,KAFA,EAEArB,IAFA,CAEA;AACA;;AACA;;AACA;;AACA;AACA,KAPA;AAQA;AA9MA","names":["data","name","envConfig","imgList","components","vTags","computed","cruUserInfo","collapse","mapState","methods","toUrl","type","path","logOut","access_token","message","localStorage","sessionStorage","window","getUserInfo","resolve","editUserInfo","url","width","height","props","callback","title","then","goMessage","msg","messageStatus","getMessageList","num","getUnreadNumber","initWebSocket","id","console","that","dangerouslyUseHTMLString","showClose","customClass","offset","duration","send","closeWebSocket","mounted","vm","destoryed","created"],"sourceRoot":"src/components/common","sources":["Header.vue"],"sourcesContent":["\r\n\r\n\r\n"]}]}