forked from zhurui/management
1 line
8.4 KiB
JSON
1 line
8.4 KiB
JSON
|
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\main.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\main.vue","mtime":1620711691794},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport MainNavbar from './main-navbar'\nimport MainSidebar from './main-sidebar'\nimport MainContent from './main-content'\nimport MainThemeTools from './main-theme-tools'\nimport debounce from 'lodash/debounce'\nexport default {\n provide () {\n return {\n // 刷新\n refresh () {\n this.$store.state.contentIsNeedRefresh = true\n this.$nextTick(() => {\n this.$store.state.contentIsNeedRefresh = false\n })\n }\n }\n },\n data () {\n return {\n loading: true\n }\n },\n components: {\n MainNavbar,\n MainSidebar,\n MainContent,\n MainThemeTools\n },\n watch: {\n $route: 'routeHandle'\n },\n created () {\n this.windowResizeHandle()\n this.routeHandle(this.$route)\n Promise.all([\n this.getUserInfo(),\n this.getPermissions()\n ]).then(() => {\n this.loading = false\n })\n },\n methods: {\n // 窗口改变大小\n windowResizeHandle () {\n this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false\n window.addEventListener('resize', debounce(() => {\n this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false\n }, 150))\n },\n // 路由, 监听\n routeHandle (route) {\n if (!route.meta.isTab) {\n return false\n }\n var tab = this.$store.state.contentTabs.filter(item => item.name === route.name)[0]\n if (!tab) {\n tab = {\n ...window.SITE_CONFIG['contentTabDefault'],\n ...route.meta,\n 'name': route.name,\n 'params': { ...route.params },\n 'query': { ...route.query }\n }\n this.$store.state.contentTabs = this.$store.state.contentTabs.concat(tab)\n }\n this.$store.state.sidebarMenuActiveName = tab.menuId\n this.$store.state.contentTabsActiveName = tab.name\n },\n // 获取当前管理员信息\n getUserInfo () {\n return this.$http.get('/sys/user/info').then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n // console.log(\"/sys/user/info\")\n // console.log(res)\n this.$store.state.user.id = res.data.id\n this.$store.state.user.name = res.data.username\n this.$store.state.user.realName = res.data.realName\n this.$store.state.user.superAdmin = res.data.superAdmin \n this.$store.state.user.roleNames = res.data.roleNames\n\n this.$store.state.user.email = res.data.email\n this.$store.state.user.deptId = res.data.deptId\n // this.$store.state.user.deptName = res.data.deptName\n this.$store.state.user.mobile = res.data.mobile\n this.$store.state.user.username = res.data.username\n\n this.$store.state.user.roles = res.data.roleNames?res.data.roleNames.split(\",\"):[];\n }).catch(() => {})\n },\n // 获取权限\n getPermissions () {\n return this.$http.get('/sys/menu/permissions').then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.ms
|