import{y as e,m as s,z as t}from"./index-d052b22f-1780912037814v=1.0.0.js";const a=e({id:"KeepAliveStore",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}}}),i=a(),n=e({id:"TabsState",state:()=>({tabsMenuList:[]}),actions:{async addTabs(e){-1==e.path.indexOf("id=")&&"详情"===e.title&&(e.title="新增"),this.tabsMenuList.every((s=>s.path!==e.path))&&this.tabsMenuList.push(e),!i.keepAliveName.includes(e.name)&&e.isKeepAlive&&i.addKeepAliveName(e.name)},async removeTabs(e,t=!0){const a=this.tabsMenuList;t&&a.forEach(((t,i)=>{if(t.path!==e)return;const n=a[i+1]||a[i-1];n&&s.push(n.path)})),this.tabsMenuList=a.filter((s=>s.path!==e))},async closeMultipleTab(e){this.tabsMenuList=this.tabsMenuList.filter((s=>s.path===e||!s.close))},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)}))}},persist:t("TabsState_project")});export{a as K,n as T};
