{"remainingRequest":"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\\Tags.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\components\\common\\Tags.vue","mtime":1663828782923},{"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":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nconst detaillist = ['/viewDetail', '/installplanView'];\r\nexport default {\r\n data() {\r\n return {\r\n // tagsList: []\r\n };\r\n },\r\n methods: {\r\n // 点击标签页\r\n isActive(path) {\r\n if (path instanceof Object) {\r\n let fullpath = this.setFullPath(path);\r\n return fullpath === this.$route.fullPath;\r\n }\r\n return path === this.$route.fullPath;\r\n },\r\n // 关闭单个标签\r\n closeTags(index) {\r\n if (this.tagsList.length > 1) {\r\n const delItem = this.tagsList.splice(index, 1)[0];\r\n const item = this.tagsList[index] ? this.tagsList[index] : this.tagsList[index - 1];\r\n if (item) {\r\n if (detaillist.includes(delItem.path.path)) {\r\n let delfullpath = this.setFullPath(delItem.path);\r\n delfullpath === this.$route.fullPath && this.$router.push(item.path);\r\n } else {\r\n delItem.path === this.$route.fullPath && this.$router.push(item.path);\r\n }\r\n }\r\n }\r\n },\r\n // 关闭其他标签\r\n closeOther() {\r\n const curItem = this.tagsList.filter((item) => {\r\n if (detaillist.includes(this.$route.path)) {\r\n let fullpath = item.path instanceof Object ? this.setFullPath(item.path) : item.path;\r\n return fullpath === this.$route.fullPath;\r\n }\r\n return item.path === this.$route.fullPath;\r\n });\r\n this.tagsList.splice(0, this.tagsList.length);\r\n this.$store.dispatch('tags', curItem.concat());\r\n },\r\n setFullPath(item) {\r\n let itemfullpath = '';\r\n if (JSON.stringify(item) != '{}') {\r\n itemfullpath = item.path + '?';\r\n _.mapKeys(item.query, (val, key) => {\r\n if (!_.isEmpty(String(val)) && val) {\r\n if (key == 'planName') {\r\n val = encodeURI(val);\r\n }\r\n itemfullpath += `${key}=${val}&`;\r\n }\r\n });\r\n if (itemfullpath.substr(itemfullpath.length - 1, 1) == '&') {\r\n itemfullpath = itemfullpath.slice(0, itemfullpath.length - 1);\r\n }\r\n }\r\n return itemfullpath;\r\n },\r\n // 设置标签\r\n setTags(route) {\r\n let tagArr = {\r\n title: route.title || route.meta.title,\r\n path: route.fullPath\r\n };\r\n if (!!route.name) {\r\n tagArr = {\r\n title: route.title || route.meta.title,\r\n path: route.fullPath,\r\n name: route.name\r\n };\r\n }\r\n\r\n const isExist = this.tagsList.some((item, index) => {\r\n let thisBi = item.path.indexOf(route.path) > -1;\r\n if (thisBi) {\r\n this.tagsList.splice(index, 1, tagArr);\r\n\r\n this.$store.dispatch('tags', this.tagsList);\r\n }\r\n return thisBi;\r\n });\r\n if (!isExist) {\r\n if (route.path === '/') {\r\n return;\r\n }\r\n if (this.tagsList.length >= 8) {\r\n this.tagsList.shift();\r\n }\r\n this.tagsList.push(tagArr);\r\n this.$store.dispatch('tags', this.tagsList);\r\n }\r\n }\r\n },\r\n computed: {\r\n showTags() {\r\n return this.tagsList.length > 0;\r\n },\r\n tagsList() {\r\n return this.$store.getters['getTagsList'];\r\n }\r\n },\r\n watch: {\r\n $route(newValue, oldValue) {\r\n this.setTags(newValue);\r\n }\r\n },\r\n created() {\r\n this.setTags(this.$route);\r\n }\r\n};\r\n",{"version":3,"sources":["Tags.vue"],"names":[],"mappings":";;;;;;;;;;;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"Tags.vue","sourceRoot":"src/components/common","sourcesContent":["\r\n \r\n\r\n\r\n\r\n"]}]}