PageSourceSearch

https://nananumberune-lilliellm.hf.space/assets/index-Cst2qIDK.js

js nananumberune-lilliellm.hf.space collected 2026-10-03 17:09:49 UTC 26,144 bytes, 1 lines download raw bytes

1import{u as M,r as l,j as e,x as ve,I as Je,b as D,K as Ze,M as A,D as Se,e as Ce,f as Te,d as G,s as E,P as w,S as ae,a as Xe,h as ea,o as B,w as me,p as de,k as Ie,Y as ue,B as Q,Z as He,v as ke,_ as Fe,Q as Oe,av as aa,aw as ta,X as na}from"./index-hwfaCoK0.js";import{T as ra}from"./Switch-CJFoVVlM.js";import{T as Ge,d as Le,a as Be,c as De}from"./TableRow-CjMn7dQm.js";import{T as m}from"./TableCell-Bi9oImna.js";import{T as We}from"./TextField-DbqYwM0n.js";import{D as sa}from"./DialogContentText-COCJdEXR.js";import{D as qe}from"./DialogActions-Cs74ze7K.js";import{K as Re}from"./TableHead-DjKq1Z7n.js";import"./zh-cn-BglHh9qf.js";import{F as g}from"./FormControl-CP8COfS3.js";import{I as P,F as C}from"./InputLabel-2J538q5F.js";import{O as k}from"./OutlinedInput-CG0-iJqt.js";import{S as U}from"./Select-bgQZwFPI.js";import{F as la,c as oa,a as ie,d as ge,e as ia}from"./array-Dk_VeQs9.js";import{g as Ae,P as Me,s as $e}from"./CommonConstants-BmHHPz5Y.js";import{B as Ee}from"./ButtonGroup-BNgbnubx.js";import{T as Ve}from"./TablePagination-ch5TAf38.js";import{L as ca}from"./Label-B6-saUUq.js";import{L as be,A as je,d as pe}from"./AdapterDayjs-Clqh3QOQ.js";import{D as fe}from"./DateTimePicker-C1anz15W.js";import{T as da,a as _e}from"./Tabs-DJXewfBR.js";import"./Switch-xY4gJKOe.js";import"./SwitchBase-BXAw3zvC.js";import"./getValidReactChildren-DkQV8e6I.js";import"./KeyboardArrowRight-1SrKaIYH.js";import"./LastPage-C6dsfjym.js";import"./InputAdornment-y0-thtzW.js";import"./ListItem-DgwN9xT5.js";const ye={epay:"易支付",alipay:"支付宝",wxpay:"微信支付",stripe:"Stripe"},pa={CNY:"人民币",USD:"美元"},ce={epay:{pay_domain:{name:"支付域名",description:"支付域名",type:"text",value:""},partner_id:{name:"商户号",description:"商户号",type:"text",value:""},key:{name:"密钥",description:"密钥",type:"text",value:""},pay_type:{name:"支付类型",description:"支付类型,如果需要跳转到易支付收银台,请选择收银台",type:"select",value:"",options:[{name:"收银台",value:""},{name:"支付宝",value:"alipay"},{name:"微信",value:"wxpay"},{name:"QQ",value:"qqpay"},{name:"京东",value:"jdpay"},{name:"银联",value:"bank"},{name:"Paypal",value:"paypal"},{name:"USDT",value:"usdt"}]}},alipay:{app_id:{name:"应用ID",description:"支付宝应用ID",type:"text",value:""},private_key:{name:"应用私钥",description:"应用私钥,开发者自己生成,详细参考官方文档 https://opendocs.alipay.com/common/02kipl?pathHash=84adb0fd",type:"text",value:""},public_key:{name:"支付宝公钥",description:"支付宝公钥,详细参考官方文档 https://opendocs.alipay.com/common/02kdnc?pathHash=fb0c752a",type:"text",value:""},pay_type:{name:"支付类型",description:"支付类型,需要您再支付宝开发者中心开通相关权限才可以使用对应类型支付方式",type:"select",value:"",options:[{name:"当面付",value:"facepay"},{name:"电脑网站支付",value:"pagepay"},{name:"手机网站支付",value:"wappay"}]}},wxpay:{app_id:{name:"AppID",description:"应用ID 详见https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_7_1.shtml",type:"text",value:""},mch_id:{name:"商户号",description:"微信商户号 详见https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_7_1.shtml",type:"text",value:""},mch_certificate_serial_number:{name:"商户证书序列号",description:"商户证书序列号 详见https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_7_1.shtml",type:"text",value:""},mch_apiv3_key:{name:"商户APIv3密钥",description:"商户APIv3密钥 详见https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_7_1.shtml",type:"text",value:""},mch_private_key:{name:"商户私钥",description:"商户私钥 详见https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_7_1.shtml",type:"text",value:""},pay_type:{name:"支付类型",description:"支付类型",type:"select",value:"",options:[{name:"Native支付",value:"Native"}]}}
1,stripe:{secret_key:{name:"SecretKey",description:"API 私钥",type:"text",value:""},webhook_secret:{name:"WebHookSecret",description:"回调验证密钥,不用填写,创建网关后会自动在stripe后台创建webhook并获取webhook密钥",type:"text",value:""}}};function ze({item:a,managePayment:n,handleOpenModal:r,setModalPaymentId:o}){const{t}=M(),[u,b]=l.useState(null),[T,f]=l.useState(!1),[I,s]=l.useState(a.sort),y=()=>{b(null)},x=p=>{b(p.currentTarget)},j=()=>{y(),f(!0)},i=()=>{f(!1)},c=async()=>{y(),await n(a.id,"delete","")},H=async p=>{const d=parseInt(p.target.value);if(!(isNaN(d)||d===I)){if(d<0){E(t("payment_row.sortTip"));return}await n(a.id,"sort",d),s(d)}};return e.jsxs(e.Fragment,{children:[e.jsxs(Ge,{tabIndex:a.id,children:[e.jsx(m,{children:a.id}),e.jsx(m,{children:a.uuid}),e.jsx(m,{style:{minWidth:"100px"},children:a.name}),e.jsx(m,{style:{minWidth:"80px"},children:ye?.[a.type]||t("common.unknown")}),e.jsx(m,{children:e.jsx("img",{src:a.icon,alt:"icon",style:{width:"24px",height:"24px"}})}),e.jsx(m,{children:a.fixed_fee}),e.jsx(m,{children:a.percent_fee}),e.jsx(m,{children:e.jsx(We,{id:`sort-${a.id}`,onBlur:H,type:"number",label:t("paymentGatewayPage.tableHeaders.sort"),variant:"standard",defaultValue:a.sort,inputProps:{min:"0"}})}),e.jsx(m,{children:e.jsx(ra,{id:`switch-${a.id}`,checked:a.enable,onChange:()=>{n(a.id,"status",!a.enable)}})}),e.jsx(m,{children:ve(a.created_at)}),e.jsx(m,{children:e.jsx(Je,{onClick:x,sx:{color:"rgb(99, 115, 129)"},children:e.jsx(D,{icon:"solar:menu-dots-circle-bold-duotone"})})})]}),e.jsxs(Ze,{open:!!u,anchorEl:u,onClose:y,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{minWidth:140}},children:[e.jsxs(A,{onClick:()=>{y(),r(),o(a.id)},children:[e.jsx(D,{icon:"solar:pen-bold-duotone",style:{marginRight:"16px"}}),t("common.edit")]}),e.jsxs(A,{onClick:j,sx:{color:"error.main"},children:[e.jsx(D,{icon:"solar:trash-bin-trash-bold-duotone",style:{marginRight:"16px"}}),t("common.delete")]})]}),e.jsxs(Se,{open:T,onClose:i,children:[e.jsx(Ce,{children:t("payment_row.delPayment")}),e.jsx(Te,{children:e.jsxs(sa,{children:[t("payment_row.delPaymentTip")," ",a.name,"?"]})}),e.jsxs(qe,{children:[e.jsx(G,{onClick:i,children:t("common.close")}),e.jsx(G,{onClick:c,sx:{color:"error.main"},autoFocus:!0,children:t("common.delete")})]})]})]})}ze.propTypes={item:w.object,managePayment:w.func,handleOpenModal:w.func,setModalPaymentId:w.func};function Ke({filterName:a,handleFilterName:n}){const{t:r}=M();return e.jsx(e.Fragment,{children:e.jsxs(ae,{direction:{xs:"column",sm:"row"},spacing:{xs:3,sm:2,md:4},padding:"24px",paddingBottom:"0px",children:[e.jsxs(g,{children:[e.jsx(P,{htmlFor:"channel-name-label",children:r("paymentGatewayPage.tableHeaders.name")}),e.jsx(k,{id:"name",name:"name",sx:{minWidth:"100%"},label:r("paymentGatewayPage.tableHeaders.name"),value:a.name,onChange:n,placeholder:r("paymentGatewayPage.tableHeaders.name")})]}),e.jsxs(g,{children:[e.jsx(P,{htmlFor:"channel-uuid-label",children:"UUID"}),e.jsx(k,{id:"uuid",name:"uuid",sx:{minWidth:"100%"},label:r("channel_index.modelName"),value:a.uuid,onChange:n,placeholder:"UUID"})]}),e.jsxs(g,{sx:{minWidth:"22%"},children:[e.jsx(P,{htmlFor:"channel-type-label",children:r("paymentGatewayPage.tableHeaders.type")}),e.jsx(U,{id:"channel-type-label",label:r("paymentGatewayPage.tableHeaders.type"),value:a.type,name:"type",onChange:n,sx:{minWidth:"100%"},MenuProps:{PaperProps:{style:{maxHeight:200}}},children:Object.entries(ye).map(([o,t])=>e.jsx(A,{value:o,children:t},o))})]})]})})}Ke.propTypes={filterName:w.object,handleFilterName:w.func};const ha=a=>oa().shape({is_edit:ia(),name:ie().required(a("validation.requiredName")),icon:ie().required(a("payment_edit.requiredIcon")),fixed_fee:ge().min(0,a("payment_edit.requiredFixedFee")),percent_fee:ge().min(0,a("payment_edit.requiredPercentFee")),currency:ie().required(a("payment_edit.requiredCurrency"))}),Pe={is_edit:!1,type:"epay",uuid:"",name:"",icon:"",notify_domain:"",fixed_fee:0,percent_fee:0,currency:"CNY",config:{},sort:0,enable:!0},Ne=({open:a,paymentId:n,onCancel:r,onOk:o})=>{const{t}=M(),u=Xe(),[b,T]=l.useState(Pe),f=async(s,{setErrors:y,setStatus:x,setSubmitting:j})=>{j(!0);let i=JSON.stringify(s.config),c;s=me(s);try{s.is_edit?c=await B.put("/api/payment/",{...s,id:parseInt(n),config:i}
1):c=await B.post("/api/payment/",{...s,config:i});const{success:H,message:p}=c.data;H?(s.is_edit?de(t("payment_edit.updateOk")):de(t("payment_edit.addOk")),j(!1),x({success:!0}),o(!0)):(E(p),y({submit:p}))}catch{return}},I=async()=>{try{let s=await B.get(`/api/payment/${n}`);const{success:y,message:x,data:j}=s.data;y?(j.is_edit=!0,j.config=JSON.parse(j.config),T(j)):E(x)}catch{return}};return l.useEffect(()=>{n?I().then():T(Pe)},[n]),e.jsxs(Se,{open:a,onClose:r,fullWidth:!0,maxWidth:"md",children:[e.jsx(Ce,{sx:{margin:"0px",fontWeight:700,lineHeight:"1.55556",padding:"24px",fontSize:"1.125rem"},children:t(n?"payment_edit.paymentEdit":"paymentGatewayPage.createPayment")}),e.jsx(ea,{}),e.jsx(Te,{children:e.jsx(la,{initialValues:b,enableReinitialize:!0,validationSchema:ha(t),onSubmit:f,children:({errors:s,handleBlur:y,handleChange:x,handleSubmit:j,touched:i,values:c,isSubmitting:H})=>e.jsxs("form",{noValidate:!0,onSubmit:j,children:[e.jsxs(g,{fullWidth:!0,error:!!(i.type&&s.type),sx:{...u.typography.otherInput},children:[e.jsx(P,{htmlFor:"channel-type-label",children:t("paymentGatewayPage.tableHeaders.type")}),e.jsx(U,{id:"channel-type-label",label:t("paymentGatewayPage.tableHeaders.type"),value:c.type,name:"type",onBlur:y,onChange:x,MenuProps:{PaperProps:{style:{maxHeight:200}}},children:Object.entries(ye).map(([p,d])=>e.jsx(A,{value:p,children:d},p))}),i.type&&s.type?e.jsx(C,{error:!0,id:"helper-tex-channel-type-label",children:s.type}):e.jsxs(C,{id:"helper-tex-channel-type-label",children:[" ",t("payment_edit.paymentType")," "]})]}),e.jsxs(g,{fullWidth:!0,error:!!(i.name&&s.name),sx:{...u.typography.otherInput},children:[e.jsx(P,{htmlFor:"channel-name-label",children:t("paymentGatewayPage.tableHeaders.name")}),e.jsx(k,{id:"channel-name-label",label:t("paymentGatewayPage.tableHeaders.name"),type:"text",value:c.name,name:"name",onBlur:y,onChange:x,inputProps:{autoComplete:"name"},"aria-describedby":"helper-text-channel-name-label"}),i.name&&s.name&&e.jsx(C,{error:!0,id:"helper-tex-channel-name-label",children:s.name})]}),e.jsxs(g,{fullWidth:!0,error:!!(i.icon&&s.icon),sx:{...u.typography.otherInput},children:[e.jsx(P,{htmlFor:"channel-icon-label",children:t("paymentGatewayPage.tableHeaders.icon")}),e.jsx(k,{id:"channel-icon-label",label:t("paymentGatewayPage.tableHeaders.icon"),type:"text",value:c.icon,name:"icon",onBlur:y,onChange:x,inputProps:{autoComplete:"icon"},"aria-describedby":"helper-text-channel-icon-label"}),i.icon&&s.icon&&e.jsx(C,{error:!0,id:"helper-tex-channel-icon-label",children:s.icon})]}),e.jsxs(g,{fullWidth:!0,error:!!(i.notify_domain&&s.notify_domain),sx:{...u.typography.otherInput},children:[e.jsx(P,{htmlFor:"channel-notify_domain-label",children:t("payment_edit.notifyDomain")}),e.jsx(k,{id:"channel-notify_domain-label",label:t("payment_edit.notifyDomain"),type:"text",value:c.notify_domain,name:"notify_domain",onBlur:y,onChange:x,inputProps:{autoComplete:"notify_domain"},"aria-describedby":"helper-text-channel-notify_domain-label"}),i.notify_domain&&s.notify_domain?e.jsx(C,{error:!0,id:"helper-tex-notify_domain-label",children:s.notify_domain}):e.jsxs(C,{id:"helper-tex-notify_domain-label",children:[" ",t("payment_edit.notifyDomainTip")," "]})]}),e.jsxs(g,{fullWidth:!0,error:!!(i.fixed_fee&&s.fixed_fee),sx:{...u.typography.otherInput},children:[e.jsx(P,{htmlFor:"channel-fixed_fee-label",children:t("paymentGatewayPage.tableHeaders.fixedFee")}),e.jsx(k,{id:"channel-fixed_fee-label",label:t("paymentGatewayPage.tableHeaders.fixedFee"),type:"number",value:c.fixed_fee,name:"fixed_fee",onBlur:y,onChange:x,inputProps:{autoComplete:"fixed_fee"},"aria-describedby":"helper-text-channel-fixed_fee-label"}),i.fixed_fee&&s.fixed_fee?e.jsx(C,{error:!0,id:"helper-tex-fixed_fee-label",children:s.fixed_fee}):e.jsxs(C,{id:"helper-tex-fixed_fee-label",children:[" ",t("payment_edit.FixedTip")," "]})]}),e.jsxs(g,{fullWidth:!0,error:!!(i.percent_fee&&s.percent_fee),sx:{...u.typography.otherInput},children:[e.jsx(P,{htmlFor:"channel-percent_fee-label",children:t("paymentGatewayPage.tableHeaders.percentFee")}),e.jsx(k,{id:"channel-percent_fee-label",label:t("paymentGatewayPage.tableHeaders.percentFee"),type:"number",value:c.percent_fee,name:"percent_fee",onBlur:y,onChange:x,inputProps:{autoComplete:"percent_fee"},"aria-describedby":"helper-text-channel-percent_fee-label"}),i.percent_fee&&s.percent_fee?e.jsx(C,{error:!0,id:"helper-tex-percent_fee-label",children:s.percent_fee}):e.jsxs(C,{id:"helper-tex-percent_fee-label",children:[" ",t("payment_edit.percentTip")," "]})]}),e.jsxs(g,{fullWidth:!0,error:!!(i.currency&&s.currency),sx:{...u.typography.otherInput},children:[e.jsx(P,{htmlFor:"channel-currency-label",children:t("payment_edit.currencyType")}),e.jsx(U,{id:"channel-currency-label",label:t("payment_edit.currencyType"),value:c.currency,name:"currency",onBlur:y,onChange:x,MenuProps:{PaperProps:{style:{maxHeight:200}}},children:Object.entries(pa).map(([p,d])=>e.jsx(A,{value:p,children:d},p))}),i.currency&&s.currency?e.jsx(C,{error:!0,id:"helper-tex-channel-currency-label",children:s.currency}):e.jsxs(C,{id:"helper-tex-channel-currency-label",children:[" ",t("payment_edit.currencyTip")," "]})]}),ce[c.type]&&Object.keys(ce[c.type]).map(p=>{const d=ce[c.type][p],F=`config.${p}`;return d.type==="select"?e.jsxs(g,{fullWidth:!0,children:[e.jsx(P,{htmlFor:"channel-currency-label",children:d.name}),e.jsx(U,{label:d.name,value:c.config?.[p]||"",name:F,onBlur:y,onChange:x,MenuProps:{PaperProps:{style:{maxHeight:200}}},children:Object.values(d.options).map(W=>e.jsx(A,{value:W.value,children:W.name},W.value))},F),e.jsxs(C,{id:"helper-tex-channel-currency-label",children:[" ",d.description," "]})]},F):e.jsxs(g,{fullWidth:!0,sx:{...u.typography.otherInput},children:[e.jsx(We,{multiline:!0,name:F,value:c.config?.[p]||"",label:d.name,placeholder:d.description,onChange:x},F),e.jsxs(C,{id:"helper-tex-channel-key-label",children:[" ",d.description," "]})]},F)}),e.jsxs(qe,{children:[e.jsx(G,{onClick:r,children:t("common.cancel")}),e.jsx(G,{disableElevation:!0,disabled:H,type:"submit",variant:"contained",color:"primary",children:t("common.submit")})]})]})})})]})};
1Ne.propTypes={open:w.bool,paymentId:w.number,onCancel:w.func,onOk:w.func};function ma(){const{t:a}=M(),n={p:0,type:"",name:"",uuid:"",currency:""},[r,o]=l.useState(0),[t,u]=l.useState("desc"),[b,T]=l.useState("created_at"),[f,I]=l.useState(()=>Ae("paymentGateway")),[s,y]=l.useState(0),[x,j]=l.useState(!1),[i,c]=l.useState(n),[H,p]=l.useState(n),[d,F]=l.useState(!1),[W,Y]=l.useState(!1),[te,V]=l.useState(0),[ne,re]=l.useState([]),se=(h,S)=>{S!==""&&(u(b===S&&t==="asc"?"desc":"asc"),T(S))},J=(h,S)=>{o(S)},Z=h=>{V(h),Y(!0)},_=()=>{Y(!1),V(0)},v=h=>{h===!0&&(_(),K())},$=h=>{const S=parseInt(h.target.value,10);o(0),I(S),$e("paymentGateway",S)},le=async()=>{o(0),p(i)},q=h=>{c({...i,[h.target.name]:h.target.value})},z=async(h,S,R)=>{const N="/api/payment/";let L={id:h},O;try{switch(S){case"delete":O=await B.delete(N+h);break;case"status":O=await B.put(N,{...L,enable:R});break;case"sort":O=await B.put(N,{...L,sort:R});break}const{success:ee,message:oe}=O.data;return ee?(de(a("userPage.operationSuccess")),await K()):E(oe),O.data}catch{return}},X=l.useCallback(async(h,S,R,N,L)=>{j(!0),R=me(R);try{L&&(L=N==="desc"?"-"+L:L);const O=await B.get("/api/payment/",{params:{page:h+1,size:S,order:L,...R}}),{success:ee,message:oe,data:xe}=O.data;ee?(y(xe.total_count),re(xe.data)):E(oe)}catch(O){console.error(O)}j(!1)},[]),K=async()=>{T("created_at"),u("desc"),c(n),p(n),F(!d)};return l.useEffect(()=>{X(r,f,H,t,b)},[r,f,H,t,b,X,d]),e.jsxs(e.Fragment,{children:[e.jsxs(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:5,children:[e.jsx(Ie,{variant:"h4",children:a("paymentGatewayPage.title")}),e.jsx(G,{variant:"contained",color:"primary",startIcon:e.jsx(D,{icon:"solar:add-circle-line-duotone"}),onClick:()=>Z(0),children:a("paymentGatewayPage.createPayment")})]}),e.jsxs(ue,{children:[e.jsx(Q,{component:"form",noValidate:!0,children:e.jsx(Ke,{filterName:i,handleFilterName:q})}),e.jsx(He,{sx:{textAlign:"right",height:50,display:"flex",justifyContent:"space-between",p:h=>h.spacing(0,1,0,3)},children:e.jsx(ke,{children:e.jsxs(Ee,{variant:"outlined","aria-label":"outlined small primary button group",children:[e.jsx(G,{onClick:K,startIcon:e.jsx(D,{icon:"solar:refresh-bold-duotone",width:18}),children:a("paymentGatewayPage.refreshClear")}),e.jsx(G,{onClick:le,startIcon:e.jsx(D,{icon:"solar:minimalistic-magnifer-line-duotone",width:18}),children:a("paymentGatewayPage.search")})]})})}),x&&e.jsx(Fe,{}),e.jsx(Oe,{component:"div",children:e.jsx(Le,{sx:{overflow:"unset"}
1,children:e.jsxs(Be,{sx:{minWidth:800},children:[e.jsx(Re,{order:t,orderBy:b,onRequestSort:se,headLabel:[{id:"id",label:a("paymentGatewayPage.tableHeaders.id"),disableSort:!1},{id:"uuid",label:a("paymentGatewayPage.tableHeaders.uuid"),disableSort:!1},{id:"name",label:a("paymentGatewayPage.tableHeaders.name"),disableSort:!0},{id:"type",label:a("paymentGatewayPage.tableHeaders.type"),disableSort:!1},{id:"icon",label:a("paymentGatewayPage.tableHeaders.icon"),disableSort:!0},{id:"fixed_fee",label:a("paymentGatewayPage.tableHeaders.fixedFee"),disableSort:!0},{id:"percent_fee",label:a("paymentGatewayPage.tableHeaders.percentFee"),disableSort:!0},{id:"sort",label:a("paymentGatewayPage.tableHeaders.sort"),disableSort:!1},{id:"enable",label:a("paymentGatewayPage.tableHeaders.enable"),disableSort:!1},{id:"created_at",label:a("paymentGatewayPage.tableHeaders.createdAt"),disableSort:!1},{id:"action",label:a("paymentGatewayPage.tableHeaders.action"),disableSort:!0}]}),e.jsx(De,{children:ne.map((h,S)=>e.jsx(ze,{item:h,managePayment:z,handleOpenModal:Z,setModalPaymentId:V},`${h.id}_${S}`))})]})})}),e.jsx(Ve,{page:r,component:"div",count:s,rowsPerPage:f,onPageChange:J,rowsPerPageOptions:Me,onRowsPerPageChange:$,showFirstButton:!0,showLastButton:!0}),e.jsx(Ne,{open:W,onCancel:_,onOk:v,paymentId:te})]})]})}const Ue={pending:{name:"待支付",value:"pending",color:"primary"},success:{name:"支付成功",value:"success",color:"success"},failed:{name:"支付失败",value:"failed",color:"error"},closed:{name:"已关闭",value:"closed",color:"default"}};function ua(a){let n=Ue[a];return e.jsxs(ca,{color:n?.color||"secondary",children:[" ",n?.name||"未知"," "]})}function Qe({item:a}){return e.jsx(e.Fragment,{children:e.jsxs(Ge,{tabIndex:a.id,children:[e.jsx(m,{style:{minWidth:"180px"},children:ve(a.created_at)}),e.jsx(m,{children:a.gateway_id}),e.jsx(m,{children:a.user_id}),e.jsx(m,{children:a.trade_no}),e.jsx(m,{children:a.gateway_no}),e.jsxs(m,{children:["$",a.amount]}),e.jsxs(m,{children:["$",a.fee]}),e.jsxs(m,{children:[a.discount," ",a.order_currency]}),e.jsxs(m,{children:[a.order_amount," ",a.order_currency]}),e.jsx(m,{children:a.quota}),e.jsx(m,{children:ua(a.status)})]})})}Qe.propTypes={item:w.object};function Ye({filterName:a,handleFilterName:n}){const{t:r}=M();return e.jsx(e.Fragment,{children:e.jsxs(ae,{direction:{xs:"column",sm:"row"},spacing:{xs:3,sm:2,md:4},padding:"24px",paddingBottom:"0px",children:[e.jsxs(g,{children:[e.jsx(P,{htmlFor:"channel-gateway_id-label",children:r("orderlogPage.gatewayIdLabel")}),e.jsx(k,{id:"gateway_id",name:"gateway_id",sx:{minWidth:"100%"},label:r("orderlogPage.gatewayIdLabel"),value:a.gateway_id,onChange:n,placeholder:r("orderlogPage.placeholder.gatewayId")})]}),e.jsxs(g,{children:[e.jsx(P,{htmlFor:"channel-user_id-label",children:r("orderlogPage.userIdLabel")}),e.jsx(k,{id:"user_id",name:"user_id",sx:{minWidth:"100%"},label:r("orderlogPage.userIdLabel"),value:a.user_id,onChange:n,placeholder:r("orderlogPage.placeholder.userId")})]}),e.jsxs(g,{children:[e.jsx(P,{htmlFor:"channel-trade_no-label",children:r("orderlogPage.tradeNoLabel")}),e.jsx(k,{id:"trade_no",name:"trade_no",sx:{minWidth:"100%"},label:r("orderlogPage.tradeNoLabel"),value:a.trade_no,onChange:n,placeholder:r("orderlogPage.placeholder.tradeNo")})]}),e.jsxs(g,{children:[e.jsx(P,{htmlFor:"channel-gateway_no-label",children:r("orderlogPage.gatewayNoLabel")}),e.jsx(k,{id:"gateway_no",name:"gateway_no",sx:{minWidth:"100%"},label:r("orderlogPage.gatewayNoLabel"),value:a.gateway_no,onChange:n,placeholder:r("orderlogPage.placeholder.gatewayNo")})]}),e.jsx(g,{children:e.jsx(be,{dateAdapter:je,adapterLocale:"zh-cn",children:e.jsx(fe,{label:r("orderlogPage.startTimeLabel"),ampm:!1,name:"start_timestamp",value:a.start_timestamp===0?null:pe.unix(a.start_timestamp),onChange:o=>{if(o===null){n({target:{name:"start_timestamp",value:0}});return}n({target:{name:"start_timestamp",value:o.unix()}})},slotProps:{actionBar:{actions:["clear","today","accept"]}}})})}),e.jsx(g,{children:e.jsx(be,{dateAdapter:je,adapterLocale:"zh-cn",children:e.jsx(fe,{label:r("orderlogPage.endTimeLabel"),name:"end_timestamp",ampm:!1,value:a.end_timestamp===0?null:pe.unix(a.end_timestamp),onChange:o=>{if(o===null){n({target:{name:"end_timestamp",value:0}});return}n({target:{name:"end_timestamp",value:o.unix()}})},slotProps:{actionBar:{actions:["clear","today","accept"]}}})})}),e.jsxs(g,{sx:{minWidth:"15%"},children:[e.jsx(P,{htmlFor:"channel-status-label",children:r("orderlogPage.statusLabel")}),e.jsx(U,{id:"channel-type-label",label:r("orderlogPage.statusLabel"),value:a.status,name:"status",onChange:n,sx:{minWidth:"100%"},MenuProps:{PaperProps:{style:{maxHeight:200}}},children:Object.values(Ue).map(o=>e.jsx(A,{value:o.value,children:o.name},o.value))})]})]})})}Ye.propTypes={filterName:w.object,handleFilterName:w.func};function ya(){const{t:a}=M(),n={p:0,user_id:"",trade_no:"",status:"",gateway_no:"",start_timestamp:0,end_timestamp:pe().unix()+3600},[r,o]=l.useState(0),[t,u]=l.useState("desc"),[b,T]=l.useState("created_at"),[f,I]=l.useState(()=>Ae("paymentOrder")),[s,y]=l.useState(0),[x,j]=l.useState(!1),[i,c]=l.useState(n),[H,p]=l.useState(n),[d,F]=l.useState(!1),[W,Y]=l.useState([]),te=(_,v)=>{v!==""&&(u(b===v&&t==="asc"?"desc":"asc"),T(v))},V=(_,v)=>{o(v)},ne=_=>{const v=parseInt(_.target.value,10);o(0),I(v),$e("paymentOrder",v)},re=async()=>{o(0),p(i)},se=_=>{c({...i,[_.target.name]:_.target.value})},J=l.useCallback(async(_,v,$,le,q)=>{j(!0),$=me($);try{q&&(q=le==="desc"?"-"+q:q);const z=await B.get("/api/payment/order",{params:{page:_+1,size:v,order:q,...$}}),{success:X,message:K,data:h}=z.data;X?(y(h.total_count),Y(h.data)):E(K)}catch(z){console.error(z)}j(!1)},[]),Z=async()=>{T("created_at"),u("desc"),c(n),p(n),F(!d)};return l.useEffect(()=>{J(r,f,H,t,b)},[r,f,H,t,b,J,d]),e.jsxs(e.Fragment,{children:[e.jsx(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:5,children:e.jsx(Ie,{variant:"h4",children:a("orderlogPage.title")})}),e.jsxs(ue,{children:[e.jsx(Q,{component:"form",noValidate:!0,children:e.jsx(Ye,{filterName:i,handleFilterName:se})}
1),e.jsx(He,{sx:{textAlign:"right",height:50,display:"flex",justifyContent:"space-between",p:_=>_.spacing(0,1,0,3)},children:e.jsx(ke,{children:e.jsxs(Ee,{variant:"outlined","aria-label":"outlined small primary button group",children:[e.jsx(G,{onClick:Z,startIcon:e.jsx(D,{icon:"solar:refresh-bold-duotone",width:18}),children:a("orderlogPage.refreshClear")}),e.jsx(G,{onClick:re,startIcon:e.jsx(D,{icon:"solar:minimalistic-magnifer-line-duotone",width:18}),children:a("orderlogPage.search")})]})})}),x&&e.jsx(Fe,{}),e.jsx(Oe,{component:"div",children:e.jsx(Le,{sx:{overflow:"unset"},children:e.jsxs(Be,{sx:{minWidth:800},children:[e.jsx(Re,{order:t,orderBy:b,onRequestSort:te,headLabel:[{id:"created_at",label:a("orderlogPage.tableHeaders.created_at"),disableSort:!1},{id:"gateway_id",label:a("orderlogPage.tableHeaders.gateway_id"),disableSort:!1},{id:"user_id",label:a("orderlogPage.tableHeaders.user_id"),disableSort:!1},{id:"trade_no",label:a("orderlogPage.tableHeaders.trade_no"),disableSort:!0},{id:"gateway_no",label:a("orderlogPage.tableHeaders.gateway_no"),disableSort:!0},{id:"amount",label:a("orderlogPage.tableHeaders.amount"),disableSort:!0},{id:"fee",label:a("orderlogPage.tableHeaders.fee"),disableSort:!0},{id:"discount",label:a("orderlogPage.tableHeaders.discount"),disableSort:!0},{id:"order_amount",label:a("orderlogPage.tableHeaders.order_amount"),disableSort:!0},{id:"quota",label:a("orderlogPage.tableHeaders.quota"),disableSort:!0},{id:"status",label:a("orderlogPage.tableHeaders.status"),disableSort:!1}]}),e.jsx(De,{children:W.map((_,v)=>e.jsx(Qe,{item:_},`${_.id}_${v}`))})]})})}),e.jsx(Ve,{page:r,component:"div",count:s,rowsPerPage:f,onPageChange:V,rowsPerPageOptions:Me,onRowsPerPageChange:ne,showFirstButton:!0,showLastButton:!0})]})]})}function he(a){const{children:n,value:r,index:o,...t}=a;return e.jsx("div",{role:"tabpanel",hidden:r!==o,id:`setting-tabpanel-${o}`,"aria-labelledby":`setting-tab-${o}`,...t,children:r===o&&e.jsx(Q,{sx:{p:3},children:n})})}he.propTypes={children:w.node,index:w.number.isRequired,value:w.number.isRequired};function we(a){return{id:`setting-tab-${a}`,"aria-controls":`setting-tabpanel-${a}`}}const Va=()=>{const{t:a}=M(),n=aa(),r=ta(),o=n.hash.replace("#",""),t=l.useMemo(()=>({order:0,gateway:1}),[]),[u,b]=l.useState(t[o]||0),T=(f,I)=>{b(I);const s=Object.keys(t);r(`#${s[I]}`)};return l.useEffect(()=>{const f=()=>{const I=n.hash.replace("#","");b(t[I]||0)};return window.addEventListener("hashchange",f),()=>{window.removeEventListener("hashchange",f)}},[n,t]),e.jsx(e.Fragment,{children:e.jsx(ue,{children:e.jsx(na,{children:e.jsxs(Q,{sx:{width:"100%"},children:[e.jsx(Q,{sx:{borderBottom:1,borderColor:"divider"},children:e.jsxs(da,{value:u,onChange:T,variant:"scrollable",scrollButtons:"auto",children:[e.jsx(_e,{label:a("paymentPage.orderList"),...we(0)}),e.jsx(_e,{label:a("paymentPage.gatewaySettings"),...we(1)})]})}),e.jsx(he,{value:u,index:0,children:e.jsx(ya,{})}),e.jsx(he,{value:u,index:1,children:e.jsx(ma,{})})]})})})})};export{Va as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.