2 lines
5.3 KiB
JavaScript
2 lines
5.3 KiB
JavaScript
var V=Object.defineProperty,J=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var E=(e,t,n)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,s=(e,t)=>{for(var n in t||(t={}))U.call(t,n)&&E(e,n,t[n]);if(k)for(var n of k(t))W.call(t,n)&&E(e,n,t[n]);return e},I=(e,t)=>J(e,Q(t));var f=(e,t,n)=>new Promise((o,l)=>{var i=r=>{try{_(n.next(r))}catch(u){l(u)}},d=r=>{try{_(n.throw(r))}catch(u){l(u)}},_=r=>r.done?o(r.value):Promise.resolve(r.value).then(i,d);_((n=n.apply(e,t)).next())});import{g as R}from"./storage-d36afdb9.js";import{d as g,o as c,c as p,q as D,av as v,u as a,aw as O,au as y,ax as S,ay as G,az as P,D as h,aA as B,aB as q,E as A,F,h as w,a1 as m,aC as X,m as Y,j as M,aD as Z,aE as ee,aF as b,n as te,b as C,a6 as T,w as oe,aG as ne,aH as $,aI as re,ak as ae}from"./index-414f6242.js";import{u as se,f as ie,a as ce}from"./index-3e379f1f.js";import{u as N}from"./useLifeHandler.hook-56a87d1f.js";import{u as x,C as le}from"./chartEditStore-71df5cf8.js";import"./project.api-d17fa7c6.js";import"./SettingItem-cbdfd56e.js";/* empty css */import"./SettingItemBox-c30b2af8.js";import"./CollapseItem.vue_vue_type_script_setup_true_lang-80d5594f.js";import"./icon-42145a57.js";import"./index.esm.min-6f206398.js";import"./plugin-614116ba.js";import"./fileTypeEnum-21359a08.js";const H=(e,t)=>({zIndex:t+1,left:`${e.x}px`,top:`${e.y}px`}),j=(e,t)=>({width:`${t?t*e.w:e.w}px`,height:`${t?t*e.h:e.h}px`}),z=e=>({display:e.hide?"none":"block"}),K=e=>{const t={};return e&&e.overFlowHidden&&(t.overflow="hidden"),t},ue=e=>{const t=e.selectColor?{background:e.background}:{background:`url(${e.backgroundImage}) center center / cover no-repeat !important`};return s({position:"relative",width:e.width?`${e.width||100}px`:"100%",height:e.height?`${e.height}px`:"100%"},t)},pe=g({__name:"index",props:{groupData:{type:Object,required:!0},themeSetting:{type:Object,required:!0},themeColor:{type:Object,required:!0},groupIndex:{type:Number,required:!0}},setup(e){return(t,n)=>(c(!0),p(F,null,D(e.groupData.groupList,o=>(c(),p("div",{class:v(["chart-item",a(O)(o.styles.animations)]),key:o.id,style:y(s(s(s(s(s(s({},a(H)(o.attr,e.groupIndex)),a(S)(o.styles)),a(G)(o.styles)),a(z)(o.status)),a(K)(o.preview)),a(P)(o.styles)))},[(c(),h(A(o.chartConfig.chartKey),B({id:o.id,chartConfig:o,themeSetting:e.themeSetting,themeColor:e.themeColor,style:s({},a(j)(o.attr))},q(a(N)(o))),null,16,["id","chartConfig","themeSetting","themeColor","style"]))],6))),128))}});const de=w(pe,[["__scopeId","data-v-214bf203"]]),_e=g({__name:"index",setup(e){const{initDataPond:t,clearMittDataPondMap:n}=se(),o=x(),l=m(()=>o.editCanvasConfig.chartThemeSetting),i=m(()=>X(o.editCanvasConfig.chartCustomThemeColorInfo)[o.editCanvasConfig.chartThemeColor]);return n(),Y(()=>{t(o.requestGlobalConfig)}),(d,_)=>(c(!0),p(F,null,D(a(o).componentList,(r,u)=>(c(),p("div",{class:v(["chart-item",a(O)(r.styles.animations)]),key:r.id,style:y(s(s(s(s(s(s({},a(H)(r.attr,u)),a(S)(r.styles)),a(G)(r.styles)),a(z)(r.status)),a(K)(r.preview)),a(P)(r.styles)))},[r.isGroup?(c(),h(a(de),{key:0,groupData:r,groupIndex:u,themeSetting:l.value,themeColor:i.value},null,8,["groupData","groupIndex","themeSetting","themeColor"])):(c(),h(A(r.chartConfig.chartKey),B({key:1,id:r.id,chartConfig:r,themeSetting:l.value,themeColor:i.value,style:s({},a(j)(r.attr))},q(a(N)(r))),null,16,["id","chartConfig","themeSetting","themeColor","style"]))],6))),128))}});const L=w(_e,[["__scopeId","data-v-5807f851"]]),he=e=>{const t=M(!1),n=setInterval(()=>{var o;if((o=window.$vue)!=null&&o.component){clearInterval(n);const l=i=>{window.$vue.component(i.chartConfig.chartKey)||window.$vue.component(i.chartConfig.chartKey,ie(i.chartConfig))};e.componentList.forEach(i=>f(void 0,null,function*(){i.isGroup?i.groupList.forEach(d=>{l(d)}):l(i)})),t.value=!0}},200);return{show:t}},ge=e=>{const t=x();t.requestGlobalConfig=e[le.REQUEST_GLOBAL_CONFIG]},fe=g({__name:"suspenseIndex",setup(e){return f(this,null,function*(){let t,n;[t,n]=Z(()=>R()),yield t,n();const o=x();ee(`预览-${o.editCanvasConfig.projectName}`);const l=m(()=>s(s({},ue(o.editCanvasConfig)),S(o.editCanvasConfig))),i=m(()=>{const u=o.editCanvasConfig.previewScaleType;return u===b.SCROLL_Y||u===b.SCROLL_X});ge(o);const{entityRef:d,previewRef:_}=ce(o),{show:r}=he(o);return(u,Ce)=>(c(),p("div",{class:v(`go-preview ${a(o).editCanvasConfig.previewScaleType}`)},[i.value?(c(),p("div",{key:0,ref_key:"entityRef",ref:d,class:"go-preview-entity"},[te("div",{ref_key:"previewRef",ref:_,class:"go-preview-scale"},[a(r)?(c(),p("div",{key:0,style:y(l.value)},[C(a(L))],4)):T("",!0)],512)],512)):(c(),p("div",{key:1,ref_key:"previewRef",ref:_,class:"go-preview-scale"},[a(r)?(c(),p("div",{key:0,style:y(l.value)},[C(a(L))],4)):T("",!0)],512))],2))})}});const ye=w(fe,[["__scopeId","data-v-e7ba7285"]]),me=g({__name:"index",setup(e){return(t,n)=>(c(),h(ne,null,{default:oe(()=>[C(ye)]),_:1}))}}),Pe=g({__name:"wrapper",setup(e){let t=M(Date.now());return[$.JSON,$.CHART_TO_PREVIEW].forEach(n=>{window.opener&&window.opener.addEventListener(n,o=>f(this,null,function*(){const l=yield R();re(ae.GO_CHART_STORAGE_LIST,[I(s({},o.detail),{id:l.id})]),t.value=Date.now()}))}),(n,o)=>(c(),h(me,{key:a(t)}))}});export{Pe as default};
|