← Back
Editing: index109.js
import{u as e,bv as a,L as t,B as s,e as l}from"./utils-lib.js?v=VERSION_NUMBER";import{c as o,W as n,X as r,b as d,aE as i,ar as u,r as v,t as c,g as m,w as f,a0 as p,p as h,a4 as b,aM as y,q as _,v as w,y as g,F as x,a_ as C,x as k,L,C as E,M as I,A,H as M,I as $,e as j,N as B,J as R,aN as T,d as V,ax as S,z as W}from"./base-lib.js?v=VERSION_NUMBER";import{_ as N}from"./index110.js?v=VERSION_NUMBER";const O={class:"flex flex-col p-[1.2rem]"},q=["onClick"],z=l(o({__name:"index",props:n({options:{default:()=>[]},store:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},showContent:{type:Boolean,default:!0},contentClass:{default:"router-tabs-content"}},{modelValue:{},modelModifiers:{}}),emits:n(["cutTab","afterLeave"],["update:modelValue"]),setup(l,{emit:o}){const n=V((()=>t((()=>import("./index179.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url))),z=l,D=o,F=r(l,"modelValue"),{mainWidth:H,forceLtd:J,aliyunEcsLtd:P,payment:U}=e(),X=d(),G=i(),K=u(z.options),Q=v(!0),Y=v(!1),Z=v("0px"),ee=v(0),ae=v(),te=v(),se="".concat(X.path.split("/")[1],"_router").toUpperCase(),{authType:le}=c(U.value),oe=m((()=>"router-tabs-content"===z.contentClass));f((()=>X.name),(()=>{if(ie())de(X.name),F.value=X.name;else{const e=localStorage.getItem(se)||K.value[0].name;G.push({name:e}),de(e),F.value=e}}));const ne=e=>{const a=e.target.offsetLeft,t=e.target.offsetWidth;Z.value="".concat(a+t-22,"px"),Y.value=!0},re=p(ae,(e=>{const a=e[0],{width:t}=a.contentRect;ee.value=t,Q.value=H.value-320>=ee.value})),de=e=>{localStorage.setItem(se,e)},ie=()=>{const e=X.path.split("/");return e.length>2&&""!=e[2]},ue=(e,a=!0,t=!0)=>{F.value=e,a&&de(e),X.name!==e&&t&&G.push({name:e})};return f((()=>s.value),(e=>{var a;const t=e.find((e=>-1!==X.path.indexOf(e.path)));if((null==t?void 0:t.children)&&Array.isArray(t.children)&&K.value.forEach((e=>{const a=t.children.find((a=>e.path===a.name));e.show=!a||a.show})),!(null==(a=K.value.find((e=>e.name===X.name)))?void 0:a.show)){const e=K.value.filter((e=>e.show));e&&e.length&&ue(e[0].name)}}),{immediate:!0}),f(H,(()=>{Q.value=H.value-320>=ee.value})),h((()=>{var e,t,s;const l=localStorage.getItem(se);if(K.value.length||(K.value=a(null==(e=X.matched[1])?void 0:e.children,"array",[])),"/mail"===(null==(t=X.matched[1])?void 0:t.path)&&K.value.forEach((e=>{e.show=!0})),"/vhost"===(null==(s=X.matched[1])?void 0:s.path)&&K.value.forEach((e=>{e.show=!0})),z.store)return ie()?ue(X.name):ue(l||K.value[0].name)})),b((()=>{re.stop()})),(e,a)=>{const t=N,s=S,l=y("router-view");return _(),w("div",O,[g("div",{class:R(["header-tabs",{disabled:e.disabled}])},[g("div",{ref_key:"headerChildContentRef",ref:ae,class:"flex flex-wrap"},[(_(!0),w(x,null,C(k(K),((e,t)=>{var s,l;return _(),w(x,{key:t},[e.show?(_(),w("div",{key:0,ref_for:!0,ref_key:"tabListRef",ref:te,class:R(["header-child-tab",{"active-tab":F.value===e.name,"!hidden":null==(s=null==e?void 0:e.meta)?void 0:s.ignore}]),onClick:a=>((e,a=!1)=>{z.disabled||(F.value!==e||a)&&(de(e),F.value=e,G.push({name:e}),D("cutTab",e))})(e.name),onMouseenter:ne,onMouseleave:a[0]||(a[0]=e=>Y.value=!1)},W(null==(l=e.meta)?void 0:l.title),43,q)):E("",!0)],64)})),128))],512),e.$slots.right?L(e.$slots,"right",{key:0},void 0,!0):E("",!0),e.$slots.right?E("",!0):(_(),I(s,{key:1,width:"580",disabled:"free"!==k(le),"show-arrow":!1,"popper-style":"padding: 0;border-radius: 16px;overflow: hidden;","popper-class":"el-product-state-popover"},{reference:A((()=>[M(j(t,{"is-home":!0,"disable-pro":!0},null,512),[[$,k(Q)&&!(k(J)||k(P))]])])),default:A((()=>[(_(),I(B(k(n))))])),_:1},8,["disabled"]))],2),e.showContent?(_(),w("div",{key:0,class:R(["",{"module-ui":k(oe),"mt-[1.2rem]":k(oe)}])},[e.$slots.default?(_(),w("div",{key:0,class:R(e.contentClass)},[L(e.$slots,"default",{},void 0,!0)],2)):(_(),w("div",{key:1,class:R(e.contentClass)},[j(l,null,{default:A((({Component:e})=>[j(T,{name:"fade",mode:"out-in",onAfterLeave:a[1]||(a[1]=e=>D("afterLeave"))},{default:A((()=>[(_(),I(B(e)))])),_:2},1024)])),_:1})],2))],2)):E("",!0)])}}}),[["__scopeId","data-v-e911f2ad"]]);export{z as _}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel