import{d as u,e as h}from"./index-0f3e2c06-1779868775780v=1.0.0.js";const o=u({id:"useKeepAliveStore",state:()=>({keepAliveName:[]}),actions:{async addKeepAliveName(e){!this.keepAliveName.includes(e)&&this.keepAliveName.push(e)},async removeKeepAliveName(e){this.keepAliveName=this.keepAliveName.filter(s=>s!==e)},async setKeepAliveName(e=[]){this.keepAliveName=e}}}),l=o(),r=u({id:"TabsState",state:()=>({tabsMenuList:[]}),actions:{async addTabs(e){e.path.indexOf("id=")==-1&&e.title==="\u8BE6\u60C5"&&(e.title="\u65B0\u589E"),this.tabsMenuList.every(s=>s.path!==e.path)&&this.tabsMenuList.push(e),!l.keepAliveName.includes(e.name)&&e.isKeepAlive&&l.addKeepAliveName(e.name)},async removeTabs(e,s=!0){const t=this.tabsMenuList;s&&t.forEach((i,a)=>{if(i.path!==e)return;const n=t[a+1]||t[a-1];!n||h.push(n.path)}),this.tabsMenuList=t.filter(i=>i.path!==e)},async closeMultipleTab(e){this.tabsMenuList=this.tabsMenuList.filter(s=>s.path===e||!s.close),this.tabsMenuList},async setTabs(e){this.tabsMenuList=e},async setTabsTitle(e){const s=location.hash.substring(1);this.tabsMenuList.forEach(t=>{t.path==s&&(t.title=e)})}}});export{o as a,r as u};
