import{P as v,Q as z,w as R,D as k,C as N,F as S}from"./element-plus.8e273e86.js";import{f as _}from"./index.a39f73a6.js";import{P as U}from"./index.1c24829c.js";import{d as q,s as E,Z as x,o as y,c as L,U as u,L as o,R as m,a as f,u as a,S as F,K as O,Q as P}from"./@vue.76ce7aa3.js";const j={class:"export-data"},I={class:"flex"},K=q({__name:"index",props:{params:{type:Object,default:()=>({})},pageSize:{type:Number,default:25},fetchFun:{type:Function,required:!0}},setup(A){const g=E(),s=A,B=E(),t=x({page_type:0,page_start:1,page_end:200,file_name:""}),b={page_start:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D77\u59CB\u9875\u7801"},{type:"number",message:"\u9875\u7801\u5FC5\u987B\u662F\u6574\u6570"},{validator:(l,e,r)=>{if(e<=0)return r(new Error("\u9875\u7801\u5FC5\u987B\u5927\u4E8E0"));r()}}],page_end:[{required:!0,message:"\u8BF7\u8F93\u5165\u7ED3\u675F\u9875\u7801"},{type:"number",message:"\u9875\u7801\u5FC5\u987B\u662F\u6574\u6570"},{validator:(l,e,r)=>{if(e<=0)return r(new Error("\u9875\u7801\u5FC5\u987B\u5927\u4E8E0"));r()}}]},d=x({count:0,sum_page:0,page_size:0,max_page:0,all_max_size:0}),C=async()=>{const l=await s.fetchFun({...s.params,page_size:s.pageSize,export:1});Object.assign(d,l),t.file_name=l.file_name,t.page_end=l.page_end,t.page_start=l.page_start},V=async()=>{var l,e;await((l=g.value)==null?void 0:l.validate()),_.loading("\u6B63\u5728\u5BFC\u51FA\u4E2D...");try{await s.fetchFun({...s.params,...t,page_size:s.pageSize,export:2}),(e=B.value)==null||e.close(),_.closeLoading()}catch{_.closeLoading()}};return C(),(l,e)=>{const r=R,n=k,c=v,w=z,i=N,D=S;return y(),L("div",j,[u(U,{ref_key:"popupRef",ref:B,title:"\u5BFC\u51FA\u8BBE\u7F6E",width:"500px","confirm-button-text":"\u786E\u8BA4\u5BFC\u51FA",onConfirm:V,async:!0,onOpen:C},{trigger:o(()=>[u(r,null,{default:o(()=>e[4]||(e[4]=[m("\u5BFC\u51FA")])),_:1})]),default:o(()=>[f("div",null,[u(D,{ref_key:"formRef",ref:g,model:a(t),"label-width":"120px",rules:b},{default:o(()=>[u(n,{label:"\u6570\u636E\u91CF\uFF1A"},{default:o(()=>[m(" \u9884\u8BA1\u5BFC\u51FA"+F(a(d).count)+"\u6761\u6570\u636E\uFF0C \u5171"+F(a(d).sum_page)+"\u9875\uFF0C\u6BCF\u9875"+F(a(d).page_size)+"\u6761\u6570\u636E ",1)]),_:1}),u(n,{label:"\u5BFC\u51FA\u9650\u5236\uFF1A"},{default:o(()=>[m(" \u6BCF\u6B21\u5BFC\u51FA\u6700\u5927\u5141\u8BB8"+F(a(d).max_page)+"\u9875\uFF0C\u5171"+F(a(d).all_max_size)+"\u6761\u6570\u636E ",1)]),_:1}),u(n,{prop:"page_type",label:"\u5BFC\u51FA\u8303\u56F4\uFF1A",required:""},{default:o(()=>[u(w,{modelValue:a(t).page_type,"onUpdate:modelValue":e[0]||(e[0]=p=>a(t).page_type=p)},{default:o(()=>[u(c,{label:0},{default:o(()=>e[5]||(e[5]=[m("\u5168\u90E8\u5BFC\u51FA")])),_:1}),u(c,{label:1},{default:o(()=>e[6]||(e[6]=[m("\u5206\u9875\u5BFC\u51FA")])),_:1})]),_:1},8,["modelValue"])]),_:1}),a(t).page_type==1?(y(),O(n,{key:0,label:"\u5206\u9875\u8303\u56F4\uFF1A"},{default:o(()=>[f("div",I,[u(n,{prop:"page_start"},{default:o(()=>[u(i,{style:{width:"140px"},modelValue:a(t).page_start,"onUpdate:modelValue":e[1]||(e[1]=p=>a(t).page_start=p),modelModifiers:{number:!0},placeholder:""},null,8,["modelValue"])]),_:1}),e[7]||(e[7]=f("span",{class:"flex-none ml-2 mr-2"},"\u9875\uFF0C\u81F3",-1)),u(n,{prop:"page_end"},{default:o(()=>[u(i,{style:{width:"140px"},modelValue:a(t).page_end,"onUpdate:modelValue":e[2]||(e[2]=p=>a(t).page_end=p),modelModifiers:{number:!0},placeholder:""},null,8,["modelValue"])]),_:1})])]),_:1})):P("",!0),u(n,{label:"\u5BFC\u51FA\u6587\u4EF6\u540D\u79F0\uFF1A",prop:"file_name"},{default:o(()=>[u(i,{modelValue:a(t).file_name,"onUpdate:modelValue":e[3]||(e[3]=p=>a(t).file_name=p),placeholder:"\u8BF7\u8F93\u5165\u5BFC\u51FA\u6587\u4EF6\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])]),_:1},512)])}}});export{K as _};
