property-9b5110f9.js 6.5 KB

1
  1. import{_ as Z,__tla as ee}from"./ComponentContainerProperty-540b9384.js";import{d as G,dP as te,af as j,r as R,K as J,o as n,c as p,g as L,F as z,n as A,Y as ae,at as N,f as l,a as o,O as Q,m as q,t as le,_ as oe,q as re,w as y,z as ue,d3 as se,C as ie,__tla as _e}from"./index-2eab2d23.js";import{_ as me,__tla as ne}from"./index.vue_vue_type_script_setup_true_lang-f5b637f5.js";import{_ as ce,__tla as de}from"./UploadImg-90fe71c2.js";import{_ as pe}from"./_plugin-vue_export-helper-1b428a4d.js";import{E as he,__tla as fe}from"./el-text-b1163e3d.js";import{u as ye,__tla as ve}from"./util-8a54c07a.js";import{__tla as be}from"./el-card-c558f0ec.js";import{__tla as Ve}from"./index-30d48444.js";import"./color-6e929987.js";import{__tla as xe}from"./AppLinkSelectDialog.vue_vue_type_script_setup_true_lang-8a855232.js";import{__tla as we}from"./Dialog-c2716df6.js";import{__tla as ge}from"./ProductCategorySelect.vue_vue_type_script_setup_true_lang-997a9041.js";import{__tla as ke}from"./el-tree-select-4ae7c290.js";import"./tree-fd3a041e.js";import{__tla as ze}from"./category-c573377b.js";import{__tla as Ue}from"./index-d3f876ab.js";import{__tla as Se}from"./el-image-viewer-5d14bc77.js";import{__tla as Ce}from"./useMessage-171aa63e.js";import{__tla as Re}from"./Qrcode-a57a527d.js";import{__tla as $e}from"./IFrame.vue_vue_type_script_setup_true_lang-82b81649.js";import{__tla as Me}from"./vuedraggable.umd-67523a5c.js";import{__tla as Ae}from"./el-collapse-item-5ecf4321.js";let W,Be=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return $e}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Ae}catch{}})()]).then(async()=>{let B,E,D,F,H,I,K;B=(_,g)=>{const[u,s]=[_.x,g.x].sort(),[e,c]=[_.y,g.y].sort(),V=s+1,x=c+1;return{left:u,right:V,top:e,bottom:x,height:x-e,width:V-u}},E={class:"relative"},D={class:"cube-table"},F=["onClick","onMouseenter"],H=["onClick"],I=["onClick"],K=pe(G({name:"MagicCubeEditor",__name:"index",props:{modelValue:te().isRequired,rows:j.number.def(4),cols:j.number.def(4),cubeSize:j.number.def(75)},emits:["update:modelValue","hotAreaSelected"],setup(_,{emit:g}){const u=_,s=R([]);J(()=>[u.rows,u.cols],()=>{if(s.value=[],u.rows&&u.cols)for(let i=0;i<u.rows;i++){s.value[i]=[];for(let a=0;a<u.cols;a++)s.value[i].push({x:a,y:i,active:!1})}},{immediate:!0});const e=R([]);J(()=>u.modelValue,()=>e.value=u.modelValue||[],{immediate:!0});const c=R(),V=()=>!!c.value,x=g,r=()=>x("update:modelValue",e),U=R(-1),$=(i,a)=>{U.value=a,x("hotAreaSelected",i,a)};function k(){v((i,a,m)=>{m.active&&(m.active=!1)}),c.value=void 0}const v=i=>{for(let a=0;a<s.value.length;a++)for(let m=0;m<s.value[a].length;m++)i(a,m,s.value[a][m])};return(i,a)=>{const m=oe;return n(),p("div",E,[L("table",D,[L("tbody",null,[(n(!0),p(z,null,A(o(s),(d,t)=>(n(),p("tr",{key:t},[(n(!0),p(z,null,A(d,(b,h)=>(n(),p("td",{key:h,class:ae(["cube",{active:b.active}]),style:N({width:`${_.cubeSize}px`,height:`${_.cubeSize}px`}),onClick:X=>((P,T)=>{const S=s.value[P][T];if(!V())return c.value=S,void(c.value.active=!0);e.value.push(B(c.value,S)),k();let f=e.value.length-1;$(e.value[f],f),r()})(t,h),onMouseenter:X=>((P,T)=>{if(!V())return;const S=B(c.value,s.value[P][T]);for(const O of e.value)if(w=S,(f=O).left<w.left+w.width&&f.left+f.width>w.left&&f.top<w.top+w.height&&f.height+f.top>w.top)return void k();var f,w;v((O,Pe,Y)=>{var C,M;Y.active=(C=S,(M=Y).x>=C.left&&M.x<C.right&&M.y>=C.top&&M.y<C.bottom)})})(t,h)},[l(m,{icon:"ep-plus"})],46,F))),128))]))),128))]),(n(!0),p(z,null,A(o(e),(d,t)=>(n(),p("div",{key:t,class:"hot-area",style:N({top:_.cubeSize*d.top+"px",left:_.cubeSize*d.left+"px",height:_.cubeSize*d.height+"px",width:_.cubeSize*d.width+"px"}),onClick:b=>$(d,t),onMouseover:k},[o(U)===t?(n(),p("div",{key:0,class:"btn-delete",onClick:b=>(h=>{e.value.splice(h,1),k(),r()})(t)},[l(m,{icon:"ep:circle-close-filled"})],8,I)):Q("",!0),q(" "+le(`${d.width}\xD7${d.height}`),1)],44,H))),128))])])}}}),[["__scopeId","data-v-25f7ee46"]]),W=G({name:"MagicCubeProperty",__name:"property",props:{modelValue:{}},emits:["update:modelValue"],setup(_,{emit:g}){const u=_,s=g,{formData:e}=ye(u.modelValue,s),c=R(-1),V=(x,r)=>{c.value=r};return(x,r)=>{const U=he,$=K,k=ce,v=ue,i=me,a=se,m=ie,d=Z;return n(),re(d,{modelValue:o(e).style,"onUpdate:modelValue":r[4]||(r[4]=t=>o(e).style=t)},{default:y(()=>[l(m,{"label-width":"80px",model:o(e),class:"m-t-8px"},{default:y(()=>[l(U,{tag:"p"},{default:y(()=>[q(" \u9B54\u65B9\u8BBE\u7F6E ")]),_:1}),l(U,{type:"info",size:"small"},{default:y(()=>[q(" \u6BCF\u683C\u5C3A\u5BF8187 * 187 ")]),_:1}),l($,{class:"m-y-16px",modelValue:o(e).list,"onUpdate:modelValue":r[0]||(r[0]=t=>o(e).list=t),rows:4,cols:4,onHotAreaSelected:V},null,8,["modelValue"]),(n(!0),p(z,null,A(o(e).list,(t,b)=>(n(),p(z,{key:b},[o(c)===b?(n(),p(z,{key:0},[l(v,{label:"\u4E0A\u4F20\u56FE\u7247",prop:`list[${b}].imgUrl`},{default:y(()=>[l(k,{modelValue:t.imgUrl,"onUpdate:modelValue":h=>t.imgUrl=h,height:"80px",width:"80px"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),l(v,{label:"\u94FE\u63A5",prop:`list[${b}].url`},{default:y(()=>[l(i,{modelValue:t.url,"onUpdate:modelValue":h=>t.url=h},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])],64)):Q("",!0)],64))),128)),l(v,{label:"\u4E0A\u5706\u89D2",prop:"borderRadiusTop"},{default:y(()=>[l(a,{modelValue:o(e).borderRadiusTop,"onUpdate:modelValue":r[1]||(r[1]=t=>o(e).borderRadiusTop=t),max:100,min:0,"show-input":"","input-size":"small","show-input-controls":!1},null,8,["modelValue"])]),_:1}),l(v,{label:"\u4E0B\u5706\u89D2",prop:"borderRadiusBottom"},{default:y(()=>[l(a,{modelValue:o(e).borderRadiusBottom,"onUpdate:modelValue":r[2]||(r[2]=t=>o(e).borderRadiusBottom=t),max:100,min:0,"show-input":"","input-size":"small","show-input-controls":!1},null,8,["modelValue"])]),_:1}),l(v,{label:"\u95F4\u9694",prop:"space"},{default:y(()=>[l(a,{modelValue:o(e).space,"onUpdate:modelValue":r[3]||(r[3]=t=>o(e).space=t),max:100,min:0,"show-input":"","input-size":"small","show-input-controls":!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}})});export{Be as __tla,W as default};