import{_ as H}from"./app-9444f1fe.js";import{_ as K,b as P,r as y,h as X,o as ee,L as te,M as le,p as d,q as _,Q as r,O as b,P as M,B as n,N as u,V as i,y as A,t as p,U as w,Z as ae,am as oe,v as k}from"./framework-2d0bbdc3.js";import{M as ne,L as N}from"./utils-e9a9aa23.js";import{E as B,a as se,b as j}from"./index-9d5bf97d.js";import{O as re}from"./enum-81d8f3d7.js";import{d as D,E as ue,a as G,b as ie,c as de,e as pe,f as me}from"./options-72c30d09.js";import{c as fe}from"./listData-9dae369c.js";import{E as S}from"./index-93c4d27d.js";import"./index-2653f279.js";import"./index-df01d077.js";const ce={class:"context"},ye={class:"list"},_e={class:"right"},ve={key:1,class:"options"},ge={class:"set"},ke={__name:"index.html",setup(Ee){let x=P([]),v=P([]),f=y(""),c=y("gg"),g=y(ne.GEAR),E=y(N.DOM),T=y(null),m=null,V=!1,C=y(!0);const F=X(()=>{let l=v.filter(e=>e.form===c.value);return c.value==="model"&&(l=l.filter(e=>e.model===g.value)),l});q(),ee(()=>{H(()=>import("./loading-5117cee7.js"),["assets/loading-5117cee7.js","assets/utils-e9a9aa23.js"]).then(l=>{m=l.default(),C.value=!1,L()})});function L(){m.getLoadingId()||(m.loading(T.value,O()),E.value!==N.DOM&&setTimeout(m.close,(f.value||1)*1e3))}function Y(){m&&m.close()}function $(l,e){e.key==="model"&&(c.value="model",g.value=l.value),e.key==="type"&&(E.value=l.value),!V&&["bgColor","pointerEvents"].includes(e.key)&&(me({title:"提示",type:"warning",message:'部分公共options是用于初始化canvas,例如:"背景色"与"事件穿透",需要 重新加载 显示效果!'}),V=!0),m&&m.update(O())}function q(){for(let a=0;a<10;a++)x.push(Q());v=JSON.parse(JSON.stringify(D));let e=te().query.model;if(e){let a=fe.find(o=>o.model===e),t=v.find(o=>o.key==="model");if(t.value=e,g.value=e,a){let o=JSON.parse(JSON.stringify(a));v.filter(s=>s.form==="gg"||s.model===e).forEach(s=>{for(let[U,I]of Object.entries(o.options))h(s.type)&&s.key===U&&s.arrayAdd&&s.arrayItems&&I.length&&(s.arrayItems=[],I.forEach(Z=>{s.arrayItems.push(JSON.parse(JSON.stringify(s.arrayAdd,(z,J)=>{switch(z){case"key":return J+s.arrayItems.length;case"value":return Z;default:return J}})))})),s.key===U&&(s.value=I)})}}}function R(l){let e={},a=O();D&&a&&D.forEach(o=>{(!o.model&&a[o.key]&&a[o.key]!==o.value||l||o.model&&o.model===a.model&&(h(o.type)?a[o.key].join()!==o.value.join():a[o.key]!==o.value))&&(e[o.key]=a[o.key])});let t=document.createElement("input");t.value=JSON.stringify(e),document.body.appendChild(t),t.select(),document.execCommand("Copy"),t.remove(),j.success("复制成功!")}function O(){let l=v.filter(a=>a.model===g.value||a.form===re.GG),e={};return l.forEach(a=>{h(a.type)?e[a.key]=a.arrayItems.map(t=>t.value):e[a.key]=a.value}),e}function W(){let l=parseInt(f.value);(l<1||l>30)&&(j.warning("范围1-30秒"),f.value="")}function Q(){let l=new Date;return{id:parseInt(Math.random()*1e7),user:parseInt(Math.random()*1e7),value:parseInt(Math.random()*100),date:`${l.getFullYear()}${l.getMonth()-1}-${l.getDate()}`}}function h(l){return l&&l.includes("array_")}return(l,e)=>{const a=le("WebTypeInput");return d(),_("div",null,[r("div",ce,[r("div",{class:"left",ref_key:"leftRef",ref:T},[(d(!0),_(b,null,M(n(x),t=>(d(),w(n(de),{key:t.id},{default:i(()=>[r("div",ye,[r("span",null,[p(" id: "),r("b",null,k(t.id),1)]),r("span",null,[p(" user: "),r("b",null,k(t.user),1)]),r("span",null,[p(" value: "),r("b",null,k(t.value),1)]),r("span",null,[p(" date: "),r("b",null,k(t.date),1)])])]),_:2},1024))),128))],512),r("div",_e,[u(n(se),{modelValue:n(c),"onUpdate:modelValue":e[0]||(e[0]=t=>A(c)?c.value=t:c=t),class:"demo-tabs"},{default:i(()=>[u(n(B),{label:"公共",name:"gg"}),u(n(B),{label:"model",name:"model"})]),_:1},8,["modelValue"]),n(C)?(d(),_(b,{key:0},M(10,t=>u(n(pe),{rows:1,animated:""})),64)):(d(),_("div",ve,[(d(!0),_(b,null,M(n(F),t=>(d(),w(a,{key:t.key,modelValue:t.value,"onUpdate:modelValue":o=>t.value=o,options:t,onUpdate:o=>$(o,t)},null,8,["modelValue","onUpdate:modelValue","options","onUpdate"]))),128))])),r("div",ge,[u(n(S),{type:"primary",onClick:L},{default:i(()=>[p("加载")]),_:1}),n(E)===n(N).DOM?(d(),w(n(S),{key:0,type:"danger",onClick:Y},{default:i(()=>[p("关闭")]),_:1})):ae((d(),_("input",{key:1,type:"number",placeholder:"1秒关闭",onInput:W,"onUpdate:modelValue":e[1]||(e[1]=t=>A(f)?f.value=t:f=t)},null,544)),[[oe,n(f)]]),u(n(ie),null,{dropdown:i(()=>[u(n(ue),null,{default:i(()=>[u(n(G),{onClick:e[2]||(e[2]=t=>R())},{default:i(()=>[p("修改部分")]),_:1}),u(n(G),{onClick:e[3]||(e[3]=t=>R("all"))},{default:i(()=>[p("全部配置")]),_:1})]),_:1})]),default:i(()=>[u(n(S),{type:"success"},{default:i(()=>[p("复制")]),_:1})]),_:1})])])])])}}},Ve=K(ke,[["__scopeId","data-v-c6504d06"],["__file","index.html.vue"]]);export{Ve as default};
