(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".table-basic-wrapper{height:100%;display:flex;flex-direction:column;background-color:var(--color-fill-2)}.table-basic-wrapper .panel{padding:16px 12px;background-color:var(--color-bg-1)}.table-basic-wrapper .panel.table-panel{margin-top:14px;flex-grow:1}.table-basic-wrapper .form-item-list{overflow:hidden}.form-item-list.up{height:0;opacity:0;transition:height .3s ease-in-out}.table-basic-wrapper .up-down-stripe{width:100%;height:14px;border-top:1px solid var(--color-border);display:flex;justify-content:center;align-items:center;color:rgb(var(--primary-5));cursor:pointer;font-size:12px}.up-down-stripe:hover{border-color:rgb(var(--primary-5));font-size:14px;transition:border-color .3s ease-in-out}.table-basic-wrapper .arco-table-container{flex-grow:1}.table-basic-wrapper .operation-panel{display:flex;justify-content:flex-end}.margin-t-12{margin-top:12px}.margin-t-14{margin-top:14px}.margin-t-16{margin-top:16px}.margin-l-14{margin-left:14px}.padding-b-0{padding-bottom:0!important}.flex{display:flex}.flex-c{display:flex;justify-content:center}.flex-v{display:flex;align-items:center}.flex-b{display:flex;justify-content:space-between}.flex-bv{display:flex;justify-content:space-between;align-items:center}.flex-cv{display:flex;justify-content:center;align-items:center}.flex-e{display:flex;justify-content:flex-end}.flex-g{display:flex;flex-grow:1}.flex-end{display:flex;justify-content:flex-end}.height-100{height:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");function I(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function L(t){return typeof t=="function"?t():e.unref(t)}const q=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const G=t=>typeof t<"u";function J(t){return e.getCurrentInstance()}function K(t,n=!0,r){J()?e.onMounted(t,r):n?t():e.nextTick(t)}function w(t){var n;const r=L(t);return(n=r==null?void 0:r.$el)!=null?n:r}const D=q?window:void 0;function Q(){const t=e.ref(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{t.value=!0},n),t}function X(t){const n=Q();return e.computed(()=>(n.value,!!t()))}function Y(t){return JSON.parse(JSON.stringify(t))}function Z(t,n,r={}){const{window:h=D,...a}=r;let s;const f=X(()=>h&&"ResizeObserver"in h),d=()=>{s&&(s.disconnect(),s=void 0)},k=e.computed(()=>Array.isArray(t)?t.map(l=>w(l)):[w(t)]),_=e.watch(k,l=>{if(d(),f.value&&h){s=new ResizeObserver(n);for(const p of l)p&&s.observe(p,a)}},{immediate:!0,flush:"post"}),g=()=>{d(),_()};return I(g),{isSupported:f,stop:g}}function R(t,n={width:0,height:0},r={}){const{window:h=D,box:a="content-box"}=r,s=e.computed(()=>{var l,p;return(p=(l=w(t))==null?void 0:l.namespaceURI)==null?void 0:p.includes("svg")}),f=e.ref(n.width),d=e.ref(n.height),{stop:k}=Z(t,([l])=>{const p=a==="border-box"?l.borderBoxSize:a==="content-box"?l.contentBoxSize:l.devicePixelContentBoxSize;if(h&&s.value){const u=w(t);if(u){const v=u.getBoundingClientRect();f.value=v.width,d.value=v.height}}else if(p){const u=Array.isArray(p)?p:[p];f.value=u.reduce((v,{inlineSize:b})=>v+b,0),d.value=u.reduce((v,{blockSize:b})=>v+b,0)}else f.value=l.contentRect.width,d.value=l.contentRect.height},r);K(()=>{const l=w(t);l&&(f.value="offsetWidth"in l?l.offsetWidth:n.width,d.value="offsetHeight"in l?l.offsetHeight:n.height)});const _=e.watch(()=>w(t),l=>{f.value=l?n.width:0,d.value=l?n.height:0});function g(){k(),_()}return{width:f,height:d,stop:g}}function ee(t,n,r,h={}){var a,s,f;const{clone:d=!1,passive:k=!1,eventName:_,deep:g=!1,defaultValue:l,shouldEmit:p}=h,u=e.getCurrentInstance(),v=(u==null?void 0:u.emit)||((a=u==null?void 0:u.$emit)==null?void 0:a.bind(u))||((f=(s=u==null?void 0:u.proxy)==null?void 0:s.$emit)==null?void 0:f.bind(u==null?void 0:u.proxy));let b=_;b=b||`update:${n.toString()}`;const x=c=>d?typeof d=="function"?d(c):Y(c):c,B=()=>G(t[n])?x(t[n]):l,i=c=>{p?p(c)&&v(b,c):v(b,c)};if(k){const c=B(),y=e.ref(c);let C=!1;return e.watch(()=>t[n],V=>{C||(C=!0,y.value=x(V),e.nextTick(()=>C=!1))}),e.watch(y,V=>{!C&&(V!==t[n]||g)&&i(V)},{deep:g}),y}else return e.computed({get(){return B()},set(c){i(c)}})}const te={class:"table-basic-wrapper"},U=e.defineComponent({name:"Vue3ArcoTable",__name:"vue3-arco-table",props:{form:{type:Object,default:()=>({})},formData:{type:Object,default:()=>({})},table:{type:Object,default:()=>({})}},emits:["fetchData","reset"],setup(t,{emit:n}){const r=t,h=n,a=ee(r,"formData"),s=e.ref(!0),f=()=>{s.value=!s.value},d=e.computed(()=>({transform:s.value?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"})),k={current:1,pageSize:30},_=()=>{const{pageSize:i}=r.table.pagination;h("fetchData",{...a.value,current:1,pageSize:i})},g=()=>{h("reset")},l=e.computed(()=>{var i;return(i=r.table.columns)==null?void 0:i.filter(c=>c.slotName)}),p=i=>{const{pageSize:c}=r.table.pagination;h("fetchData",{...a.value,pageSize:c,current:i})},u=i=>{h("fetchData",{...a.value,...k,pageSize:i})},v=e.ref(),{height:b}=R(v),x=e.ref(),{height:B}=R(x);return(i,c)=>{const y=e.resolveComponent("a-input"),C=e.resolveComponent("a-form-item"),V=e.resolveComponent("a-col"),T=e.resolveComponent("icon-search"),N=e.resolveComponent("a-button"),z=e.resolveComponent("icon-refresh"),E=e.resolveComponent("icon-double-down"),P=e.resolveComponent("a-space"),O=e.resolveComponent("a-row"),$=e.resolveComponent("a-divider"),M=e.resolveComponent("a-option"),A=e.resolveComponent("a-select"),W=e.resolveComponent("a-date-picker"),j=e.resolveComponent("a-range-picker"),F=e.resolveComponent("a-form"),H=e.resolveComponent("a-table");return e.openBlock(),e.createElementBlock("div",te,[Object.keys(t.form).length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"formPanelRef",ref:v,class:"panel padding-b-0"},[e.createVNode(F,e.mergeProps({model:e.unref(a),"label-col-props":{span:8},"wrapper-col-props":{span:16},"auto-label-width":""},t.form.config,{style:{...t.form.style}}),{default:e.withCtx(()=>[t.form.quickSearch?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(O,{gutter:16},{default:e.withCtx(()=>[e.createVNode(V,{flex:"auto"},{default:e.withCtx(()=>[e.createVNode(C,{field:"hospitalName",label:"快速查询","label-col-props":{span:4},"wrapper-col-props":{span:20}},{default:e.withCtx(()=>[e.createVNode(y,{modelValue:e.unref(a).searchValue,"onUpdate:modelValue":c[0]||(c[0]=o=>e.unref(a).searchValue=o),"allow-clear":"",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(V,{flex:"180px"},{default:e.withCtx(()=>[e.createVNode(P,null,{default:e.withCtx(()=>[e.createVNode(N,{type:"primary",onClick:_},{icon:e.withCtx(()=>[e.createVNode(T)]),default:e.withCtx(()=>[e.createTextVNode(" 搜索 ")]),_:1}),e.createVNode(N,{onClick:g},{icon:e.withCtx(()=>[e.createVNode(z)]),default:e.withCtx(()=>[e.createTextVNode(" 重置 ")]),_:1}),e.createVNode(N,{onClick:f},{icon:e.withCtx(()=>[e.createVNode(E,{style:e.normalizeStyle(d.value)},null,8,["style"])]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(s.value?"收起":"展开"),1)]),_:1})]),_:1})]),_:1})]),_:1}),s.value?(e.openBlock(),e.createBlock($,{key:0,margin:0,style:{"margin-bottom":"16px"}})):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[e.createVNode(O,{gutter:16,class:e.normalizeClass(["form-item-list",s.value?"down":"up"])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.list,(o,S)=>(e.openBlock(),e.createBlock(V,{key:S,span:6},{default:e.withCtx(()=>[o.type!=="slot"?(e.openBlock(),e.createBlock(C,{key:0,field:o.key,label:o.label},{default:e.withCtx(()=>[o.type==="select"?(e.openBlock(),e.createBlock(A,e.mergeProps({key:0,modelValue:e.unref(a)[o.key],"onUpdate:modelValue":m=>e.unref(a)[o.key]=m,"allow-clear":"",placeholder:o.placeholder?o.placeholder:"请选择"+o.label,ref_for:!0},o.config),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,m=>(e.openBlock(),e.createBlock(M,{key:m.value,value:m.value,label:m.label},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.label),1)]),_:2},1032,["value","label"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder"])):e.createCommentVNode("",!0),o.type==="input"?(e.openBlock(),e.createBlock(y,e.mergeProps({key:1,modelValue:e.unref(a)[o.key],"onUpdate:modelValue":m=>e.unref(a)[o.key]=m,"allow-clear":"",placeholder:o.placeholder?o.placeholder:"请输入"+o.label,ref_for:!0},o.config),null,16,["modelValue","onUpdate:modelValue","placeholder"])):e.createCommentVNode("",!0),o.type==="datePicker"?(e.openBlock(),e.createBlock(W,e.mergeProps({key:2,modelValue:e.unref(a)[o.key],"onUpdate:modelValue":m=>e.unref(a)[o.key]=m,ref_for:!0},o.config),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),o.type==="dateRangePicker"?(e.openBlock(),e.createBlock(j,e.mergeProps({key:3,modelValue:e.unref(a)[o.key],"onUpdate:modelValue":m=>e.unref(a)[o.key]=m,ref_for:!0},o.config),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["field","label"])):e.renderSlot(i.$slots,o.slotName,{key:1})]),_:2},1024))),128)),t.form.quickSearch?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V,{key:0,span:6},{default:e.withCtx(()=>[e.createVNode(C,{label:""},{default:e.withCtx(()=>[e.createVNode(P,null,{default:e.withCtx(()=>[e.createVNode(N,{type:"primary",onClick:_},{icon:e.withCtx(()=>[e.createVNode(T)]),default:e.withCtx(()=>[e.createTextVNode(" 搜索 ")]),_:1}),e.createVNode(N,{onClick:g},{icon:e.withCtx(()=>[e.createVNode(z)]),default:e.withCtx(()=>[e.createTextVNode(" 重置 ")]),_:1})]),_:1})]),_:1})]),_:1}))]),_:3},8,["class"])]),_:3})]),_:3},16,["model","style"]),t.form.showExpand?(e.openBlock(),e.createElementBlock("div",{key:0,class:"up-down-stripe",onClick:f},[e.createVNode(E,{style:e.normalizeStyle(d.value)},null,8,["style"])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"panel table-panel",style:e.normalizeStyle({height:`calc(100% - ${e.unref(b)}px - 46px)`})},[e.createElementVNode("div",{ref_key:"buttonsRef",ref:x,class:"operation-panel"},[e.renderSlot(i.$slots,"buttons")],512),e.createElementVNode("div",{class:"table-wrapper",style:e.normalizeStyle({height:`calc(100% - ${e.unref(B)}px)`})},[e.createVNode(H,e.mergeProps({ref:"tableRef",columns:t.table.columns,data:t.table.data,"row-key":"id",pagination:t.table.pagination,size:"mini"},i.$attrs,{"column-resizable":"",bordered:{cell:!0},onPageChange:p,onPageSizeChange:u}),e.createSlots({_:2},[e.renderList(l.value,o=>({name:o.slotName,fn:e.withCtx(({record:S,rowIndex:m})=>[e.renderSlot(i.$slots,o.slotName,{record:S,rowIndex:m})])}))]),1040,["columns","data","pagination"])],4)],4)])}}}),oe={install(t,n){const r=(n==null?void 0:n.name)??"Vue3ArcoTable";t.component(r,U)}};exports.Vue3ArcoTable=U;exports.default=oe;