2 lines
3.1 KiB
JavaScript
2 lines
3.1 KiB
JavaScript
import{d as Q,$ as X,l as h,Y as a,a1 as v,r,o as n,D as c,w as t,b as o,u as y,c as b,F as I,q as A,E as H,n as u,t as B,b7 as Z,s as tt,x as et,h as ot}from"./index-4ec2ce15.js";import{g as st}from"./plugin-ae137233.js";import{i as w}from"./icon-42fa39e7.js";import{u as nt}from"./useKeyboard.hook-f82db81a.js";import{u as at}from"./useSync.hook-dcdbd18a.js";import{u as rt,a as ct,H as d}from"./chartEditStore-bfc6c223.js";import{u as L,C as _}from"./chartLayoutStore-810503fe.js";import"./index-96c3a075.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";import"./project.api-0931840b.js";const it=i=>(tt("data-v-73bd34c5"),i=i(),et(),i),lt={class:"save-btn"},pt=it(()=>u("span",null,"保存",-1)),dt=Q({__name:"index",setup(i){const{LayersIcon:x,BarChartIcon:D,PrismIcon:E,HomeIcon:F,ArrowBackIcon:R,ArrowForwardIcon:K}=w.ionicons5,{SaveIcon:T}=w.carbon,{setItem:z}=L(),{dataSyncUpdate:$}=at(),{getLayers:q,getCharts:N,getDetails:O}=X(L()),k=rt(),g=ct(),P=h([{key:_.CHARTS,select:N,title:"图表组件",icon:a(D)},{key:_.LAYERS,select:q,title:"图层控制",icon:a(x)},{key:_.DETAILS,select:O,title:"详情设置",icon:a(E)}]),V=v(()=>g.getBackStack.length>1),W=v(()=>g.getForwardStack.length>0),Y=h([{key:d.BACK_STACK,select:V,title:"后退",icon:a(R)},{key:d.FORWARD_STACK,select:W,title:"前进",icon:a(K)}]),M=s=>s.key===_.DETAILS?s.select?"":"primary":s.select?"primary":"",U=s=>{z(s.key,!s.select)},j=s=>{switch(s.key){case d.BACK_STACK:k.setBack();break;case d.FORWARD_STACK:k.setForward();break}},G=()=>{st({message:"确定已保存了数据(Ctrl / ⌘ + S),并返回到首页吗?",isMaskClosable:!0,onPositiveCallback:()=>{Z(),nt()}})};return(s,l)=>{const C=r("n-icon"),p=r("n-button"),m=r("n-tooltip"),S=r("n-divider"),f=r("n-space");return n(),c(f,{class:"header-left-btn",size:25},{default:t(()=>[o(p,{size:"small",quaternary:"",onClick:l[0]||(l[0]=e=>G())},{icon:t(()=>[o(C,{depth:3},{default:t(()=>[o(y(F))]),_:1})]),_:1}),o(f,null,{default:t(()=>[(n(!0),b(I,null,A(P,e=>(n(),c(m,{key:e.key,placement:"bottom",trigger:"hover"},{trigger:t(()=>[o(p,{size:"small",ghost:"",type:M(e),focusable:!1,onClick:J=>U(e)},{default:t(()=>[(n(),c(H(e.icon)))]),_:2},1032,["type","onClick"])]),default:t(()=>[u("span",null,B(e.title),1)]),_:2},1024))),128)),o(S,{vertical:""}),(n(!0),b(I,null,A(Y,e=>(n(),c(m,{key:e.key,placement:"bottom",trigger:"hover"},{trigger:t(()=>[o(p,{size:"small",ghost:"",type:"primary",disabled:!e.select,onClick:J=>j(e)},{default:t(()=>[(n(),c(H(e.icon)))]),_:2},1032,["disabled","onClick"])]),default:t(()=>[u("span",null,B(e.title),1)]),_:2},1024))),128)),o(S,{vertical:""}),o(m,{placement:"bottom",trigger:"hover"},{trigger:t(()=>[u("div",lt,[o(p,{size:"small",type:"primary",ghost:"",onClick:l[1]||(l[1]=e=>y($)())},{icon:t(()=>[o(C,null,{default:t(()=>[o(y(T))]),_:1})]),_:1})])]),default:t(()=>[pt]),_:1})]),_:1})]),_:1})}}});const Bt=ot(dt,[["__scopeId","data-v-73bd34c5"]]);export{Bt as default};
|