1 |
- "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[982],{5966:function(ne,G,a){var I=a(97685),u=a(1413),d=a(45987),D=a(21770),A=a(23323),X=a(55241),S=a(97435),Q=a(62435),j=a(16764),p=a(86074),U=["fieldProps","proFieldProps"],Y=["fieldProps","proFieldProps"],h="text",o=function(i){var l=i.fieldProps,x=i.proFieldProps,g=(0,d.Z)(i,U);return(0,p.jsx)(j.Z,(0,u.Z)({valueType:h,fieldProps:l,filedConfig:{valueType:h},proFieldProps:x},g))},k=function(i){var l=(0,D.Z)(i.open||!1,{value:i.open,onChange:i.onOpenChange}),x=(0,I.Z)(l,2),g=x[0],W=x[1];return(0,p.jsx)(A.Z.Item,{shouldUpdate:!0,noStyle:!0,children:function(K){var P,n=K.getFieldValue(i.name||[]);return(0,p.jsx)(X.Z,(0,u.Z)((0,u.Z)({getPopupContainer:function(e){return e&&e.parentNode?e.parentNode:e},onOpenChange:function(e){return W(e)},content:(0,p.jsxs)("div",{style:{padding:"4px 0"},children:[(P=i.statusRender)===null||P===void 0?void 0:P.call(i,n),i.strengthText?(0,p.jsx)("div",{style:{marginTop:10},children:(0,p.jsx)("span",{children:i.strengthText})}):null]}),overlayStyle:{width:240},placement:"rightTop"},i.popoverProps),{},{open:g,children:i.children}))}})},q=function(i){var l=i.fieldProps,x=i.proFieldProps,g=(0,d.Z)(i,Y),W=(0,Q.useState)(!1),w=(0,I.Z)(W,2),K=w[0],P=w[1];return l!=null&&l.statusRender&&g.name?(0,p.jsx)(k,{name:g.name,statusRender:l==null?void 0:l.statusRender,popoverProps:l==null?void 0:l.popoverProps,strengthText:l==null?void 0:l.strengthText,open:K,onOpenChange:P,children:(0,p.jsx)("div",{children:(0,p.jsx)(j.Z,(0,u.Z)({valueType:"password",fieldProps:(0,u.Z)((0,u.Z)({},(0,S.Z)(l,["statusRender","popoverProps","strengthText"])),{},{onBlur:function(r){var e;l==null||(e=l.onBlur)===null||e===void 0||e.call(l,r),P(!1)},onClick:function(r){var e;l==null||(e=l.onClick)===null||e===void 0||e.call(l,r),P(!0)}}),proFieldProps:x,filedConfig:{valueType:h}},g))})}):(0,p.jsx)(j.Z,(0,u.Z)({valueType:"password",fieldProps:l,proFieldProps:x,filedConfig:{valueType:h}},g))},$=o;$.Password=q,$.displayName="ProFormComponent",G.Z=$},1273:function(ne,G,a){a.r(G),a.d(G,{default:function(){return r}});var I=a(5574),u=a.n(I),d=a(62435),D=a(59530),A=a(28459),X=a(15009),S=a.n(X),Q=a(99289),j=a.n(Q),p=a(67211),U=a(34041),Y=a(14726),h=a(39680),o=a(86074),k={label:"name",value:"id"},q=function(t){var s=t.dispatch,L=t.getId,B=t.dictModel,f=t.openModel,F=(0,d.useRef)(),E=(0,d.useState)([]),T=u()(E,2),J=T[0],c=T[1],_=(0,d.useState)(0),b=u()(_,2),Z=b[0],ee=b[1],O=(0,d.useState)(1),y=u()(O,2),C=y[0],v=y[1],V=(0,d.useState)(10),R=u()(V,2),ae=R[0],re=R[1],oe=function(M){L(M)};return(0,d.useEffect)(function(){f.openModal||F.current.reload()},[f.openModal]),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(A.ZP,{theme:{token:{colorPrimary:"#4FBE70",colorLink:"#4FBE70"}},children:(0,o.jsx)(p.Z,{scroll:{x:1300},actionRef:F,dataSource:J,columns:[{title:"\u7528\u6237",dataIndex:"username",width:200},{title:"\u90AE\u7BB1",dataIndex:"email",search:!1},{title:"\u8054\u7CFB\u65B9\u5F0F",dataIndex:"mobile",search:!1},{title:"\u767B\u5F55\u6B21\u6570",dataIndex:"login_count",search:!1},{title:"\u8D26\u53F7\u72B6\u6001",dataIndex:"status",render:function(M,m){return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(U.Z,{style:{width:"100%"},value:m.status===1?"\u4F7F\u7528":"\u7981\u7528",options:[{name:"\u6B63\u5E38",id:1},{name:"\u7981\u7528",id:2}],fieldNames:k,onChange:function(N){(0,h.Spq)({id:m.id,status:N}).then(function(te){F.current.reload()})}})})})},valueType:"select",valueEnum:{0:{text:"\u5168\u90E8"},1:{text:"\u4F7F\u7528\u4E2D"},2:{text:"\u5DF2\u7981\u7528"}}},{title:"\u6CE8\u518C\u65E5\u671F",dataIndex:"created_at",search:!1},{title:"\u64CD\u4F5C",width:100,key:"option",valueType:"option",fixed:"right",render:function(M,m,le){return[(0,o.jsx)(Y.ZP,{type:"link",onClick:function(){oe(m),s({type:"openModel/getOpenModal",payload:!0})},children:"\u7F16\u8F91"},"1")]}}],rowKey:"id",pagination:{current:C,pageSize:ae,showSizeChanger:!0,total:Z,pageSizeOptions:[9,18,27,99],onChange:function(M,m){v(M),re(m)},onShowSizeChange:function(M,m){v(M),re(m)}},request:j()(S()().mark(function H(){var M,m=arguments;return S()().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return M=m.length>0&&m[0]!==void 0?m[0]:{},N.abrupt("return",(0,h.geC)({page:C,pagesize:ae,sort:"id",sortby:"desc",keyword:M.username,status:M.status,role:1}).then(function(te){c(te.data.customers),ee(te.data.total)}));case 2:case"end":return N.stop()}},H)})),headerTitle:"\u7B80\u5386\u5217\u8868"})})})},$=(0,D.connect)(function(e){var t=e.dictModel,s=e.openModel;return{dictModel:t,openModel:s}})(q),z=a(97269),i=a(5966),l=a(17788),x=a(86250),g=a(42075),W=a(68872),w={label:"full_name",value:"id"},K=function(t){var s=t.dispatch,L=t.dictModel,B=t.openModel,f=t.id,F=(0,d.useRef)(),E=(0,d.useState)(!1),T=u()(E,2),J=T[0],c=T[1],_=(0,d.useState)(null),b=u()(_,2),Z=b[0],ee=b[1];return(0,d.useEffect)(function(){c(B.openModal)},[B.openModal]),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(A.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:(0,o.jsx)(l.Z,{open:J,title:"\u7F16\u8F91\u6C42\u804C\u8005\u8D26\u53F7",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:1e3,onCancel:function(){s({type:"openModel/getOpenModal",payload:!1})},children:(0,o.jsxs)(z.A,{formRef:F,request:j()(S()().mark(function O(){var y;return S()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(!f){v.next=5;break}return v.next=3,(0,h.laW)({id:f.id});case 3:return y=v.sent,v.abrupt("return",y.data);case 5:case"end":return v.stop()}},O)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(y,C){return(0,o.jsxs)(x.Z,{justify:"flex-end",children:[" ",(0,o.jsx)(g.Z,{children:C})]})},onReset:function(){ee(null),c(!1)}},onFinish:function(){var O=j()(S()().mark(function y(C){var v;return S()().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return console.log(C),C.id=f.id,R.next=4,(0,h.Spq)(C);case 4:v=R.sent,W.ZP.success("\u63D0\u4EA4\u6210\u529F"),s({type:"openModel/getOpenModal",payload:!1});case 7:case"end":return R.stop()}},y)}));return function(y){return O.apply(this,arguments)}}(),children:[(0,o.jsx)(i.Z,{name:"mobile",label:"\u624B\u673A\u53F7",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"}),(0,o.jsx)(i.Z,{name:"email",label:"\u90AE\u7BB1",placeholder:"\u8BF7\u8F93\u5165\u90AE\u7BB1"})]})})})})},P=(0,D.connect)(function(e){var t=e.dictModel,s=e.openModel;return{dictModel:t,openModel:s}})(K),n=function(t){var s=t.dispatch,L=t.openModel,B=(0,d.useState)(null),f=u()(B,2),F=f[0],E=f[1],T=function(c){E(c)};return(0,d.useEffect)(function(){L.openModal||E(0)},[L.openModal]),(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(A.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:[(0,o.jsx)($,{getId:T}),(0,o.jsx)(P,{id:F})]})})},r=(0,D.connect)(function(e){var t=e.openModel;return{openModel:t}})(n)},86250:function(ne,G,a){a.d(G,{Z:function(){return P}});var I=a(62435),u=a(93967),d=a.n(u),D=a(98423),A=a(98065),X=a(53124),S=a(92030),Q=a(45503);const j=["wrap","nowrap","wrap-reverse"],p=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],U=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],Y=(n,r)=>{const e=r.wrap===!0?"wrap":r.wrap;return{[`${n}-wrap-${e}`]:e&&j.includes(e)}},h=(n,r)=>{const e={};return U.forEach(t=>{e[`${n}-align-${t}`]=r.align===t}),e[`${n}-align-stretch`]=!r.align&&!!r.vertical,e},o=(n,r)=>{const e={};return p.forEach(t=>{e[`${n}-justify-${t}`]=r.justify===t}),e};function k(n,r){return d()(Object.assign(Object.assign(Object.assign({},Y(n,r)),h(n,r)),o(n,r)))}var q=k;const $=n=>{const{componentCls:r}=n;return{[r]:{display:"flex","&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}},z=n=>{const{componentCls:r}=n;return{[r]:{"&-gap-small":{gap:n.flexGapSM},"&-gap-middle":{gap:n.flexGap},"&-gap-large":{gap:n.flexGapLG}}}},i=n=>{const{componentCls:r}=n,e={};return j.forEach(t=>{e[`${r}-wrap-${t}`]={flexWrap:t}}),e},l=n=>{const{componentCls:r}=n,e={};return U.forEach(t=>{e[`${r}-align-${t}`]={alignItems:t}}),e},x=n=>{const{componentCls:r}=n,e={};return p.forEach(t=>{e[`${r}-justify-${t}`]={justifyContent:t}}),e},g=()=>({});var W=(0,S.I$)("Flex",n=>{const{paddingXS:r,padding:e,paddingLG:t}=n,s=(0,Q.TS)(n,{flexGapSM:r,flexGap:e,flexGapLG:t});return[$(s),z(s),i(s),l(s),x(s)]},g,{resetStyle:!1}),w=function(n,r){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0&&(e[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(n);s<t.length;s++)r.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(n,t[s])&&(e[t[s]]=n[t[s]]);return e},P=I.forwardRef((n,r)=>{const{prefixCls:e,rootClassName:t,className:s,style:L,flex:B,gap:f,children:F,vertical:E=!1,component:T="div"}=n,J=w(n,["prefixCls","rootClassName","className","style","flex","gap","children","vertical","component"]),{flex:c,direction:_,getPrefixCls:b}=I.useContext(X.E_),Z=b("flex",e),[ee,O,y]=W(Z),C=E!=null?E:c==null?void 0:c.vertical,v=d()(s,t,c==null?void 0:c.className,Z,O,y,q(Z,n),{[`${Z}-rtl`]:_==="rtl",[`${Z}-gap-${f}`]:(0,A.n)(f),[`${Z}-vertical`]:C}),V=Object.assign(Object.assign({},c==null?void 0:c.style),L);return B&&(V.flex=B),f&&!(0,A.n)(f)&&(V.gap=f),ee(I.createElement(T,Object.assign({ref:r,className:v,style:V},(0,D.Z)(J,["justify","wrap","align"])),F))})}}]);
|