| 123456789 |
- /**
- * 由 Fantastic-admin 提供技术支持
- * Powered by Fantastic-admin
- * Gitee https://gitee.com/hooray/fantastic-admin
- * Github https://github.com/hooray/fantastic-admin
- */
-
- import{u as P}from"./settings-be8974ad.js";import{f as p}from"./menu-2c9c5182.js";import{u as T,b as R}from"./vue-router-8a13d09b.js";import{aU as c}from"./index-5cddd228.js";function O(){const d=T(),r=R(),f=P(),t=p();function o(){return f.settings.tabbar.mergeTabsBy==="activeMenu"?d.meta.activeMenu??d.fullPath:d.fullPath}function u(e){const n=t.list.findIndex(i=>i.tabId===o());t.$patch({leaveIndex:n}),r.push(e)}function a(e){const n=o();r.push(e).then(()=>{t.remove(n)})}function h(e=o()){const n=o();if(t.list.some(i=>i.tabId===e))if(t.list.length>1)if(e===n){const i=t.list.findIndex(l=>l.tabId===e);i<t.list.length-1?a(t.list[i+1].fullPath):a(t.list[i-1].fullPath)}else t.remove(e);else c.error("当前只有一个标签页,已阻止关闭");else c.error("关闭的页面不存在")}function I(e=o()){const n=o();if(e!==n){const i=t.list.findIndex(l=>l.tabId===e);r.push(t.list[i].fullPath)}t.removeOtherSide(e)}function x(e=o()){const n=o();if(e!==n){const i=t.list.findIndex(s=>s.tabId===e);t.list.findIndex(s=>s.tabId===n)<i&&r.push(t.list[i].fullPath)}t.removeLeftSide(e)}function b(e=o()){const n=o();if(e!==n){const i=t.list.findIndex(s=>s.tabId===e);t.list.findIndex(s=>s.tabId===n)>i&&r.push(t.list[i].fullPath)}t.removeRightSide(e)}function m(e=o()){return t.list.some(n=>!n.isPermanent&&!n.isPin&&n.tabId!==e)}function v(e=o()){let n=!0;if(e===t.list[0].tabId)n=!1;else{const i=t.list.findIndex(l=>l.tabId===e);n=t.list.some((l,s)=>s<i&&!l.isPermanent&&!l.isPin&&l.tabId!==e)}return n}function S(e=o()){var i;let n=!0;if(e===((i=t.list.at(-1))==null?void 0:i.tabId))n=!1;else{const l=t.list.findIndex(s=>s.tabId===e);n=t.list.some((s,g)=>g>=l&&!s.isPermanent&&!s.isPin&&s.tabId!==e)}return n}return{getId:o,open:u,closeById:h,close:a,closeOtherSide:I,closeLeftSide:x,closeRightSide:b,checkCloseOtherSide:m,checkCloseLeftSide:v,checkCloseRightSide:S}}export{O as u};
|