| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-48a77c7f"],{"573e":function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"scope-process"},[e("cl-scroll",t._l(t.processList,(function(s,i){return e("div",{key:i,staticClass:"block",class:{active:s.active},attrs:{"data-index":i},on:{mousedown:e=>{t.onTap(e,s)}}},[e("span",[t._v(t._s(s.label))]),i>0?e("i",{staticClass:"el-icon-close",class:{active:i>0},on:{mousedown:function(e){return e.stopPropagation(),t.onDel(i)}}}):t._e()])})),0),e("ul",{directives:[{name:"show",rawName:"v-show",value:t.menu.visible,expression:"menu.visible"}],staticClass:"context-menu",style:t.menu.style},[t.isHit?e("li",{on:{click:function(e){return t.onClose("current")}}},[t._v("关闭当前")]):t._e(),e("li",{on:{click:function(e){return t.onClose("other")}}},[t._v("关闭其他")]),e("li",{on:{click:function(e){return t.onClose("all")}}},[t._v("关闭所有")])])],1)},n=[],c=(s("f16c"),s("45d2"),s("4e1c"),s("951a"),s("5880")),o={data(){return{menu:{visible:!1,current:{},style:{left:0,top:0}},isHit:!1,page:1}},computed:{...Object(c["mapGetters"])(["processList"])},watch:{processList(){let t=this.$el.clientWidth;this.$nextTick(()=>{let e=this.$el.querySelectorAll(".block")||[],s=0;for(let t=0;t<e.length;t++)s+=e[t].clientWidth;t-s>1e3&&(this.page+=1)})}},mounted(){this.$el.oncontextmenu=()=>{event.returnValue=!1},document.body.addEventListener("click",()=>{this.menu.visible&&(this.menu.visible=!1)})},methods:{...Object(c["mapMutations"])(["ADD_PROCESS","DEL_PROCESS","SET_PROCESS"]),onTap(t,e){this.isHit=e.active,0==t.button?this.$router.push(e.value):this.menu={current:e,visible:!0,style:{left:t.layerX+"px",top:t.layerY+"px"}}},onDel(t){this.DEL_PROCESS(t),this.toPath()},onClose(t){const{current:e}=this.menu;switch(t){case"current":this.onDel(this.processList.findIndex(t=>t.value==e.value));break;case"other":this.SET_PROCESS(this.processList.filter(t=>t.value==e.value||"/"==t.value));break;case"all":this.SET_PROCESS(this.processList.filter(t=>"/"==t.value));break}this.toPath()},toPath(){const t=this.processList.find(t=>t.active);if(!t){const t=this.processList[this.processList.length-1];this.$router.push(t?t.value:"/")}}}},l=o,a=(s("c209"),s("1805")),r=Object(a["a"])(l,i,n,!1,null,"64c63b5a",null);e["default"]=r.exports},6811:function(t,e,s){},c209:function(t,e,s){"use strict";s("6811")}}]);
|