2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
import{_ as g,o as s,c as r,F as w,D as v,Y as _,t as x,z as b,H as C,g as k,h as p,l as S,r as d,j as E,w as h,b as f,e as F}from"./index.df7b46f6.js";const N={props:{data:{type:Array,default:()=>[]},left:{type:Number,default:0},type:{type:Number,default:1},dataInfo:{type:Object,default:()=>{}},top:{type:Number,default:0},isViewInfo:{type:Boolean,default:!0}},watch:{left:{handler(e,t){e&&(this.isShow=!0)}}},computed:{style(){let e=document.body.clientHeight,t=this.top;return e-t<100?`left:${this.left}px;bottom:${e-t}px`:`left:${this.left}px;top:${this.top}px`}},data(){return{isShow:!1}},methods:{operatingRightAction(e,t){this.$emit("ok",e,t),this.isShow=!1}},mounted(){let e=this;window.addEventListener("click",function(){e.isShow=!1}),window.addEventListener("mousedown",function(t){t.which===3&&(e.isShow=!1)})}};const $=["onClick"];function A(e,t,a,c,i,l){return i.isShow?(s(),r("div",{key:0,class:"g-right-click-menu",style:b(l.style),ref:"rightMenu"},[(s(!0),r(w,null,v(a.data,(u,o)=>(s(),r("div",{key:o,class:"operating",onClick:_(n=>l.operatingRightAction(n,u),["stop"])},x(u.label),9,$))),128))],4)):C("",!0)}const D=g(N,[["render",A],["__scopeId","data-v-f9c1d2d8"]]),R=k({__name:"index",setup(e){const t=p(0),a=p(0),c=[{label:"\u6253\u5370",value:1,path:"/other/print"},{label:"\u5934\u50CF\u88C1\u526A",value:2,path:"/other/cropper"},{label:"\u5361\u7247\u62D6\u62FD",value:3,path:"/other/grid-sorter"},{label:"\u5206\u5272\u6A21\u5757",value:4,path:"/other/splitpane"},{label:"\u751F\u6210\u4E8C\u7EF4\u7801",value:5,path:"/other/qrcode"}],i=o=>{t.value=o.clientX,a.value=o.clientY},l=S(),u=(o,n)=>{console.log("\u83B7\u53D6\u6570\u636E",n),l.push({path:n.path})};return(o,n)=>{const m=d("el-button"),y=d("u-container-layout");return s(),E(y,{style:{"min-height":"300px"}},{default:h(()=>[f(m,{onContextmenu:_(i,["prevent"]),style:{width:"200px"}},{default:h(()=>[F("\u53F3\u952E\u83DC\u5355")]),_:1},8,["onContextmenu"]),f(D,{left:t.value,top:a.value,onOk:u,data:c},null,8,["left","top"])]),_:1})}}});export{R as default};
|