👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
9.9 KiB

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[6202],{24519:function(He,k,n){n.r(k),n.d(k,{BasicList:function(){return $},default:function(){return Ae}});var J=n(28152),B=n.n(J),K=n(82574),Q=n(1442),W=n(95943),v=n(27533),H=n(22900),U=n(33952),q=n(17519),_=n(45319),ee=n(10591),N=n(50304),te=n(23870),E=n(82099),A=n(90543),ne=n(21757),b=n(47100),ae=n(5726),re=n.n(ae),D=n(50959),se=n(13448),o=n.n(se),ie=n(74815),y=n.n(ie),ue=n(76022),le=n(60010),oe=n(98150),de=n(79712),ce=n(59224),me=n(6053),he=n(21320),d=n.n(he),pe=n(8700),xe=(0,pe.kc)(function(i){var a,s,t=i.token;return{standardList:d()({".ant-card-head":{borderBottom:"none"},".ant-card-head-title":{padding:"24px 0",lineHeight:"32px"},".ant-card-extra":{padding:"24px 0"},".ant-list-pagination":{marginTop:"24px",textAlign:"right"},".ant-avatar-lg":{width:"48px",height:"48px",lineHeight:"48px"}},"@media screen and (max-width: ".concat(t.screenXS,"px)"),{".ant-list-item-content":{display:"block",flex:"none",width:"100%"},".ant-list-item-action":{marginLeft:"0"}}),headerInfo:d()({position:"relative",textAlign:"center","& > span":{display:"inline-block",marginBottom:"4px",color:t.colorTextSecondary,fontSize:t.fontSize,lineHeight:"22px"},"& > p":{margin:"0",color:t.colorTextHeading,fontSize:"24px",lineHeight:"32px"},"& > em":{position:"absolute",top:"0",right:"0",width:"1px",height:"56px",backgroundColor:t.colorSplit}},"@media screen and (max-width: ".concat(t.screenSM,"px)"),{marginBottom:"16px","& > em":{display:"none"}}),listContent:(a={fontSize:"0"},d()(a,"@media screen and (max-width: ".concat(t.screenXS,"px)"),{marginLeft:"0","& > div":{marginLeft:"0"}}),d()(a,"@media screen and (max-width: ".concat(t.screenMD,"px)"),{"& > div":{display:"block"},"& > div:last-child":{top:"0",width:"100%"}}),d()(a,"@media screen and (max-width: ".concat(t.screenLG,"px) and (min-width: @screen-md)"),{"& > div":{display:"block"},"& > div:last-child":{top:"0",width:"100%"}}),d()(a,"@media screen and (max-width: ".concat(t.screenXL,"px)"),{"& > div":{marginLeft:"24px"},"& > div:last-child":{top:"0"}}),d()(a,"@media screen and (max-width: 1400px)",{textAlign:"right","& > div:last-child":{top:"0"}}),a),listContentItem:{display:"inline-block",marginLeft:"40px",color:t.colorTextSecondary,fontSize:t.fontSize,verticalAlign:"middle","> span":{lineHeight:"20px"},"> p":{marginTop:"4px",marginBottom:"0",lineHeight:"22px"}},extraContentSearch:d()({width:"272px",marginLeft:"16px"},"@media screen and (max-width: ".concat(t.screenSM,"px)"),{width:"100%",marginLeft:"0"}),listCard:(s={},d()(s,"@media screen and (max-width: ".concat(t.screenXS,"px)"),{".ant-card-head-title":{overflow:"open"}}),d()(s,"@media screen and (max-width: ".concat(t.screenMD,"px)"),{".ant-radio-group":{display:"block",marginBottom:"8px"}}),s),standardListForm:{".ant-form-item":{marginBottom:"12px","&:last-child":{marginBottom:"32px",paddingTop:"4px"}}},formResult:{width:"100%","[class^='title']":{marginBottom:"8px"}}}}),C=xe,e=n(11527),ve=function(a){var s=C(),t=s.styles,l=a.done,m=a.open,c=a.current,g=a.onDone,h=a.onSubmit,I=a.children;return m?(0,e.jsx)(ue.Y,{open:m,title:l?null:"\u4EFB\u52A1".concat(c?"\u7F16\u8F91":"\u6DFB\u52A0"),className:t.standardListForm,width:640,onFinish:function(){var p=y()(o()().mark(function S(F){return o()().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:h(F);case 1:case"end":return j.stop()}},S)}));return function(S){return p.apply(this,arguments)}}(),initialValues:c,submitter:{render:function(S,F){return l?null:F}},trigger:(0,e.jsx)(e.Fragment,{children:I}),modalProps:{onCancel:function(){return g()},destroyOnClose:!0,bodyStyle:l?{padding:"72px 0"}:{}},children:l?(0,e.jsx)(me.ZP,{status:"success",title:"\u64CD\u4F5C\u6210\u529F",subTitle:"\u4E00\u7CFB\u5217\u7684\u4FE1\u606F\u63CF\u8FF0\uFF0C\u5F88\u77ED\u540C\u6837\u4E5F\u53EF\u4EE5\u5E26\u6807\u70B9\u3002",extra:(0,e.jsx)(b.ZP,{type:"primary",onClick:g,children:"\u77E5\u9053\u4E86"}),className:t.formResult}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(le.Z,{name:"title",label:"\u4EFB\u52A1\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}],placeholder:"\u8BF7\u8F93\u5165"}),(0,e.jsx)(oe.Z,{name:"createdAt",label:"\u5F00\u59CB\u65F6\u95F4",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4"}],fieldProps:{style:{width:"100%"}},placeholder:"\u8BF7\u9009\u62E9"}),(0,e.jsx)(de.Z,{name:"owner",label:"\u4EFB\u52A1\u8D1F\u8D23\u4EBA",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4EFB\u52A1\u8D1F\u8D23\u4EBA"}],options:[{label:"\u4ED8\u6653\u6653",value:"xiao"},{label:"\u5468\u6BDB\u6BDB",value:"mao"}],placeholder:"\u8BF7\u9009\u62E9\u7BA1\u7406\u5458"}),(0,e.jsx)(ce.Z,{name:"subDescription",label:"\u4EA7\u54C1\u63CF\u8FF0",rules:[{message:"\u8BF7\u8F93\u5165\u81F3\u5C11\u4E94\u4E2A\u5B57\u7B26\u7684\u4EA7\u54C1\u63CF\u8FF0\uFF01",min:5}],placeholder:"\u8BF7\u8F93\u5165\u81F3\u5C11\u4E94\u4E2A\u5B57\u7B26"})]})}):null},fe=ve,ge=n(77117),f=n.n(ge);function Fe(i){return L.apply(this,arguments)}function L(){return L=y()(o()().mark(function i(a){return o()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,v.request)("/api/get_list",{params:a}));case 1:case"end":return t.stop()}},i)})),L.apply(this,arguments)}function je(i){return Z.apply(this,arguments)}function Z(){return Z=y()(o()().mark(function i(a){return o()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,v.request)("/api/post_fake_list",{method:"POST",data:f()(f()({},a),{},{method:"delete"})}));case 1:case"end":return t.stop()}},i)})),Z.apply(this,arguments)}function ye(i){return T.apply(this,arguments)}function T(){return T=y()(o()().mark(function i(a){return o()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,v.request)("/api/post_fake_list",{method:"POST",data:f()(f()({},a),{},{method:"post"})}));case 1:case"end":return t.stop()}},i)})),T.apply(this,arguments)}function Se(i){return w.apply(this,arguments)}function w(){return w=y()(o()().mark(function i(a){return o()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,v.request)("/api/post_fake_list",{method:"POST",data:f()(f()({},a),{},{method:"update"})}));case 1:case"end":return t.stop()}},i)})),w.apply(this,arguments)}var P=H.ZP.Button,Ce=H.ZP.Group,Be=U.Z.Search,M=function(a){var s=a.title,t=a.value,l=a.bordered,m=C(),c=m.styles;return(0,e.jsxs)("div",{className:c.headerInfo,children:[(0,e.jsx)("span",{children:s}),(0,e.jsx)("p",{children:t}),l&&(0,e.jsx)("em",{})]})},Ee=function(a){var s=a.data,t=s.owner,l=s.createdAt,m=s.percent,c=s.status,g=C(),h=g.styles;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:h.listContentItem,children:[(0,e.jsx)("span",{children:"Owner"}),(0,e.jsx)("p",{children:t})]}),(0,e.jsxs)("div",{className:h.listContentItem,children:[(0,e.jsx)("span",{children:"\u5F00\u59CB\u65F6\u95F4"}),(0,e.jsx)("p",{children:re()(l).format("YYYY-MM-DD HH:mm")})]}),(0,e.jsx)("div",{className:h.listContentItem,children:(0,e.jsx)(q.Z,{percent:m,status:c,strokeWidth:6,style:{width:180}})})]})},$=function(){var a=C(),s=a.styles,t=(0,D.useState)(!1),l=B()(t,2),m=l[0],c=l[1],g=(0,D.useState)(!1),h=B()(g,2),I=h[0],p=h[1],S=(0,D.useState)(void 0),F=B()(S,2),G=F[0],j=F[1],O=(0,v.useRequest)(function(){return Fe({count:50})}),z=O.data,De=O.loading,Le=O.mutate,Ze=(0,v.useRequest)(function(u,r){return u==="remove"?je(r):u==="update"?Se(r):ye(r)},{manual:!0,onSuccess:function(r){Le(r)}}),Y=Ze.run,X=(z==null?void 0:z.list)||[],Te={showSizeChanger:!0,showQuickJumper:!0,pageSize:5,total:X.length},V=function(r){p(!0),j(r)},we=function(r){Y("remove",{id:r})},Pe=function(r,x){r==="edit"?V(x):r==="delete"&&_.Z.confirm({title:"\u5220\u9664\u4EFB\u52A1",content:"\u786E\u5B9A\u5220\u9664\u8BE5\u4EFB\u52A1\u5417\uFF1F",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){return we(x.id)}})},Me=(0,e.jsxs)("div",{children:[(0,e.jsxs)(Ce,{defaultValue:"all",children:[(0,e.jsx)(P,{value:"all",children:"\u5168\u90E8"}),(0,e.jsx)(P,{value:"progress",children:"\u8FDB\u884C\u4E2D"}),(0,e.jsx)(P,{value:"waiting",children:"\u7B49\u5F85\u4E2D"})]}),(0,e.jsx)(Be,{className:s.extraContentSearch,placeholder:"\u8BF7\u8F93\u5165",onSearch:function(){return{}}})]}),Ie=function(r){var x=r.item;return(0,e.jsx)(ee.Z,{menu:{onClick:function(Re){var ke=Re.key;return Pe(ke,x)},items:[{key:"edit",label:"\u7F16\u8F91"},{key:"delete",label:"\u5220\u9664"}]},children:(0,e.jsxs)("a",{children:["\u66F4\u591A ",(0,e.jsx)(K.Z,{})]})})},Oe=function(){c(!1),p(!1),j({})},ze=function(r){c(!0);var x=r!=null&&r.id?"update":"add";Y(x,r)};return(0,e.jsxs)("div",{children:[(0,e.jsx)(W._z,{children:(0,e.jsxs)("div",{className:s.standardList,children:[(0,e.jsx)(N.Z,{bordered:!1,children:(0,e.jsxs)(te.Z,{children:[(0,e.jsx)(E.Z,{sm:8,xs:24,children:(0,e.jsx)(M,{title:"\u6211\u7684\u5F85\u529E",value:"8\u4E2A\u4EFB\u52A1",bordered:!0})}),(0,e.jsx)(E.Z,{sm:8,xs:24,children:(0,e.jsx)(M,{title:"\u672C\u5468\u4EFB\u52A1\u5E73\u5747\u5904\u7406\u65F6\u95F4",value:"32\u5206\u949F",bordered:!0})}),(0,e.jsx)(E.Z,{sm:8,xs:24,children:(0,e.jsx)(M,{title:"\u672C\u5468\u5B8C\u6210\u4EFB\u52A1\u6570",value:"24\u4E2A\u4EFB\u52A1"})})]})}),(0,e.jsx)(N.Z,{className:s.listCard,bordered:!1,title:"\u57FA\u672C\u5217\u8868",style:{marginTop:24},bodyStyle:{padding:"0 32px 40px 32px"},extra:Me,children:(0,e.jsx)(A.Z,{size:"large",rowKey:"id",loading:De,pagination:Te,dataSource:X,renderItem:function(r){return(0,e.jsxs)(A.Z.Item,{actions:[(0,e.jsx)("a",{onClick:function(R){R.preventDefault(),V(r)},children:"\u7F16\u8F91"},"edit"),(0,e.jsx)(Ie,{item:r},"more")],children:[(0,e.jsx)(A.Z.Item.Meta,{avatar:(0,e.jsx)(ne.C,{src:r.logo,shape:"square",size:"large"}),title:(0,e.jsx)("a",{href:r.href,children:r.title}),description:r.subDescription}),(0,e.jsx)(Ee,{data:r})]})}})})]})}),(0,e.jsxs)(b.ZP,{type:"dashed",onClick:function(){p(!0)},style:{width:"100%",marginBottom:8},children:[(0,e.jsx)(Q.Z,{}),"\u6DFB\u52A0"]}),(0,e.jsx)(fe,{done:m,open:I,current:G,onDone:Oe,onSubmit:ze})]})},Ae=$}}]);