goview_vue/dist/static/js/index-0e86967a.js
2023-06-06 13:24:29 +08:00

2 lines
4.7 KiB
JavaScript

var k=(t,e,n)=>new Promise((l,o)=>{var c=i=>{try{f(n.next(i))}catch(g){o(g)}},E=i=>{try{f(n.throw(i))}catch(g){o(g)}},f=i=>i.done?l(i.value):Promise.resolve(i.value).then(c,E);f((n=n.apply(t,e)).next())});import{M}from"./index-b2b393ee.js";import{_ as H}from"./index-d489f98f.js";import{u as G,b as U,f as x}from"./chartEditStore-bfc6c223.js";import{u as V,a as O}from"./chartLayoutStore-810503fe.js";import{I as J,z,f as D,d as L,e as Y,c as q}from"./index-96c3a075.js";import{cL as Q,cM as A,cN as W,cO as X,g as Z,cP as j,cQ as tt,cR as et,cS as at,cT as nt,d as st,j as ot,a1 as rt,J as ct,ad as lt,r as y,o as u,c as h,n as C,F as it,q as dt,b as d,u as m,w as _,e as I,t as P,D as w,a6 as T,av as ut,cU as _t,aJ as ft,s as gt,x as pt,h as ht}from"./index-4ec2ce15.js";import{a as mt,b as Ct,l as vt,g as yt}from"./plugin-ae137233.js";import{c as b}from"./index-64867e41.js";import{i as bt}from"./icon-42fa39e7.js";import"./index-f119bf30.js";import"./SettingItem-35031211.js";/* empty css */import"./SettingItemBox-f60eaa4e.js";import"./CollapseItem.vue_vue_type_script_setup_true_lang-77b092a0.js";import"./index.esm.min-2eecdcbd.js";import"./fileTypeEnum-21359a08.js";function Et(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var St=Et;function kt(t,e,n){var l=-1,o=t.length;e<0&&(e=-e>o?0:o+e),n=n>o?o:n,n<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var c=Array(o);++l<o;)c[l]=t[l+e];return c}var xt=kt,Ot=Q,Dt=xt;function Lt(t,e){return e.length<2?t:Ot(t,Dt(e,0,-1))}var It=Lt,Pt=A,wt=St,Tt=It,At=W;function $t(t,e){return e=Pt(e,t),t=Tt(t,e),t==null||delete t[At(wt(e))]}var Bt=$t,Ft=X;function Kt(t){return Ft(t)?void 0:t}var Nt=Kt,Rt=j,Mt=nt,Ht=Bt,Gt=A,Ut=tt,Vt=Nt,Jt=et,zt=at,Yt=1,qt=2,Qt=4,Wt=Jt(function(t,e){var n={};if(t==null)return n;var l=!1;e=Rt(e,function(c){return c=Gt(c,t),l||(l=c.length>1),c}),Ut(t,zt(t),n),l&&(n=Mt(n,Yt|qt|Qt,Vt));for(var o=e.length;o--;)Ht(n,e[o]);return n}),Xt=Wt;const Zt=Z(Xt),jt=t=>(gt("data-v-ded4749c"),t=t(),pt(),t),te={class:"go-content-charts-item-animation-patch"},ee=["onDragstart","onDragend","onDblclick","onClick"],ae={class:"list-header"},ne={class:"list-center go-flex-center go-transition",draggable:"true"},se={class:"list-bottom"},oe={key:0,class:"list-model"},re=["onClick"],ce=jt(()=>C("span",null,"删除",-1)),le=st({__name:"index",props:{menuOptions:{type:Array,default:()=>[]}},emits:["deletePhoto"],setup(t,{emit:e}){const n=G(),{TrashIcon:l}=bt.ionicons5,o=V(),c=ot(),E=a=>!a.disabled&&a.package===U.PHOTOS&&a.category===z.PRIVATE,f=rt(()=>o.getChartType),i=(a,s)=>{s.disabled||(b(s.chartKey,D(s)),b(s.conKey,L(s)),a.dataTransfer.setData(_t.DRAG_KEY,ft(Zt(s,["image"]))),n.setEditCanvas(x.IS_CREATE,!0))},g=()=>{n.setEditCanvas(x.IS_CREATE,!1)},$=a=>k(this,null,function*(){if(!a.disabled)try{mt(),b(a.chartKey,D(a)),b(a.conKey,L(a));let s=yield Y(a);a.redirectComponent&&(a.dataset&&(s.option.dataset=a.dataset),s.chartConfig.title=a.title,s.chartConfig.chartFrame=a.chartFrame),n.addComponentList(s,!1,!0),n.setTargetSelectChart(s.id),Ct()}catch(s){vt(),window.$message.warning("图表正在研发中, 敬请期待...")}}),B=a=>{var s;(s=a==null?void 0:a.configEvents)==null||s.addHandle(a)},F=(a,s)=>{yt({message:"是否删除此图片?",transformOrigin:"center",onPositiveCallback:()=>{const v=q();e("deletePhoto",a,s),v.deletePhotos(a,s)}})};return ct(()=>f.value,a=>{a===O.DOUBLE&&lt(()=>{c.value.classList.add("miniAnimation")})}),(a,s)=>{const v=y("n-ellipsis"),S=y("n-text"),K=y("n-icon"),N=y("n-button");return u(),h("div",te,[C("div",{ref_key:"contentChartsItemBoxRef",ref:c,class:ut(["go-content-charts-item-box",[f.value===m(O).DOUBLE?"double":"single"]])},[(u(!0),h(it,null,dt(t.menuOptions,(r,R)=>(u(),h("div",{class:"item-box",key:r.title,draggable:"",onDragstart:p=>!r.disabled&&i(p,r),onDragend:p=>!r.disabled&&g,onDblclick:p=>$(r),onClick:p=>B(r)},[C("div",ae,[d(m(M),{class:"list-header-control-btn",mini:!0,disabled:!0}),d(S,{class:"list-header-text",depth:"3"},{default:_(()=>[d(v,null,{default:_(()=>[I(P(r.title),1)]),_:2},1024)]),_:2},1024)]),C("div",ne,[r.icon?(u(),w(m(J),{key:0,class:"list-img",icon:r.icon,color:"#999",width:"48"},null,8,["icon"])):(u(),w(m(H),{key:1,class:"list-img",chartConfig:r},null,8,["chartConfig"]))]),C("div",se,[d(S,{class:"list-bottom-text",depth:"3"},{default:_(()=>[d(v,{style:{"max-width":"90%"}},{default:_(()=>[I(P(r.title),1)]),_:2},1024)]),_:2},1024)]),r.disabled?(u(),h("div",oe)):T("",!0),E(r)?(u(),h("div",{key:1,class:"list-tools go-transition",onClick:p=>F(r,R)},[d(N,{text:"",type:"default",color:"#ffffff"},{icon:_(()=>[d(K,null,{default:_(()=>[d(m(l))]),_:1})]),default:_(()=>[ce]),_:1})],8,re)):T("",!0)],40,ee))),128))],2)])}}});const Oe=ht(le,[["__scopeId","data-v-ded4749c"]]);export{Oe as default};