1 line
7.5 KiB
JSON
1 line
7.5 KiB
JSON
|
|
{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\layout\\components\\TagsView\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\layout\\components\\TagsView\\index.vue","mtime":1732871026540},{"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":["//\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\r\nimport ScrollPane from './ScrollPane'\r\nimport path from 'path'\r\n\r\nexport default {\r\n components: { ScrollPane },\r\n data() {\r\n return {\r\n visible: false,\r\n top: 0,\r\n left: 0,\r\n selectedTag: {},\r\n affixTags: []\r\n }\r\n },\r\n computed: {\r\n visitedViews() {\r\n return this.$store.state.tagsView.visitedViews\r\n },\r\n routes() {\r\n return this.$store.state.permission.routers\r\n }\r\n },\r\n watch: {\r\n $route() {\r\n this.addTags()\r\n this.moveToCurrentTag()\r\n },\r\n visible(value) {\r\n if (value) {\r\n document.body.addEventListener('click', this.closeMenu)\r\n } else {\r\n document.body.removeEventListener('click', this.closeMenu)\r\n }\r\n }\r\n },\r\n mounted() {\r\n this.initTags()\r\n this.addTags()\r\n },\r\n methods: {\r\n isActive(route) {\r\n return route.path === this.$route.path\r\n },\r\n filterAffixTags(routes, basePath = '/') {\r\n let tags = []\r\n routes.forEach(route => {\r\n if (route.meta && route.meta.affix) {\r\n const tagPath = path.resolve(basePath, route.path)\r\n tags.push({\r\n fullPath: tagPath,\r\n path: tagPath,\r\n name: route.name,\r\n meta: { ...route.meta }\r\n })\r\n }\r\n if (route.children) {\r\n const tempTags = this.filterAffixTags(route.children, route.path)\r\n if (tempTags.length >= 1) {\r\n tags = [...tags, ...tempTags]\r\n }\r\n }\r\n })\r\n return tags\r\n },\r\n initTags() {\r\n const affixTags = this.affixTags = this.filterAffixTags(this.routes)\r\n for (const tag of affixTags) {\r\n // Must have tag name\r\n if (tag.name) {\r\n this.$store.dispatch('tagsView/addVisitedView', tag)\r\n }\r\n }\r\n },\r\n addTags() {\r\n const { name } = this.$route\r\n if (name) {\r\n this.$store.dispatch('tagsView/addView', this.$route)\r\n }\r\n return false\r\n },\r\n moveToCurrentTag() {\r\n const tags = this.$refs.tag\r\n this.$nextTick(() => {\r\n for (const tag of tags) {\r\n if (tag.to.path === this.$route.path) {\r\n this.$refs.scrollPane.moveToTarget(tag)\r\n // when query is different then update\r\n if (tag.to.fullPath !== this.$route.fullPath) {\r\n this.$store.dispatch('tagsView/updateVisitedView', this.$route)\r\n }\r\n break\r\n }\r\n }\r\n })\r\n },\r\n refreshSelectedTag(view) {\r\n this.$store.dispatch('tagsView/delCachedView', view).then(() => {\r\n const { fullPath } = view\r\n this.$nextTick(() => {\r\n this.$router.replace({\r\n path: '/redirect' + fullPath\r\n })\r\n })\r\n })\r\n },\r\n closeSelectedTag(view) {\r\n // console.log(view)\r\n this.$store.dispatch('tagsView/delView', view).then(
|