p__Customer__index.c9eb165b.async.js 22 KB

1
  1. "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[668],{63944:function(Ze,X,i){i.r(X),i.d(X,{default:function(){return Se}});var _=i(15009),h=i.n(_),ee=i(99289),T=i.n(ee),te=i(5574),D=i.n(te),N=i(8154),V=i(78843),U=i(4710),x=i(70972),K=i(83447),I=i(67294),re=i(97857),w=i.n(re),z=i(83087),L=i(5966),ne=i(5436),ae=i(90672),Q=i(184),ue=i(64317),ie=i(31199),G=i(71471),k=i(83622),se=i(72269),$=i(2453),B=i(66309),oe=i(8215),le=i(69753),de=i(76772),ce=i(27484),F=i.n(ce),me=i(37476),q=i(26412),pe=i(29387),he=i.n(pe),fe=i(70178),ve=i.n(fe),e=i(85893);F().extend(ve()),F().extend(he());var ge=function(a){var f=a.snapshot,A={book_time:"\u958B\u59CB\u6642\u9593",end_time:"\u7D50\u675F\u6642\u9593",car:"\u8ECA\u8F1BID",connector:"\u5145\u96FB\u6A01ID",is_ic_call:"IC\u5361\u652F\u4ED8",promotion_code:"\u512A\u60E0\u5238",stationID:"\u7AD9\u9EDEID",total_fee:"\u8CBB\u7528",total_power:"\u5145\u96FB\u91CF",type:"\u985E\u578B",user:"\u7528\u6236ID",with_coupon:"\u4F7F\u7528\u512A\u60E0\u5238"},v=function(j,p){switch(j){case"book_time":case"end_time":return F()(p).format("YYYY-MM-DD HH:mm:ss");case"total_fee":var l=typeof p=="string"?parseFloat(p):Number(p);return isNaN(l)?(0,e.jsxs)("span",{className:"text-red-500 font-medium",children:["HK$",l.toFixed(2)]}):(0,e.jsxs)("span",{className:"text-red-500 font-medium",children:["HK$",l.toFixed(2)]});case"total_power":return"".concat(p,"kWh");case"type":return p==="walking"?"Walk In":p;case"is_ic_call":case"with_coupon":return(0,e.jsx)(B.Z,{color:p?"green":"default",children:p?"\u662F":"\u5426"});case"promotion_code":return!Array.isArray(p)||p.length===0?"\u7121":(0,e.jsx)("div",{className:"flex flex-col gap-1",children:p.map(function(t){return(0,e.jsx)(B.Z,{children:(0,e.jsx)(G.Z.Text,{copyable:!0,children:t})},t)})});case"car":case"user":case"stationID":case"connector":return(0,e.jsx)(G.Z.Text,{copyable:!0,children:p});default:return String(p)}},b=Object.entries(f).map(function(P){var j=D()(P,2),p=j[0],l=j[1];return(0,e.jsx)(q.Z.Item,{label:A[p]||p,span:p==="promotion_code"?3:1,children:v(p,l)},p)});return(0,e.jsx)(me.Y,{title:"\u4EA4\u6613\u8A73\u60C5",trigger:(0,e.jsx)(k.ZP,{type:"link",children:"\u8A73\u60C5"}),submitter:!1,modalProps:{centered:!0,width:800,destroyOnClose:!0},children:(0,e.jsx)(q.Z,{bordered:!0,column:3,size:"small",labelStyle:{width:"120px"},children:b})})},ye=ge;function xe(){return[{title:"\u8A02\u55AEID",dataIndex:"id",key:"id",width:300,align:"center",render:function(a){return(0,e.jsx)(G.Z.Text,{ellipsis:{tooltip:a},copyable:!0,children:a})}},{title:"\u4EA4\u6613\u6642\u9593",dataIndex:"createdAt",key:"createdAt",width:180,align:"center",sorter:function(a,f){return F()(a.createdAt).unix()-F()(f.createdAt).unix()},render:function(a){return F()(a).format("YYYY-MM-DD HH:mm:ss")}},{title:"\u4EA4\u6613\u985E\u578B",dataIndex:"goods_name",key:"goods_name",width:120,align:"center",ellipsis:!0,render:function(a){return(0,e.jsx)(G.Z.Text,{ellipsis:{tooltip:a},children:a})}},{title:"\u91D1\u984D",dataIndex:"amount",key:"amount",width:120,align:"center",sorter:function(a,f){return a.amount-f.amount},render:function(a){var f;return"HK$".concat((f=Number(a))===null||f===void 0?void 0:f.toFixed(2))}},{title:"\u72C0\u614B",dataIndex:"status_fk",key:"status_fk",width:100,align:"center",valueEnum:{1:{text:"\u6210\u529F",status:"Success"},2:{text:"\u5931\u6557",status:"Error"},3:{text:"\u8655\u7406\u4E2D",status:"Processing"}}},{title:"\u8A73\u60C5",dataIndex:"snapshot",key:"snapshot",width:300,align:"center",ellipsis:!0,render:function(a,f){return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(ye,{snapshot:f.snapshot})})}}]}function Ie(y){var a,f=y.customerId,A=(0,I.useState)(""),v=D()(A,2),b=v[0],P=v[1],j=(0,I.useRef)(),p=(0,I.useState)(!1),l=D()(p,2),t=l[0],r=l[1],o=function(){var m=T()(h()().mark(function d(){var s,u;return h()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r(!0),n.prev=1,n.next=4,(0,x.fF)(f);case 4:return s=n.sent,u=s.data,b&&(u=(0,K.Z)({dataSource:u,keyWord:b})),n.next=9,(0,oe.p)({filename:"\u4EA4\u6613\u8A18\u9304_".concat(f),data:u,columns:[{title:"\u4EA4\u6613\u6642\u9593",dataIndex:"createdAt",width:20,render:function(g){return F()(g).format("YYYY-MM-DD HH:mm:ss")}},{title:"\u4EA4\u6613\u985E\u578B",dataIndex:["snapshot","type"],width:15},{title:"\u5145\u96FB\u7AD9ID",dataIndex:["snapshot","stationID"],width:25},{title:"\u5145\u96FB\u69CDID",dataIndex:["snapshot","connector"],width:25},{title:"\u9810\u7D04\u6642\u9593",dataIndex:["snapshot","book_time"],width:20,render:function(g){return g?F()(g).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:"\u7D50\u675F\u6642\u9593",dataIndex:["snapshot","end_time"],width:20,render:function(g){return g?F()(g).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:"\u5145\u96FB\u91CF",dataIndex:["snapshot","total_power"],width:15,render:function(g){return g?"".concat(g,"kWh"):"-"}},{title:"\u91D1\u984D",dataIndex:"amount",width:15,render:function(g){return"HK$".concat(g)}},{title:"\u8A02\u55AE\u7DE8\u865F",dataIndex:"id",width:40},{title:"\u4F7F\u7528\u512A\u60E0\u5238",dataIndex:["snapshot","with_coupon"],width:15,render:function(g){return g?"\u662F":"\u5426"}},{title:"\u5099\u8A3B",dataIndex:"goods_name",width:15},{title:"\u8ECA\u8F1BID",dataIndex:["snapshot","car"],width:40},{title:"IC\u5361\u5145\u96FB",dataIndex:["snapshot","is_ic_call"],width:15,render:function(g){return g?"\u662F":"\u5426"}}]});case 9:return n.prev=9,r(!1),n.finish(9);case 12:case"end":return n.stop()}},d,null,[[1,,9,12]])}));return function(){return m.apply(this,arguments)}}();return(0,e.jsxs)(N.Z,{title:"Customer transaction page",children:[(0,e.jsx)(V.Z,{title:"Search bar",submitFun:(a=j.current)===null||a===void 0?void 0:a.reload,inputProps:{value:b,onChange:function(d){var s;P(d.target.value),(s=j.current)===null||s===void 0||s.reload()}}}),(0,e.jsx)(U.Z,{searchKey:b,props:{headerTitle:"Transaction List",actionRef:j,pagination:{pageSize:16},toolBarRender:function(){return[(0,e.jsx)(k.ZP,{type:"primary",onClick:o,loading:t,icon:(0,e.jsx)(le.Z,{}),children:t?"\u5C0E\u51FA\u4E2D...":"\u532F\u51FA\u8868\u683C"},"export")]},columns:xe(),request:function(){var m=T()(h()().mark(function s(){var u;return h()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,x.fF)(f);case 2:if(u=n.sent,!b){n.next=5;break}return n.abrupt("return",w()(w()({},u),{},{data:(0,K.Z)({dataSource:u.data,keyWord:b})}));case 5:return n.abrupt("return",u);case 6:case"end":return n.stop()}},s)}));function d(){return m.apply(this,arguments)}return d}()}})]})}function Ce(){return[{title:"\u4EA4\u6613\u6642\u9593",dataIndex:"createdAt",key:"createdAt"},{title:"\u91D1\u984D",dataIndex:"amount",key:"amount"},{title:"\u4EA4\u6613\u55AE\u865F",dataIndex:"out_trade_no",key:"out_trade_no"},{title:"\u7528\u6236ID",dataIndex:"user_id",key:"user_id"}]}function je(y){var a=y.mainTableReload;return[{title:"\u767C\u653E\u6642\u9593",dataIndex:"issue_date",key:"issue_date",valueType:"dateTime"},{title:"\u904E\u671F\u6642\u9593",dataIndex:"expire_date",key:"expire_date",valueType:"dateTime"},{title:"\u512A\u60E0\u5238\u540D\u7A31",dataIndex:["coupon","name"],key:"coupon_name"},{title:"\u91D1\u984D",dataIndex:["coupon","amount"],key:"amount",render:function(A,v){return"".concat(v.coupon.unit).concat(v.coupon.amount)}},{title:"\u4F7F\u7528\u72C0\u614B",dataIndex:"is_consumed",key:"is_consumed",valueEnum:{true:{text:"\u5DF2\u4F7F\u7528",status:"Default"},false:{text:"\u672A\u4F7F\u7528",status:"Processing"}}},{title:"\u4F7F\u7528\u6642\u9593",dataIndex:"used_at",key:"used_at",valueType:"dateTime"},{title:"\u6301\u6709\u4EBA",dataIndex:["receiver","nickname"],key:"receiver",width:"10%"},{title:"\u767C\u653E\u65B9\u5F0F",dataIndex:"distributor_type",key:"distributor_type",valueEnum:{admin:{text:"\u7BA1\u7406\u54E1\u767C\u653E",status:"Success"},system:{text:"\u7CFB\u7D71\u767C\u653E",status:"Processing"}}},{title:"\u64CD\u4F5C",dataIndex:"action",key:"action",render:function(A,v){return(0,e.jsx)(se.Z,{checked:v.permission,onChange:function(){var b=T()(h()().mark(function P(j){return h()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,(0,x.$P)({id:v.id,permission:j});case 2:console.log("record",a),a==null||a(),$.ZP.success("\u66F4\u65B0\u6210\u529F");case 5:case"end":return l.stop()}},P)}));return function(P){return b.apply(this,arguments)}}()})}}]}function be(y){var a=y.mainTableReload,f=function(t){var r=t.customerId;return(0,e.jsx)(z.Z,{title:"\u7D81\u5B9Aic\u5361",modalProps:{destroyOnClose:!0,centered:!0,width:400},allowUpdate:!1,readOnly:!1,submit:function(){console.log("submit")},modalFormProps:{trigger:(0,e.jsx)(k.ZP,{type:"default",children:"\u7D81\u5B9Aic\u5361"}),onFinish:function(){var o=T()(h()().mark(function d(s){return h()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return console.log("values",s),console.log("currentCustomer",r),c.prev=2,c.next=5,(0,x.gW)({id:r,icCardId:s.icCardId});case 5:return c.next=7,(0,x._j)(r,"\u512A\u60E0\u5238\u901A\u77E5","\u60A8\u6709\u65B0\u7684\u512A\u60E0\u5238\uFF0C\u8ACB\u67E5\u6536");case 7:return a==null||a(),$.ZP.success("\u7D81\u5B9A\u6210\u529F"),c.abrupt("return",!0);case 12:return c.prev=12,c.t0=c.catch(2),console.log("error",c.t0),$.ZP.error("\u7D81\u5B9A\u5931\u6557"),c.abrupt("return",!0);case 17:case"end":return c.stop()}},d,null,[[2,12]])}));function m(d){return o.apply(this,arguments)}return m}(),submitter:{submitButtonProps:{children:"\u7D81\u5B9A"}}},children:(0,e.jsx)(L.Z,{label:"ic\u5361\u865F\u78BC",name:"icCardId",width:"md",rules:[{required:!0},{max:16,message:"ic\u5361\u865F\u78BC\u6700\u591A10\u4F4D"}]})})},A=function(t){var r=t.customerId,o=t.icCardId;return(0,e.jsx)(z.Z,{title:"ic\u5361\u66F4\u65B0",modalProps:{destroyOnClose:!0,centered:!0,width:400},allowUpdate:!1,readOnly:!1,submit:function(){console.log("submit")},modalFormProps:{trigger:(0,e.jsx)(k.ZP,{type:"text",children:o||"\u7121"}),onFinish:function(){var m=T()(h()().mark(function s(u){return h()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log("values",u),console.log("currentCustomer",r),n.prev=2,n.next=5,(0,x.gW)({id:r,icCardId:u.icCardId});case 5:return n.next=7,(0,x._j)(r,"ic\u5361\u66F4\u65B0","\u5DF2\u66F4\u65B0\u60A8\u7684ic\u5361\u53F7");case 7:return a==null||a(),$.ZP.success("ic\u5361\u66F4\u65B0\u6210\u529F"),n.abrupt("return",!0);case 12:return n.prev=12,n.t0=n.catch(2),console.log("error",n.t0),$.ZP.error("ic\u5361\u66F4\u65B0\u5931\u6557"),n.abrupt("return",!0);case 17:case"end":return n.stop()}},s,null,[[2,12]])}));function d(s){return m.apply(this,arguments)}return d}(),submitter:{submitButtonProps:{children:"\u66F4\u65B0"}}},children:(0,e.jsx)(L.Z,{label:"\u65B0ic\u5361\u865F\u78BC",name:"icCardId",width:"md",initialValue:o,rules:[{required:!0},{max:16,message:"ic\u5361\u865F\u78BC\u6700\u591A10\u4F4D"}]})})},v=function(t){var r=t.customerId,o=t.isRefund;return(0,e.jsxs)(z.Z,{title:o?"\u9000\u6B3E":"\u6263\u6B3E",modalProps:{destroyOnClose:!0,centered:!0,width:400},allowUpdate:!1,readOnly:!1,submit:function(){console.log("submit")},modalFormProps:{trigger:(0,e.jsx)(k.ZP,{type:"default",children:o?"\u9000\u6B3E":"\u6263\u6B3E"}),onFinish:function(){var m=T()(h()().mark(function s(u){return h()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(console.log("values",u),console.log("currentCustomer",r),n.prev=2,!o){n.next=8;break}return n.next=6,(0,x.Ay)(w()(w()({},u),{},{reserverId:r}));case 6:n.next=10;break;case 8:return n.next=10,(0,x.zf)(w()(w()({},u),{},{reserverId:r}));case 10:return n.next=12,(0,x._j)(r,o?"\u9000\u6B3E\u901A\u77E5":"\u6263\u6B3E\u901A\u77E5",o?"\u5DF2\u9000\u9084$".concat(u.amount,"\u5230\u60A8\u7684\u9322\u5305"):"\u5DF2\u5F9E\u60A8\u7684\u9322\u5305\u9918\u984D\u6263\u6B3E $".concat(u.amount));case 12:return a==null||a(),$.ZP.success(o?"\u9000\u6B3E\u6210\u529F":"\u6263\u6B3E\u6210\u529F"),n.abrupt("return",!0);case 17:return n.prev=17,n.t0=n.catch(2),console.log("error",n.t0),$.ZP.error(o?"\u9000\u6B3E\u5931\u6557":"\u6263\u6B3E\u5931\u6557"),n.abrupt("return",!0);case 22:case"end":return n.stop()}},s,null,[[2,17]])}));function d(s){return m.apply(this,arguments)}return d}(),submitter:{submitButtonProps:{children:o?"\u9000\u6B3E":"\u6263\u6B3E"}}},children:[(0,e.jsx)(ne.Z,{locale:"en-US",label:"\u91D1\u984D",name:"amount",width:"md",rules:[{required:!0}]}),(0,e.jsx)(L.Z,{label:"\u57F7\u884C\u8005",name:"executor",width:"md",required:!0}),(0,e.jsx)(L.Z,{label:"\u53C3\u8003\u8A02\u55AE",name:"referenceReservationId",width:"md"}),(0,e.jsx)(ae.Z,{label:"\u539F\u56E0",name:"reason"})]})},b=function(t){var r=t.customerId,o=(0,I.useState)(!1),m=D()(o,2),d=m[0],s=m[1];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(k.ZP,{onClick:function(){return s(!0)},children:"\u4EA4\u6613\u7D00\u9304"}),d&&(0,e.jsx)(Q.a,{title:"\u4EA4\u6613\u7D00\u9304",submitter:!1,open:d,onOpenChange:s,drawerProps:{placement:"top",destroyOnClose:!0,height:"auto",style:{maxHeight:"80vh",overflow:"auto"},bodyStyle:{padding:"24px",minHeight:"200px",height:"fit-content"},contentWrapperStyle:{height:"auto",maxHeight:"80vh"},onClose:function(){return s(!1)}},children:(0,e.jsx)(Ie,{customerId:r})})]})},P=function(t){var r,o=t.customerId,m=(0,I.useState)(!1),d=D()(m,2),s=d[0],u=d[1],c=(0,I.useState)(""),n=D()(c,2),C=n[0],g=n[1],H=(0,I.useRef)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(k.ZP,{onClick:function(){return u(!0)},children:"\u5145\u503C\u7D00\u9304"}),s&&(0,e.jsx)(Q.a,{title:"\u5145\u503C\u7D00\u9304",submitter:!1,open:s,onOpenChange:u,drawerProps:{placement:"top",destroyOnClose:!0,height:"auto",style:{maxHeight:"80vh",overflow:"auto"},bodyStyle:{padding:"24px",minHeight:"200px",height:"fit-content"},contentWrapperStyle:{height:"auto",maxHeight:"80vh"},onClose:function(){return u(!1)}},children:(0,e.jsxs)(N.Z,{title:"Customer top up page",children:[(0,e.jsx)(V.Z,{title:"Search bar",submitFun:(r=H.current)===null||r===void 0?void 0:r.reload,inputProps:{value:C,onChange:function(O){var R;g(O.target.value),(R=H.current)===null||R===void 0||R.reload()}}}),(0,e.jsx)(U.Z,{searchKey:C,props:{headerTitle:"Top up List",actionRef:H,pagination:{pageSize:16},columns:Ce(),request:function(){var E=T()(h()().mark(function R(){var M;return h()().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,(0,x.V4)(o);case 2:if(M=Z.sent,!C){Z.next=5;break}return Z.abrupt("return",w()(w()({},M),{},{data:(0,K.Z)({dataSource:M.data,keyWord:C})}));case 5:return Z.abrupt("return",M);case 6:case"end":return Z.stop()}},R)}));function O(){return E.apply(this,arguments)}return O}()}})]})})]})},j=function(t){var r=t.customerId;return(0,e.jsxs)(z.Z,{title:"\u767C\u9001\u512A\u60E0\u5238",modalProps:{destroyOnClose:!0,centered:!0,width:400},allowUpdate:!1,readOnly:!1,submit:function(){console.log("submit")},modalFormProps:{trigger:(0,e.jsx)(k.ZP,{type:"default",children:"\u767C\u9001\u512A\u60E0\u5238"}),onFinish:function(){var o=T()(h()().mark(function d(s){return h()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return console.log("values",s),console.log("currentCustomer",r),c.prev=2,c.next=5,(0,x.ff)(w()(w()({},s),{},{receiver_id:r}));case 5:return c.next=7,(0,x._j)(r,"\u512A\u60E0\u5238\u901A\u77E5","\u60A8\u6709\u65B0\u7684\u512A\u60E0\u52B5\uFF0C\u6253\u958BApp\u7ACB\u5373\u4F7F\u7528\uFF01");case 7:return a==null||a(),$.ZP.success("\u767C\u9001\u512A\u60E0\u5238\u6210\u529F"),c.abrupt("return",!0);case 12:return c.prev=12,c.t0=c.catch(2),console.log("error",c.t0),$.ZP.error("\u767C\u9001\u512A\u60E0\u5238\u5931\u6557"),c.abrupt("return",!0);case 17:case"end":return c.stop()}},d,null,[[2,12]])}));function m(d){return o.apply(this,arguments)}return m}(),submitter:{submitButtonProps:{children:"\u786E\u8BA4\u53D1\u9001"}}},children:[(0,e.jsx)(ue.Z,{label:"\u512A\u60E0\u5238\u540D\u7A31",name:"coupon_id",width:"md",request:T()(h()().mark(function o(){var m;return h()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(0,x.mV)();case 2:return m=s.sent,console.log("couponList",m),s.abrupt("return",m.data.map(function(u){return{label:u.name,value:u.id}}));case 5:case"end":return s.stop()}},o)}))}),(0,e.jsx)(ie.Z,{label:"\u512A\u60E0\u5238\u6578\u91CF",name:"quantity",width:"md"})]})},p=function(t){var r,o=t.customerId,m=(0,I.useState)(!1),d=D()(m,2),s=d[0],u=d[1],c=(0,I.useState)(""),n=D()(c,2),C=n[0],g=n[1],H=(0,I.useRef)(),E=(0,I.useState)(function(){var S;return(S=H.current)===null||S===void 0?void 0:S.reload}),O=D()(E,2),R=O[0],M=O[1];return(0,I.useEffect)(function(){M(function(){var S;return(S=H.current)===null||S===void 0?void 0:S.reload})},[]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(k.ZP,{onClick:function(){return u(!0)},children:"\u512A\u60E0\u5238\u7D00\u9304"}),s&&(0,e.jsx)(Q.a,{title:"\u512A\u60E0\u5238\u7D00\u9304",submitter:!1,open:s,onOpenChange:u,drawerProps:{placement:"top",destroyOnClose:!0,height:"auto",style:{maxHeight:"80vh",overflow:"auto"},bodyStyle:{padding:"24px",minHeight:"200px",height:"fit-content"},contentWrapperStyle:{height:"auto",maxHeight:"80vh"},onClose:function(){return u(!1)}},children:(0,e.jsxs)(N.Z,{title:"Customer coupon page",children:[(0,e.jsx)(V.Z,{title:"Search bar",submitFun:(r=H.current)===null||r===void 0?void 0:r.reload,inputProps:{value:C,onChange:function(Z){g(Z.target.value),R==null||R()}}}),(0,e.jsx)(U.Z,{searchKey:C,props:{headerTitle:"Coupon List",actionRef:H,pagination:{pageSize:16},columns:je({mainTableReload:R}),request:function(){var S=T()(h()().mark(function we(){var W;return h()().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,(0,x.Qd)(o);case 2:if(W=Y.sent,console.log("dataSource",W),M(function(){var J;return(J=H.current)===null||J===void 0?void 0:J.reload}),!C){Y.next=7;break}return Y.abrupt("return",w()(w()({},W),{},{data:(0,K.Z)({dataSource:W.data,keyWord:C})}));case 7:return Y.abrupt("return",W);case 8:case"end":return Y.stop()}},we)}));function Z(){return S.apply(this,arguments)}return Z}()}})]})})]})};return[{title:"\u7528\u6236\u540D\u7A31",dataIndex:"name",key:"name",align:"center",fixed:"left",width:120,copyable:!0},{title:"\u7528\u6236ID",dataIndex:"id",key:"id",align:"center",copyable:!0,ellipsis:{showTitle:!0},width:150},{title:"\u8A3B\u518A\u6642\u9593",dataIndex:"createdAt",key:"createdAt",align:"center",width:150,render:function(t){return F()(t).local().format("YYYY-MM-DD HH:mm:ss")}},{title:"Email",dataIndex:"email",key:"email",align:"center",width:200,copyable:!0},{title:"\u624B\u6A5F\u865F\u78BC",dataIndex:"phone",key:"phone",align:"center",width:120,copyable:!0},{title:"\u9322\u5305",dataIndex:"wallet",key:"wallet",sorter:function(t,r){return t.wallet-r.wallet},render:function(t){var r;return"HK$".concat((r=Number(t))===null||r===void 0?void 0:r.toFixed(2))},align:"center",width:120},{title:"IC\u5361",dataIndex:"icCard",key:"icCard",align:"center",width:150,sorter:function(t,r){return!t.icCard&&!r.icCard?0:t.icCard?r.icCard?t.icCard.localeCompare(r.icCard):-1:1},render:function(t,r){return console.log("text",t),t==="-"?(0,e.jsx)(f,{customerId:r.id}):(0,e.jsx)(A,{customerId:r.id,icCardId:r.icCard})}},{title:"\u9810\u8A2D\u8ECA\u724C",dataIndex:["defaultCar","license_plate"],key:"defaultCar",render:function(t){return t==="0000"?"_":t},align:"center",width:100},{title:"\u72C0\u614B",dataIndex:["group","is_active"],key:"groupStatus",render:function(t){return(0,e.jsx)(B.Z,{color:t?"success":"error",children:t?"Active":"Inactive"})},align:"center",width:100},{title:"\u9A57\u8B49\u72C0\u614B",dataIndex:["phoneVerification","status"],key:"phoneVerification",render:function(t){return t===1?(0,e.jsx)(B.Z,{color:"success",children:"\u5DF2\u9A57\u8B49"}):t===2?(0,e.jsx)(B.Z,{color:"warning",children:"\u5FD8\u8BB0\u5BC6\u7801"}):(0,e.jsx)(B.Z,{color:"error",children:"\u672A\u9A57\u8B49"})},align:"center",width:100},{title:"\u5F53\u524D\u9A8C\u8BC1\u7801",dataIndex:["phoneVerification","otp"],key:"phoneVerification",render:function(t){return t},align:"center",width:100},{title:"\u53D1\u9001\u65F6\u95F4",dataIndex:["phoneVerification","updatedAt"],key:"phoneVerification",render:function(t){return F()(t).format("YYYY-MM-DD HH:mm:ss")},align:"center",width:100},{title:"\u9322\u5305\u64CD\u4F5C",dataIndex:"action",key:"action",sorter:function(t,r){return t.wallet-r.wallet},render:function(t,r){return(0,e.jsxs)("span",{className:"flex justify-center items-center gap-2",children:[(0,e.jsx)(v,{customerId:r.id,isRefund:!1}),(0,e.jsx)(v,{customerId:r.id,isRefund:!0})]})},align:"center"},{title:"\u5E33\u6236\u64CD\u4F5C",dataIndex:"action",key:"action",render:function(t,r){return(0,e.jsxs)("span",{className:"flex justify-center items-center gap-2",children:[(0,e.jsx)(b,{customerId:r.id}),(0,e.jsx)(P,{customerId:r.id}),(0,e.jsx)(k.ZP,{type:"text",onClick:function(){console.log("record",r),de.history.push("/transaction/order?customerId=".concat(r.id))},children:"\u67E5\u8BE2\u8BE5\u7528\u6237\u8BA2\u5355"})]})},align:"center"},{title:"\u4E0B\u767C\u512A\u60E0\u5238",dataIndex:"action",key:"action",width:100,render:function(t,r){return(0,e.jsxs)("span",{className:"flex justify-center items-center gap-2",children:[(0,e.jsx)(j,{customerId:r.id}),(0,e.jsx)(p,{customerId:r.id})]})},align:"center"}]}function Se(){var y,a=(0,I.useRef)(),f=(0,I.useState)(""),A=D()(f,2),v=A[0],b=A[1],P=(0,I.useState)(function(){var t;return(t=a.current)===null||t===void 0?void 0:t.reload}),j=D()(P,2),p=j[0],l=j[1];return(0,I.useEffect)(function(){var t,r;l(function(){var o;return(o=a.current)===null||o===void 0?void 0:o.reload}),(t=a.current)===null||t===void 0||(r=t.setPageInfo)===null||r===void 0||r.call(t,{current:1,pageSize:10})},[v]),(0,e.jsx)("div",{children:(0,e.jsxs)(N.Z,{title:"Customer account page",children:[(0,e.jsx)(V.Z,{title:"Search bar",submitFun:(y=a.current)===null||y===void 0?void 0:y.reload,inputProps:{value:v,onChange:function(r){var o=r.currentTarget.value;return b(o)}}}),(0,e.jsx)(U.Z,{searchKey:v,props:{headerTitle:"Account List",actionRef:a,columns:be({mainTableReload:p}),request:function(){var t=T()(h()().mark(function o(m){var d;return h()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return console.log("pageParams",m),u.next=3,(0,x.pw)(m,v);case 3:if(d=u.sent,console.log("dataSource",d),!v){u.next=10;break}return d.data=(0,K.Z)({dataSource:d.data,keyWord:v}),u.abrupt("return",d);case 10:return u.abrupt("return",d);case 11:case"end":return u.stop()}},o)}));function r(o){return t.apply(this,arguments)}return r}()}})]})})}}}]);