import{a2 as e,s as a,r as s,u as r,J as t,E as o}from"./index-d052b22f-1780912037814v=1.0.0.js";import{T as l,K as i}from"./tabs-f13d13c5-1780912037814v=1.0.0.js";const m=()=>{const m=e(),n=a((()=>m.companyAreaId)),u=s(!1),f=s(),c=r(),d=t(),v=l(),p=i();return{BaseCompanyAreaId:n,closeCurrent:(e,a)=>{if(e)return v.removeTabs(e),void p.removeKeepAliveName(a);c.meta.isAffix||(v.removeTabs(c.fullPath),p.removeKeepAliveName(c.name),d.back())},ruleFormRef:f,setTitle:e=>{v.setTabsTitle(e)},addMethod:(e,a,s="新增成功")=>{if(!u.value)return new Promise((async r=>{let t=await e(a);200==t.code?(o.success(s),r({flag:!0,...t})):r({flag:!1,...t}),u.value=!1}))},updateMethod:(e,a,s="更新成功")=>{if(!u.value)return new Promise((async r=>{let t=await e(a);200==t.code?(o.success(s),r({flag:!0,...t})):r({flag:!1,...t}),u.value=!1}))},loading:u}};export{m as u};
