import{B as O}from"./Table-0PViRYCf.js";import{_ as U}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{_ as V}from"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import{u as j}from"./useModal-CO65vga3.js";import{B as q}from"./BasicForm-dL_oCSPM.js";import{u as A}from"./useForm-CKmgcynv.js";import{g as E}from"./list-I2I5D8gr.js";import{c as F}from"./basicColumns-TMDwil-f.js";import{j as z}from"./index-JLzXwmNm.js";import{d as I,u as L,ar as W,r as c,a as u,Z as G,h as J,o as K,i as X,j as s,w as n,p as d,W as Z,l as t,B as H,k as Q}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"./componentSetting-DVhNDBTO.js";import"./useTimeout-BxFilWvD.js";import"./usePageCache-DluHn7Yy.js";import"./tabsView-BXskTdVh.js";import"./Flex-CTSf12gq.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./ImageUpload-DUsnro3W.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";import"./BasicSelect-C_uwzMkE.js";import"./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";import"./dictionary-BRse4lkf.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./AutoComplete-Dv1Bqed4.js";import"./TreeSelect-BZh2DeCh.js";import"./index-C-XHZLOy.js";import"./xlsx-GLiMJrM3.js";const Y={class:"n-layout-page-header"},Fe=I({__name:"choiceExport",setup(ee){const f=[{field:"filename",component:"NInput",label:"文件名",labelMessage:"导出的文件以该名称命名",giProps:{span:1},componentProps:{placeholder:"请输入文件名称",onInput:e=>{console.log(e)}},rules:[{required:!0,message:"请输入导出的文件名称",trigger:["blur"]}]},{field:"bookType",component:"NSelect",label:"文件类型",componentProps:{placeholder:"请选择文件类型",options:[{label:"xlsx",value:"xlsx"},{label:"html",value:"html"},{label:"csv",value:"csv"},{label:"txt",value:"txt"}],onUpdateValue:e=>{console.log(e)}},rules:[{required:!0,message:"请选择文件类型",trigger:["change"]}]}],a=L(),g=W(),_=c(),r=c(),m=c(),b=u({pageSize:5,name:"NaiveAdmin"}),[h,{openModal:k}]=j({title:"导出数据"}),[v,{submit:x}]=A({gridProps:{cols:1},collapsedRows:3,labelWidth:120,layout:"horizontal",showActionButtonGroup:!1,schemas:f}),y=u({width:150,title:"操作",key:"action",fixed:"right",align:"center",render(e){return G(U,{style:"button",actions:C(e)})}});async function R(){await x()?(r.value.closeModal(),a.success("提交成功")):(a.error("验证失败，请填写完整信息"),r.value.setSubLoading(!1))}function w(e){console.log(e)}function C(e){return[{label:"删除",onClick:S.bind(null,e),ifShow:()=>!0,auth:["basic_list"]},{label:"编辑",onClick:N.bind(null,e),ifShow:()=>!0,auth:["basic_list"]}]}const T=async e=>{const o=await E({...b,...e});return m.value=o.list,o};function B(e){console.log(e)}function S(e){console.log(e),g.info({title:"提示",content:`您想删除${e.name}`,positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{a.success("删除成功")},onNegativeClick:()=>{}})}function N(e){console.log(e),a.success("您点击了编辑按钮")}function M(e){console.log(e);const{filename:o,bookType:i}=e;z({data:t(m),filename:`${o.split(".").shift()}.${i}`,write2excelOpts:{bookType:i}}),a.success(JSON.stringify(e))}return(e,o)=>{const i=Z,$=H,P=Q;return K(),J("div",null,[X("div",Y,[s(i,{bordered:!1,title:"导出示例"},{default:n(()=>o[0]||(o[0]=[d(" 可以选择导出格式 ")])),_:1})]),s(i,{bordered:!1,class:"mt-3 proCard"},{default:n(()=>[s(t(O),{title:"表格列表",titleTooltip:"这是一个提示",columns:t(F),request:T,"row-key":l=>l.id,ref_key:"actionRef",ref:_,actionColumn:y,"scroll-x":1360,"onUpdate:checkedRowKeys":B},{tableTitle:n(()=>[s($,{type:"primary",onClick:t(k)},{default:n(()=>o[1]||(o[1]=[d("导出数据")])),_:1},8,["onClick"])]),_:1},8,["columns","row-key","actionColumn"])]),_:1}),s(t(V),{onRegister:t(h),ref_key:"modalRef",ref:r,onOnOk:R},{default:n(()=>[s(t(q),{onRegister:t(v),onSubmit:M,onReset:w,class:"basicForm"},{statusSlot:n(({model:l,field:p})=>[s(P,{value:l[p],"onUpdate:value":D=>l[p]=D},null,8,["value","onUpdate:value"])]),_:1},8,["onRegister"])]),_:1},8,["onRegister"])])}}});export{Fe as default};
