2 lines
8.7 KiB
JavaScript
2 lines
8.7 KiB
JavaScript
|
import{d as K,q as ne,r as I,n as ie,h as X,c as Y,a as u,b as Q,u as r,i as E,t as V,N as v,e as w,w as L,x as j,R as Z,F,G as P,B as R,a5 as N,a4 as q,E as ae,X as ee,Y as te,aa as fe,p as ce,g as pe,_ as de,y as G,z as J}from"./index-4dcc0234.js";/* empty css *//* empty css */import"./el-form-item-4ed993c7.js";import{_ as re}from"./index.vue_vue_type_script_setup_true_lang-9285296e.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_lang-a631d3b2.js";/* empty css */import{_ as me}from"./index-742b412a.js";import{u as he}from"./diy-06b37a1b.js";const _e=W=>(ce("data-v-21029794"),W=W(),pe(),W),ge={key:0},ve={class:"text-primary p-[4px]"},xe={key:1},be={class:"flex"},ye=["id","onMousedown"],we=_e(()=>u("span",{class:"p-[4px]"},"|",-1)),ke=["onMousedown"],Te=["onMousedown"],Ce=["onMousedown"],Me=["onMousedown"],Ve={class:"mb-[10px] text-lg text-black"},He={class:"overflow-y-auto h-[300px]"},Xe={key:0,class:"mb-[16px]"},Ye={class:"flex items-center"},Le={class:"dialog-footer"},Se=K({__name:"index",props:{modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(W,{expose:z,emit:b}){const O=W,S=ne({get(){return O.modelValue},set(x){b("update:modelValue",x)}}),_=I(!1),m=I(400),T=I(400),$=I(4),p=ie([]),U=()=>{let x=p.length%$.value*100,i=Math.floor(p.length/$.value)*100;i>=m.value&&(i=0,x=0),p.push({left:x,top:i,width:100,height:100,unit:"px",link:{name:""}})},B=(x,i)=>{const d=document.getElementById("box_"+i),o=x.clientX-d.offsetLeft,H=x.clientY-d.offsetTop;document.onmousemove=function(g){d.style.left=g.clientX-o+"px",d.style.top=g.clientY-H+"px",g.clientX-o<0&&(d.style.left=0),g.clientX-o>m.value-d.offsetWidth&&(d.style.left=m.value-d.offsetWidth+"px"),g.clientY-H<0&&(d.style.top=0),g.clientY-H>T.value-d.offsetHeight&&(d.style.top=T.value-d.offsetHeight+"px"),p[i].left=d.offsetLeft,p[i].top=d.offsetTop,p[i].width=d.offsetWidth,p[i].height=d.offsetHeight,p[i].unit="px"},document.onmouseup=function(g){document.onmousemove=null}},D=(x,i)=>{const d=x;d.stopPropagation();const o=document.getElementById("box_"+i),H=x.target.className,g=o.offsetWidth,A=o.offsetHeight,k=d.clientX,c=d.clientY,f=o.offsetLeft,a=o.offsetTop,s=50,l=50;document.onmousemove=function(le){const h=le;if(H=="box1"){let e=g-(h.clientX-k);const C=m.value;let t=A-(h.clientY-c);const M=T.value-a;let n=f+(h.clientX-k),y=a+(h.clientY-c);e<s&&(e=s),e>C&&(e=C),t<l&&(t=l),t>M&&(t=M),f==0&&a==0?e==s&&t==l?(n=s,y=l):e==s&&t>l?n=s:e>s&&t==l&&(y=l):f==0&&a>0?e==s&&t==l||e==s&&t>l?(n=s,y=o.offsetTop):e>s&&t==l&&(y=o.offsetTop):f>0&&a==0?e==s&&t==l?(n=o.offsetLeft,y=o.offsetTop):e==s&&t>l?(n=o.offsetLeft,y=0):e>s&&t==l&&(y=o.offsetTop):f>0&&a>0&&(e==s&&t==l||e==s&&t>l?(n=o.offsetLeft,y=o.offsetTop):e>s&&t==l&&(y=o.offsetTop)),n<0&&(n=0,e=g-(h.clientX-k)+(f+(h.clientX-k))),y<0&&(y=0,t=a+(h.clientY-c)+(A-(h.clientY-c))),o.style.width=e+"px",o.style.height=t+"px",o.style.left=n+"px",o.style.top=y+"px"}else if(H=="box2"){let e=g+(h.clientX-k);const C=m.value-f;let t=A-(h.clientY-c);const M=T.value-a;let n=a+(h.clientY-c);e<s&&(e=s),e>C&&(e=C),t<l&&(t=l),t>M&&(t=M),f==0&&a==0?e==s&&t==l?n=l:e==s&&t>l||e>s&&t==l&&(n=l):f==0&&a>0?(e==s&&t==l||e==s&&t>l||e>s&&t==l)&&(n=o.offsetTop):f>0&&a==0?e==s&&t==l?n=o.offsetTop:e==s&&t>l?n=0:e>s&&t==l&&(n=o.offsetTop):f>0&&a>0&&(e==s&&t==l||e==s&&t>l||e>s&&t==l)&&(n=o.offsetTop),n<0&&(n=0,t=a+(h.clientY-c)+(A-(h.clientY-c))),o.style.width=e+"px",o.style.height=t+"px",o.style.top=n+"px"}else if(H=="box3"){let e=g-(h.clientX-k);const C=m.value;let t=A+(h.clientY-c);const M=T.value-a;let n=f+(h.clientX-k);e<s&&(e=s),e>C&&(e=C),t<l&&(t=l),t>M&&(t=M),f==0&&a==0||f==0&&a>0?(e==s&&t==l||e==s&&t>l)&&(n=s):f>0&&a==0?(e==s&&t==l||e==s&&t>l)&&(n=o.offsetLeft):f>0&&a>0&&(e==s&&t==l||e==s&&t>l)&&(n=o.offsetLeft),n<0&&(n=0,e=g-(h.clientX-k)+(f+(h.clientX-k))),o.style.width=e+"px",o.style.height=t+"px",o.style.left=n+"px"}else if(H=="box4"){let e=g+(h.clientX-k);const C=m.value-f;let t=A+(h.clientY-c);const M=T.value-a;e<s&&(e=s),e>C&&(e=C),t<l&&(t=l),t>M&&(t=M),o.style.width=e+"px"
|