EMS2.0-Documents/7.部署文档/Linux安装/项目前端文件/IEMS/js/chunk-c095d836.55025a0e.js

2 lines
4.7 KiB
JavaScript
Raw Normal View History

2024-11-28 09:29:02 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c095d836"],{"1a47":function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"tags-view-container"},[i("i",{staticClass:"iconfont icon-xiangqian icon"}),i("i",{staticClass:"iconfont icon-xianghou icon after"}),i("div",{ref:"isOverflow",staticClass:"container"},e._l(e.visitedViews,(function(t){return i("div",{key:t.path,staticClass:"tags-view-item",class:e.isActive(t)?"active":"",on:{click:function(i){return e.goLink(t)},contextmenu:function(i){return i.preventDefault(),i.stopPropagation(),e.openMenu(t,i)}}},[i("span",{staticClass:"tag isOverflow",class:{affix:t.meta.affix}},[i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.$t("home."+t.meta.name),placement:"top"}},[i("span",[e._v(e._s(e.$t("home."+t.meta.name)))])])],1),i("i",{staticClass:"iconfont icon-guanbi close",class:{noshow:t.meta.affix},on:{click:function(i){return i.preventDefault(),i.stopPropagation(),e.closeSelectedTag(t)}}})])})),0),i("ul",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"contextmenu",style:{left:e.left+"px",top:e.top+"px"}},[i("li",{on:{click:function(t){return e.refreshSelectedTag(e.selectedTag)}}},[e._v(e._s(e.$t("home.refresh")))]),e.selectedTag.meta&&e.selectedTag.meta.affix?e._e():i("li",{on:{click:function(t){return e.closeSelectedTag(e.selectedTag)}}},[e._v(" "+e._s(e.$t("home.close"))+" ")]),i("li",{on:{click:e.closeOthersTags}},[e._v(" "+e._s(e.$t("home.closeOthers"))+" ")]),i("li",{on:{click:function(t){return e.closeAllTags(e.selectedTag)}}},[e._v(e._s(e.$t("home.closeAll")))])])])},n=[],a=i("b85c"),o=i("2909"),c=i("5530"),l=(i("d3b7"),i("159b"),i("b0c0"),i("99af"),i("ac1f"),i("5319"),i("fb6a"),i("df7c")),r=i.n(l),f={name:"TagsView",data:function(){return{visible:!1,top:0,left:0,selectedTag:{},affixTags:[],isOverflow:!1}},computed:{visitedViews:function(){return console.log(this.$store.state.tagsView.visitedViews),this.$store.state.tagsView.visitedViews},routes:function(){return this.$store.state.permission.routes}},watch:{$route:function(){this.addTags()},visible:function(e){e?document.body.addEventListener("click",this.closeMenu):document.body.removeEventListener("click",this.closeMenu)}},mounted:function(){var e=this;this.initTags(),this.addTags(),this.$nextTick((function(){e.isOverflow=e.checkEllipsis(e.$refs.isOverflow.firstElementChild.firstElementChild.firstElementChild)}))},beforeRouteLeave:function(){},methods:{checkEllipsis:function(e){return console.log(e),e.offsetWidth>=85},isActive:function(e){return r.a.resolve(e.path)===r.a.resolve(this.$route.path)},filterAffixTags:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",s=[];return e.forEach((function(e){if(e.meta&&e.meta.affix){var n=r.a.resolve(i,e.path),a="admin"==t.$route.matched[0].meta.name,l="manager"==t.$route.matched[0].meta.name;e.meta.isAdmin&&a?s.push({fullPath:n,path:n,name:e.name,meta:Object(c["a"])({},e.meta)}):e.meta.isAdmin||a||l||s.push({fullPath:n,path:n,name:e.name,meta:Object(c["a"])({},e.meta)})}else if(e.children){var f=t.filterAffixTags(e.children,e.path);f.length>=1&&(s=[].concat(Object(o["a"])(s),Object(o["a"])(f)))}})),s},initTags:function(){console.log("------------1-------------");var e,t=this.affixTags=this.filterAffixTags(this.routes),i=Object(a["a"])(t);try{for(i.s();!(e=i.n()).done;){var s=e.value;s.name&&this.$store.dispatch("addVisitedView",s)}}catch(n){i.e(n)}finally{i.f()}},addTags:function(){var e=this.$route.name;return e&&this.$store.dispatch("addView",this.$route),!1},refreshSelectedTag:function(e){var t=this;this.$store.dispatch("delCachedView",e).then((function(){var i=e.fullPath;console.log(i),t.$nextTick((function(){t.$router.replace({path:i})}))}))},closeSelectedTag:function(e){var t=this;this.$store.dispatch("delView",e).then((function(i){var s=i.visitedViews;t.isActive(e)&&t.toLastView(s)}))},closeOthersTags:function(){this.$router.push(this.selectedTag),this.$store.dispatch("delOthersViews",this
//# sourceMappingURL=chunk-c095d836.55025a0e.js.map