System.register(["./index-legacy-26fae7cb-1706882452509.js"],(function(e,t){"use strict";var a,s,i,r,p,h,n,o,c,g;return{setters:[e=>{a=e.d,s=e.a,i=e.e,r=e.r,p=e.p,h=e.O,n=e.y,o=e.U,c=e.f,g=e.dm}],execute:function(){var t=document.createElement("style");t.textContent="._pagination_10j50_1{margin-top:.625vw;justify-content:flex-end;--n-item-size: max(2.08333333vw, 36Px) !important}\n",document.head.appendChild(t);class l{saveKey="searchs";initSearch={form:{},page:{}};searchs={};key="";constructor(e){this.key=e,this.searchs=this.parse()}save(){localStorage.setItem(this.saveKey,JSON.stringify(this.searchs))}parse(){let e={...u};try{const t=localStorage.getItem(this.saveKey);e=JSON.parse(t)||e}catch(t){}return e}get(e){const t=e||this.key;return this.searchs[t]||(this.searchs[t]={...u}),this.searchs[t]}remove(e){return this.searchs&&this.searchs[this.key]&&(e?delete this.searchs[this.key][e]:delete this.searchs[this.key],this.save()),this.searchs}getSearchs(){return this.searchs}removeByKey(e){return console.log("真正的删",e),delete this.searchs[e],this.save(),this.searchs}removeAll(){return this.searchs={},localStorage.setItem(this.saveKey,JSON.stringify(this.searchs)),this.searchs}removeByRouter(e){this.searchs=this.parse();for(const t in this.searchs)e!==t&&e!==this.searchs[t]?.bind||(console.log("清除的页面",t),this.removeByKey(t))}removeByOtherRouter(e){this.searchs=this.parse();for(const t in this.searchs)e===t||e===this.searchs[t]?.bind||this.removeByKey(t)}update(e,t,a){this.searchs=this.parse();const s=t||this.key;return this.searchs[s]||(this.searchs[s]={...u}),a?this.searchs[s][a]=e:this.searchs[s]=e,this.save(),this.searchs}}e("S",l);const u={form:{},page:{}},y="_pagination_10j50_1";e("P",a({name:"table-container",props:{page:{type:Number,default:1,required:!0},pageSize:{type:Number,default:10},pageTotal:{type:Number,default:0},saveKey:{type:String,default:""},sync:{type:Boolean,default:!1},checkedRowKeysRef:{type:Object},pageSizes:{type:Array,default:()=>[10,20,30,40]}},emits:["update:page","update:pageSize","list"],setup(e,{emit:t}){const a=s(),u=i({pageInformation:null}),d=r(0);d.value=Math.ceil(e.pageTotal/e.pageSize);const v=e=>{t("update:page",e),t("list"),f()},m=e=>{t("update:pageSize",e),t("list"),f()};p((()=>{if(e.sync){const s=new l(e.saveKey||a.path),i=s.get(e.saveKey||a.path);if(u.pageInformation=i,i&&i.page)for(const e in i.page)if(i.page.hasOwnProperty(e)&&["page","pageSize"].includes(e)){const a=i.page[e];t(`update:${e}`,a)}e.saveKey&&s.update(a.path,void 0,"bind")}window.addEventListener("watchStorage",z)})),h((()=>{window.removeEventListener("watchStorage",z)})),n((()=>e.pageSize),(()=>{d.value=Math.ceil(e.pageTotal/e.pageSize),f()})),n((()=>e.page),(()=>{f()})),n((()=>e.pageTotal),(()=>{d.value=Math.ceil(e.pageTotal/e.pageSize),f()}));const S=o({get:()=>e.page,set(e){t("update:page",e)}}),f=()=>{e.sync&&new l(e.saveKey||a.path).update({page:e.page,pageCount:d.value,pageSize:e.pageSize,saveKey:e.saveKey},void 0,"page")},z=()=>{const e=u.pageInformation&&u.pageInformation.page?u.pageInformation.page:null;S.value=e&&e.page?e.page:1};return()=>c(g,{class:y,page:e.page,"onUpdate:page":t=>e.page=t,displayOrder:["quick-jumper","pages","size-picker"],pageCount:d.value,showQuickJumper:!0,showSizePicker:!0,pageSize:e.pageSize,prefix:()=>`共 ${e.pageTotal} 条`,pageSizes:e.pageSizes,onUpdatePage:v,onUpdatePageSize:m},null)}}))}}}));
