Files
tekelanew_acs/acs/nladmin-ui/node_modules/.cache/babel-loader/d1fd9ffde34d91f037cd45145d22d804.json
2024-12-05 09:33:18 +08:00

1 line
6.0 KiB
JSON

{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\components\\TopNav\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\components\\TopNav\\index.vue","mtime":1732871026484},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\babel.config.js","mtime":1732871025888},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nrequire(\"core-js/modules/es6.regexp.replace\");\nrequire(\"core-js/modules/web.dom.iterable\");\nrequire(\"core-js/modules/es6.object.keys\");\nvar _routers = require(\"@/router/routers\");\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//\nvar _default = exports.default = {\n data: function data() {\n return {\n // 顶部栏初始数\n visibleNumber: 5,\n // 是否为首次加载\n isFrist: false,\n // 当前激活菜单的 index\n currentIndex: undefined\n };\n },\n computed: {\n theme: function theme() {\n return this.$store.state.settings.theme;\n },\n // 顶部显示菜单\n topMenus: function topMenus() {\n var topMenus = [];\n this.routers.map(function (menu) {\n if (menu.hidden !== true) {\n // 兼容顶部栏一级菜单内部跳转\n if (menu.path === '/') {\n topMenus.push(menu.children[0]);\n } else {\n topMenus.push(menu);\n }\n }\n });\n return topMenus;\n },\n // 所有的路由信息\n routers: function routers() {\n return this.$store.state.permission.topbarRouters;\n },\n // 设置子路由\n childrenMenus: function childrenMenus() {\n var _this = this;\n var childrenMenus = [];\n this.routers.map(function (router) {\n for (var item in router.children) {\n if (router.children[item].parentPath === undefined) {\n if (router.path === '/') {\n router.children[item].path = '/redirect/' + router.children[item].path;\n } else {\n if (!_this.ishttp(router.children[item].path)) {\n router.children[item].path = router.path + '/' + router.children[item].path;\n }\n }\n router.children[item].parentPath = router.path;\n }\n childrenMenus.push(router.children[item]);\n }\n });\n return _routers.constantRouterMap.concat(childrenMenus);\n },\n // 默认激活的菜单\n activeMenu: function activeMenu() {\n var path = this.$route.path;\n var activePath = this.defaultRouter();\n if (path.lastIndexOf('/') > 0) {\n var tmpPath = path.substring(1, path.length);\n activePath = '/' + tmpPath.substring(0, tmpPath.indexOf('/'));\n } else if (path === '/index' || path === '') {\n if (!this.isFrist) {\n this.$set(this, 'isFrist', true);\n } else {\n activePath = 'index';\n }\n }\n var routes = this.activeRoutes(activePath);\n if (routes.length === 0) {\n activePath = this.currentIndex || this.defaultRouter();\n this.activeRoutes(activePath);\n }\n return activePath;\n }\n },\n beforeMount: function beforeMount() {\n window.addEventListener('resize', this.setVisibleNumber);\n },\n beforeDestroy: function beforeDestroy() {\n window.removeEventListener('resize', this.setVisibleNumber);\n },\n mounted: function mounted() {\n this.setVisibleNumber();\n },\n methods: {\n // 根据宽度计算设置显示栏数\n setVisibleNumber: function setVisibleNumber() {\n var width = document.body.getBoundingClientRect().width / 3;\n this.visibleNumber = parseInt(width / 85);\n },\n // 默认激活的路由\n defaultRouter: function defaultRouter() {\n var _this2 = this;\n var router;\n Object.keys(this.routers).some(function (key) {\n if (!_this2.routers[key].hidden) {\n router = _this2.routers[key].path;\n return true;\n }\n });\n return router;\n },\n // 菜单选择事件\n handleSelect: function handleSelect(key, keyPath) {\n this.currentIndex = key;\n if (this.ishttp(key)) {\n // http(s):// 路径新窗口打开\n window.open(key, '_blank');\n } else if (key.indexOf('/redirect') !== -1) {\n // /redirect 路径内部打开\n this.$router.push({\n path: key.replace('/redirect', '')\n });\n } else {\n // 显示左侧联动菜单\n this.activeRoutes(key);\n }\n },\n // 当前激活的路由\n activeRoutes: function activeRoutes(key) {\n var routes = [];\n if (this.childrenMenus && this.childrenMenus.length > 0) {\n this.childrenMenus.map(function (item) {\n if (key === item.parentPath || key === 'index' && item.path === '') {\n routes.push(item);\n }\n });\n }\n if (routes.length > 0) {\n this.$store.commit('SET_SIDEBAR_ROUTERS', routes);\n }\n return routes;\n },\n ishttp: function ishttp(url) {\n return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1;\n }\n }\n};",null]}