import{u as l,w as p}from"./xlsx-e927f539.js";const h={class:"font-medium"},f={class:"h-[25rem] mt-3"},x=Vue.defineComponent({name:"Excel"}),k=Vue.defineComponent({...x,setup(C){const d=(o=10,t="column-",n)=>Array.from({length:o}).map((r,e)=>({...n,key:`${t}${e}`,dataKey:`${t}${e}`,title:`Column ${e}`,width:150})),V=(o,t=200,n="row-")=>Array.from({length:t}).map((r,e)=>o.reduce((a,u,s)=>(a[u.dataKey]=`Row ${e} - Col ${s}`,a),{id:`${n}${e}`,parentId:null})),c=d(10),_=V(c,1e3),i=()=>{const o=_.map(e=>{const a=[];return c.forEach(u=>{a.push(e[u.dataKey])}),a}),t=[];c.forEach(e=>{t.push(e.title)}),o.unshift(t);const n=l.aoa_to_sheet(o),r=l.book_new();l.book_append_sheet(r,n,"数据报表"),p(r,"tableV2.xlsx")};return(o,t)=>{const n=Vue.resolveComponent("el-link"),r=Vue.resolveComponent("el-button"),e=Vue.resolveComponent("el-table-v2"),a=Vue.resolveComponent("el-auto-resizer"),u=Vue.resolveComponent("el-card");return Vue.openBlock(),Vue.createBlock(u,{shadow:"never"},{header:Vue.withCtx(()=>[Vue.createElementVNode("div",h,[Vue.createTextVNode(" 导出Execl（ "),Vue.createVNode(n,{href:"https://github.com/SheetJS/sheetjs",target:"_blank",style:{"font-size":"16px",margin:"0 5px 4px 0"}},{default:Vue.withCtx(()=>[Vue.createTextVNode(" github地址 ")]),_:1}),Vue.createTextVNode(" ） ")])]),default:Vue.withCtx(()=>[Vue.createVNode(r,{type:"primary",onClick:i},{default:Vue.withCtx(()=>[Vue.createTextVNode("导出Excel")]),_:1}),Vue.createElementVNode("div",f,[Vue.createVNode(a,null,{default:Vue.withCtx(({height:s,width:m})=>[Vue.createVNode(e,{columns:Vue.unref(c),data:Vue.unref(_),width:m,height:s,fixed:""},null,8,["columns","data","width","height"])]),_:1})])]),_:1})}}});export{k as default};
