import{B}from"./Table-0PViRYCf.js";import{_ as N}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{g as j}from"./list-I2I5D8gr.js";import{c as D}from"./basicColumns-TMDwil-f.js";import{j as m}from"./index-JLzXwmNm.js";import{d as S,u as R,ar as E,r as p,a as u,Z as H,h as V,o as A,i as O,j as o,w as n,p as s,W as $,l as a,H as q,B as z}from"./index-9PRMimni.js";import"./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./componentMap-CElCaWis.js";import"./propTypes-CebMRUpe.js";import"./format-DgF6KtHk.js";import"./omit-B2_8Y6O_.js";import"./_flatRest-DBrd2CHT.js";import"./flatten-DeoUZLdb.js";import"./print-CT_2hrjP.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./useModal-CO65vga3.js";import"./componentSetting-DVhNDBTO.js";import"./useTimeout-BxFilWvD.js";import"./usePageCache-DluHn7Yy.js";import"./tabsView-BXskTdVh.js";import"./Flex-CTSf12gq.js";import"./index-C-XHZLOy.js";import"./xlsx-GLiMJrM3.js";const I={class:"n-layout-page-header"},ft=S({__name:"jsonExport",setup(J){const r=R(),d=E(),f=p(),i=p(),_=u({pageSize:5,name:"NaiveAdmin"}),g=u({width:150,title:"操作",key:"action",fixed:"right",align:"center",render(t){return H(N,{style:"button",actions:b(t)})}});function b(t){return[{label:"删除",onClick:h.bind(null,t),ifShow:()=>!0,auth:["basic_list"]},{label:"编辑",onClick:y.bind(null,t),ifShow:()=>!0,auth:["basic_list"]}]}const k=async t=>{const e=await j({..._,...t});return i.value=e.list,e};function x(t){console.log(t)}function h(t){console.log(t),d.info({title:"提示",content:`您想删除${t.name}`,positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{r.success("删除成功")},onNegativeClick:()=>{}})}function y(t){console.log(t),r.success("您点击了编辑按钮")}function C(){m({data:a(i),filename:"使用key作为默认表头.xlsx"})}function T(){m({data:a(i),header:{id:"ID",no:"编码",name:"名称",avatar:"头像",address:"地址",beginTime:"开始日期",endTime:"结束时间",status:"状态",date:"创建时间",time:"停留时间"},filename:"自定义表头.xlsx",json2sheetOpts:{}})}return(t,e)=>{const l=$,c=z,v=q;return A(),V("div",null,[O("div",I,[o(l,{bordered:!1,title:"导出示例"},{default:n(()=>e[0]||(e[0]=[s(" 根据JSON格式的数据进行导出 ")])),_:1})]),o(l,{bordered:!1,class:"mt-3 proCard"},{default:n(()=>[o(a(B),{title:"表格列表",titleTooltip:"这是一个提示",columns:a(D),request:k,"row-key":w=>w.id,ref_key:"actionRef",ref:f,actionColumn:g,"scroll-x":1360,"onUpdate:checkedRowKeys":x},{tableTitle:n(()=>[o(v,null,{default:n(()=>[o(c,{type:"primary",onClick:T},{default:n(()=>e[1]||(e[1]=[s("导出自定义表头")])),_:1}),o(c,{type:"primary",onClick:C},{default:n(()=>e[2]||(e[2]=[s("导出默认表头")])),_:1})]),_:1})]),_:1},8,["columns","row-key","actionColumn"])]),_:1})])}}});export{ft as default};
