index.0ba9c120.js 2.0 KB

12
  1. import{L as p,i as h,a2 as k,m as C,l as S,a1 as b,al as g,o as s,S as I,T as E,U as L,_ as M,a,b as r,F as B,ac as $,P as j,$ as z,aE as D,aF as F,Z as T,Y as l}from"./vue.e1d8f8c6.js";import{_ as N}from"./index.6661bcf9.js";const O=t=>(D("data-v-e5e2cc90"),t=t(),F(),t),R={class:"el-dropdown-menu"},U=["onClick"],V=O(()=>r("div",{class:"el-popper__arrow",style:{left:"10px"}},null,-1)),P=p({name:"pagesWorkflowContextmenu"}),W=p({...P,props:{dropdown:{type:Object,default:()=>({x:"",y:""})}},emits:["current"],setup(t,{expose:u,emit:m}){const _=t,x=h(),e=k({isShow:!1,dropdownList:[{contextMenuClickId:0,txt:"删除",icon:"ele-Delete"},{contextMenuClickId:1,txt:"编辑",icon:"ele-Edit"}],item:{type:"node"},conn:{}}),i=C(()=>_.dropdown),w=n=>{m("current",Object.assign({},{contextMenuClickId:n},e.item),e.conn)},f=(n,d={})=>{e.item=n,e.conn=d,o(),setTimeout(()=>{e.isShow=!0},10)},o=()=>{e.isShow=!1};return S(()=>{document.body.addEventListener("click",o),document.body.addEventListener("contextmenu",o)}),b(()=>{document.body.removeEventListener("click",o),document.body.removeEventListener("contextmenu",o)}),u({openContextmenu:f}),(n,d)=>{const v=g("SvgIcon");return s(),I(z,{name:"el-zoom-in-center",ref_key:"contextmenuRef",ref:x,persisted:""},{default:E(()=>[L((s(),a("div",{"aria-hidden":"true",class:"el-dropdown__popper el-popper is-light is-pure custom-contextmenu",role:"tooltip","data-popper-placement":"bottom",style:j(`top: ${i.value.y+5}px;left: ${i.value.x}px;`),key:Math.random()},[r("ul",R,[(s(!0),a(B,null,$(e.dropdownList,(c,y)=>(s(),a("li",{class:"el-dropdown-menu__item","aria-disabled":"false",tabindex:"-1",key:y,onClick:Y=>w(c.contextMenuClickId)},[T(v,{name:c.icon},null,8,["name"]),r("span",null,l(c.txt)+l(e.item.type==="line"?"线":"节点"),1)],8,U))),128))]),V],4)),[[M,e.isShow]])]),_:1},512)}}});const A=N(W,[["__scopeId","data-v-e5e2cc90"],["__file","E:/code/wwwroot/local81.lzj/simple_storage/vue-next-admin/src/views/pages/workflow/component/contextmenu/index.vue"]]);export{A as default};