import{d as y,h as v,t as b,c as L,j as S,k as V,a1 as E,l as I,o as n,b as B,y as M,w as j,v as $,u as s,a as c,e as i,Y as d,Z as O,x as W,q as D,K as N,n as u,T as R,_ as T}from"./index.4042ed24.js";const z={class:"el-dropdown-menu"},A=["onClick"],F=y({__name:"contextmenu",props:{dropdown:{type:Object,default:()=>({x:0,y:0})}},emits:["currentContextmenuClick"],setup(m,{expose:p,emit:f}){const o=m,t=v({isShow:!1,dropdownList:[{contextMenuClickId:0,txt:"message.tagsView.refresh",affix:!1,icon:"ele-RefreshRight"},{contextMenuClickId:1,txt:"message.tagsView.close",affix:!1,icon:"ele-Close"},{contextMenuClickId:2,txt:"message.tagsView.closeOther",affix:!1,icon:"ele-CircleClose"},{contextMenuClickId:3,txt:"message.tagsView.closeAll",affix:!1,icon:"ele-FolderDelete"},{contextMenuClickId:4,txt:"message.tagsView.fullscreen",affix:!1,icon:"iconfont icon-fullscreen"}],item:{},arrowLeft:10}),{isShow:x,dropdownList:w,arrowLeft:_}=b(t);p({openContextmenu:e=>{console.log(e),t.item=e,e.meta.isAffix?t.dropdownList[1].affix=!0:t.dropdownList[1].affix=!1,l(),setTimeout(()=>{t.isShow=!0},10)}});const l=()=>{t.isShow=!1},r=L(()=>(console.log(o.dropdown),o.dropdown.x+117>document.documentElement.clientWidth?{x:document.documentElement.clientWidth-117-5,y:o.dropdown.y}:o.dropdown)),g=e=>{debugger;console.log(t.item),console.log(e),console.log(Object.assign({},{contextMenuClickId:e},t.item)),f("currentContextmenuClick",Object.assign({},{contextMenuClickId:e},t.item))};return S(()=>{document.body.addEventListener("click",l)}),V(()=>{document.body.removeEventListener("click",l)}),E(()=>o.dropdown,({x:e,y:h})=>{e+117>document.documentElement.clientWidth?t.arrowLeft=117-(document.documentElement.clientWidth-e):t.arrowLeft=10},{deep:!0}),(e,h)=>{const C=I("SvgIcon");return n(),B(R,{name:"el-zoom-in-center",persisted:""},{default:M(()=>[j((n(),c("div",{"aria-hidden":"true",class:"el-dropdown__popper el-popper is-light is-pure custom-contextmenu",role:"tooltip","data-popper-placement":"bottom",style:u(`top: ${s(r).y+5}px;left: ${s(r).x}px;`),key:Math.random()},[i("ul",z,[(n(!0),c(d,null,O(s(w),(a,k)=>(n(),c(d,null,[a.affix?N("v-if",!0):(n(),c("li",{class:"el-dropdown-menu__item","aria-disabled":"false",tabindex:"-1",key:k,onClick:K=>g(a.contextMenuClickId)},[W(C,{name:a.icon},null,8,["name"]),i("span",null,D(e.$t(a.txt)),1)],8,A))],64))),256))]),i("div",{class:"el-popper__arrow",style:u({left:`${s(_)}px`})},null,4)],4)),[[$,s(x)]])]),_:1})}}});const Y=T(F,[["__scopeId","data-v-8a79e008"],["__file","/data/jenkins/workspace/badp-bcxin-web-5.x-dispatchBusiness/src/layout/navBars/tagsView/contextmenu.vue"]]);export{Y as default};
