{"remainingRequest":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/admin/projects/dms/src/dealer_admin/src/layout/components/Navbar.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/layout/components/Navbar.vue","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/babel.config.js","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["import _regeneratorRuntime from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/regeneratorRuntime.js\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/asyncToGenerator.js\";\nimport _objectSpread from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/objectSpread2.js\";\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 { mapGetters } from 'vuex';\nimport Breadcrumb from '@/components/Breadcrumb';\nimport Hamburger from '@/components/Hamburger';\nimport ErrorLog from '@/components/ErrorLog';\nimport Screenfull from '@/components/Screenfull';\nimport SizeSelect from '@/components/SizeSelect';\nimport Search from '@/components/HeaderSearch';\nimport Cookies from 'js-cookie';\nimport ChangePass from \"./Settings/changePass.vue\";\nimport * as NoticeAPI from \"@/api/notice.js\";\nimport { NOTICE_STYLE_KEY } from \"@/const/notice\";\nexport default {\n  components: {\n    Breadcrumb: Breadcrumb,\n    Hamburger: Hamburger,\n    ErrorLog: ErrorLog,\n    Screenfull: Screenfull,\n    SizeSelect: SizeSelect,\n    Search: Search,\n    ChangePass: ChangePass\n  },\n  computed: _objectSpread({}, mapGetters(['sidebar', 'avatar', 'device'])),\n  data: function data() {\n    return {\n      name: '',\n      noticeList: [],\n      noticeTimer: null,\n      noticePage: 1,\n      noticeLimit: 10,\n      getStatus: false,\n      noMoreStatus: false,\n      newNotceCount: 0,\n      newNoticeMap: {}\n    };\n  },\n  created: function created() {\n    var name = Cookies.get('NAME');\n    console.log(\"name:\", name);\n    if (name) {\n      this.name = name;\n    }\n    this.getNewNotice();\n    this.startNoticeTimer();\n  },\n  destroyed: function destroyed() {\n    this.clearNoticeTimer();\n  },\n  methods: {\n    toggleSideBar: function toggleSideBar() {\n      this.$store.dispatch('app/toggleSideBar');\n    },\n    logout: function () {\n      var _logout = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n        return _regeneratorRuntime().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              _context.next = 2;\n              return this.$store.dispatch('user/logout');\n            case 2:\n              this.$router.push(\"/login?redirect=\".concat(this.$route.fullPath));\n            case 3:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function logout() {\n        return _logout.apply(this, arguments);\n      }\n      return logout;\n    }(),\n    startNoticeTimer: function startNoticeTimer() {\n      var _this = this;\n      this.clearNoticeTimer();\n      window.setTimeout(function () {\n        _this.getNewNotice();\n      }, 60000);\n    },\n    clearNoticeTimer: function clearNoticeTimer() {\n      if (this.noticeTimer) {\n        window.clearTimeout(this.noticeTimer);\n        this.noticeTimer = null;\n      }\n    },\n    getNewNotice: function () {\n      var _getNewNotice = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n        var _this2 = this;\n        var response, result, noticeList;\n        return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n          while (1) switch (_context2.prev = _context2.next) {\n            case 0:\n              _context2.next = 2;\n              return NoticeAPI.getNewNotice();\n            case 2:\n              response = _context2.sent;\n              result = response.result;\n              noticeList = result.noticeList;\n              this.newNotceCount = noticeList ? noticeList.length : 0;\n              if (noticeList && noticeList.length > 0) {\n                noticeList.map(function (v) {\n                  var noticeItem = _this2.$notify({\n                    title: v.title,\n                    message: v.content,\n                    duration: 0,\n                    type: v.color_style,\n                    onClick: function onClick(e) {\n                      if (_this2.newNoticeMap[v._id] && _this2.newNoticeMap[v._id] != undefined) {\n                        _this2.newNoticeMap[v._id].close();\n                      }\n                      _this2.gotoByNotice(v);\n                    }\n                  });\n                  _this2.newNoticeMap[v._id] = noticeItem;\n                });\n              }\n            case 7:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, this);\n      }));\n      function getNewNotice() {\n        return _getNewNotice.apply(this, arguments);\n      }\n      return getNewNotice;\n    }(),\n    getNoticeList: function () {\n      var _getNoticeList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n        var params, response, __error, msg, result, noticeList, list;\n        return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n          while (1) switch (_context3.prev = _context3.next) {\n            case 0:\n              if (!this.noMoreStatus) {\n                _context3.next = 2;\n                break;\n              }\n              return _context3.abrupt(\"return\");\n            case 2:\n              if (!this.getStatus) {\n                _context3.next = 4;\n                break;\n              }\n              return _context3.abrupt(\"return\");\n            case 4:\n              params = {\n                page: this.noticePage,\n                limit: this.noticeLimit\n              };\n              this.getStatus = true;\n              _context3.next = 8;\n              return NoticeAPI.list(params);\n            case 8:\n              response = _context3.sent;\n              __error = response.__error, msg = response.msg, result = response.result;\n              if (__error == 0) {\n                this.noticePage += 1;\n                noticeList = result.noticeList;\n                if (noticeList && noticeList.length > 0) {\n                  list = this.noticeList;\n                  list = list.concat(noticeList);\n                  this.noticeList = [];\n                  this.noticeList = list;\n                } else {\n                  this.noMoreStatus = true;\n                }\n              }\n              this.getStatus = false;\n            case 12:\n            case \"end\":\n              return _context3.stop();\n          }\n        }, _callee3, this);\n      }));\n      function getNoticeList() {\n        return _getNoticeList.apply(this, arguments);\n      }\n      return getNoticeList;\n    }(),\n    handleClickChange: function handleClickChange(visible) {\n      if (visible) {\n        this.newNotceCount = 0;\n        this.noticePage = 1;\n        this.noticeList = [];\n        this.noMoreStatus = false;\n        this.getStatus = false;\n        this.getNoticeList();\n      }\n    },\n    changePass: function changePass() {\n      this.$refs.changePass.init();\n    },\n    gotoByNotice: function gotoByNotice(item) {\n      switch (item.style) {\n        case NOTICE_STYLE_KEY.dealer_assessment:\n          {\n            this.$router.push({\n              'path': '/assessment/review'\n            });\n            break;\n          }\n        case NOTICE_STYLE_KEY.dealer_report:\n          {\n            this.$router.push({\n              'path': '/report/report_center'\n            });\n            break;\n          }\n        case NOTICE_STYLE_KEY.admin_review:\n          {\n            this.$router.push({\n              'path': '/dealer/apply'\n            });\n            break;\n          }\n        case NOTICE_STYLE_KEY.admin_complaint:\n          {\n            this.$router.push({\n              'path': '/dealer/complain'\n            });\n            break;\n          }\n        case NOTICE_STYLE_KEY.admin_comment:\n          {\n            this.$router.push({\n              'path': '/dealer_platform_info/comment'\n            });\n            break;\n          }\n        case NOTICE_STYLE_KEY.admin_dealer_apply:\n          {\n            this.$router.push({\n              'path': '/dealer/apply'\n            });\n            break;\n          }\n      }\n    },\n    noticeScroll: function noticeScroll(e) {\n      var scrollHeight = this.$refs.noticeListRef.scrollHeight;\n      var scrollTop = this.$refs.noticeListRef.scrollTop;\n      if (scrollTop + 300 > scrollHeight) {\n        this.getNoticeList();\n      }\n    }\n  }\n};",null]}