import{p as M}from"./pay_type-08065387.js";import{c as U,_ as A,a as L,l as E,d as G}from"./detail.vue_vue_type_script_setup_true_lang-bab8a505.js";import{b as H}from"./base-847c52cc.js";import{p as I}from"./global-0d825ba6.js";import{u as q,d as J}from"./index-c2dd6a24.js";import K from"./search-e59a7e39.js";import{M as i,y as Q,R as W,B as X,L as Y,S as Z,j as ee,b as ae}from"./ui-ba7aaa7e.js";import{e as te,r,l as oe,d as S,M as se,P as v,a3 as y,a4 as t,a7 as p,ab as ne,a9 as le,f as o,H as s,I as ie,A as re}from"./vue-bf422dc1.js";import"./date-20546ee0.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";import"./collection-1a561a8a.js";const ce={class:"category-header c-flex"},de={class:"category-header c-flex"},ue={class:"l"},pe={class:"r c-flex"},Ve=te({__name:"index",setup(fe){const n=r({defaultPageSize:20,total:0,defaultCurrent:1}),m=r([]),c=oe({}),f=r(!1),b=S(()=>f.value?"收起搜索":"展开搜索"),g=r(""),k=e=>{c.date_type=e,h()},T=async()=>{const e=await L();e.code===1?(i.success(e.msg),d()):i.error(e.msg)},h=async(e={})=>{Object.assign(c,e),n.value.defaultPageSize=20,delete c.action,d()},d=async()=>{const e={page:n.value.defaultCurrent,limit:n.value.defaultPageSize,...c},a=await E(e);c.action==="dump"?a.code===1?(i.success(a.msg),J(a.data.url)):i.error(a.msg):(m.value=a.data.list,n.value={...n.value,total:a.data.total})};d();const w=e=>{n.value.defaultCurrent=e.current,n.value.defaultPageSize=e.pageSize,d()},C=r(),P=e=>{var a;(a=C.value)==null||a.init(e)},R=async e=>{const a=await G({id:e.id});a.code===1?(i.success(a.msg),d()):i.error(a.msg)},_=r();(async()=>{const{data:e}=await M();e.forEach((a,l)=>{e[l].ico=H+a.ico}),_.value=e})();const D=q(),V=S(()=>({offsetTop:D.isUseTabsRouter?48:0,container:`.${I}-layout`}));return(e,a)=>{const l=Q,z=W,B=X,x=Y,$=Z,F=ee,N=ae,O=se("perms");return v(),y(N,{title:"订单列表",class:"basic-container",bordered:!1},{actions:t(()=>[p("a",{href:"javascript:void(0)",onClick:a[0]||(a[0]=u=>f.value=!f.value)},ne(b.value),1)]),default:t(()=>[p("div",ce,[f.value?(v(),y(K,{key:0,ref:"searchFormRef","pay-type-options":_.value,onSuccess:h},null,8,["pay-type-options"])):le("",!0)]),p("div",de,[p("div",ue,[o(z,{modelValue:g.value,"onUpdate:modelValue":a[1]||(a[1]=u=>g.value=u),"default-value":"1",onChange:k},{default:t(()=>[o(l,{value:""},{default:t(()=>[s("全部")]),_:1}),o(l,{value:"1"},{default:t(()=>[s("今日")]),_:1}),o(l,{value:"2"},{default:t(()=>[s("昨日")]),_:1}),o(l,{value:"3"},{default:t(()=>[s("本周")]),_:1}),o(l,{value:"4"},{default:t(()=>[s("本月")]),_:1}),o(l,{value:"5"},{default:t(()=>[s("本年")]),_:1})]),_:1},8,["modelValue"])]),p("div",pe,[o(B,{onClick:T},{default:t(()=>[s("清空无效")]),_:1})])]),o(F,{size:"small",data:m.value,columns:ie(U),"row-key":"id","vertical-align":"middle",hover:m.value.length>0,pagination:n.value,"header-affixed-top":V.value,"table-layout":"fixed","max-height":"100%",onPageChange:w},{operate:t(({row:u})=>[o($,null,{default:t(()=>[o(x,{theme:"primary",onClick:j=>P(u)},{default:t(()=>[s("详情")]),_:2},1032,["onClick"]),re((v(),y(x,{theme:"danger",onClick:j=>R(u)},{default:t(()=>[s("删除")]),_:2},1032,["onClick"])),[[O,["adminapi/order/order/del"]]])]),_:2},1024)]),empty:t(()=>[]),_:1},8,["data","columns","hover","pagination","header-affixed-top"]),o(A,{ref_key:"detailRef",ref:C,"pay-type-options":_.value},null,8,["pay-type-options"])]),_:1})}}});export{Ve as default};
