👨🏻‍💻👩🏻‍💻 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.
 
 
 

2 lines
7.8 KiB

(("undefined"!=typeof globalThis?globalThis:self)["makoChunk_ant-design-pro"]=("undefined"!=typeof globalThis?globalThis:self)["makoChunk_ant-design-pro"]||[]).push([["98b0a28d"],{"651a2e38":function(e,t,a){a.d(t,"__esModule",{value:!0}),a.e(t,{Applications:function(){return ei;},default:function(){return ei;},formatWan:function(){return ea;}});var l=a("777fffbe"),n=a("852bbaa9"),i=a("dac8af92"),r=a("9b6d4c16"),d=l._(r),o=a("51882ede"),s=l._(o),c=a("d77caa33"),f=l._(c),m=a("9a62f123"),p=l._(m),u=a("c7d71c0a"),x=a("60996a32"),h=l._(x),g=a("084468f6"),j=l._(g),v=a("78a22024"),b=l._(v),y=a("61d82ba1"),_=l._(y),S=a("f34e933b"),w=l._(S),k=a("c5150a80"),R=l._(k),C=a("adf76174"),T=l._(C),z=a("cef31543"),N=l._(z),B=a("7376d2b3"),F=l._(B),H=a("de4cb180"),O=l._(H),I=a("609f48be"),L=n._(I),A=a("f0794323"),M=a("064ecd09"),U=l._(M),V=a("98213865");let W=(0,V.createStyles)(({token:e})=>({standardFormRow:{display:"flex",marginBottom:"16px",paddingBottom:"16px",borderBottom:`1px dashed ${e.colorSplit}`,".ant-form-item, .ant-legacy-form-item":{marginRight:"24px"},".ant-form-item-label, .ant-legacy-form-item-label":{label:{marginRight:"0",color:e.colorText}},".ant-form-item-label, .ant-legacy-form-item-label, .ant-form-item-control, .ant-legacy-form-item-control":{padding:"0",lineHeight:"32px"}},label:{flex:"0 0 auto",marginRight:"24px",color:e.colorTextHeading,fontSize:e.fontSize,textAlign:"right","& > span":{display:"inline-block",height:"32px",lineHeight:"32px","&::after":{content:"'\uFF1A'"}}},content:{flex:"1 1 0",".ant-form-item, .ant-legacy-form-item":{"&:last-child":{marginRight:"0"}}},standardFormRowLast:{marginBottom:"0",paddingBottom:"0",border:"none"},standardFormRowBlock:{".ant-form-item, .ant-legacy-form-item, div.ant-form-item-control-wrapper, div.ant-legacy-form-item-control-wrapper":{display:"block"}},standardFormRowGrid:{".ant-form-item, .ant-legacy-form-item, div.ant-form-item-control-wrapper, div.ant-legacy-form-item-control-wrapper":{display:"block"},".ant-form-item-label, .ant-legacy-form-item-label":{float:"left"}}})),E=({title:e,children:t,last:a,block:l,grid:n,...r})=>{let{styles:d}=W(),o=(0,U.default)(d.standardFormRow,{[d.standardFormRowBlock]:l,[d.standardFormRowLast]:a,[d.standardFormRowGrid]:n});return(0,i.jsxs)("div",{className:o,...r,children:[e&&(0,i.jsx)("div",{className:d.label,children:(0,i.jsx)("span",{children:e})}),(0,i.jsx)("div",{className:d.content,children:t})]});};var q=a("0300f56f"),G=l._(q),$=a("c4157706"),K=l._($),D=a("61ca799d"),J=l._(D),P=a("e313b0e4");let Q=(0,V.createStyles)(({token:e})=>({tagSelect:{position:"relative",maxHeight:"32px",marginLeft:"-8px",overflow:"hidden",lineHeight:"32px",transition:"all 0.3s",userSelect:"none",".ant-tag":{marginRight:"24px",padding:"0 8px",fontSize:e.fontSize}},trigger:{position:"absolute",top:"0",right:"0","span.anticon":{fontSize:"12px"}},expanded:{maxHeight:"200px",transition:"all 0.3s"},hasExpandTag:{paddingRight:"50px"}})),{CheckableTag:X}=J.default,Y=({children:e,checked:t,onChange:a,value:l})=>(0,i.jsx)(X,{checked:!!t,onChange:e=>null==a?void 0:a(l,e),children:e},l);Y.isTagSelectOption=!0;let Z=e=>{let{styles:t}=Q(),{children:a,hideCheckAll:l=!1,className:n,style:r,expandable:d,actionsText:o={}}=e,[s,c]=(0,L.useState)(!1),[f,m]=(0,P.useMergedState)(e.defaultValue||[],{value:e.value,defaultValue:e.defaultValue,onChange:e.onChange}),p=e=>(null==e?void 0:e.type)&&(e.type.isTagSelectOption||"TagSelectOption"===e.type.displayName),u=()=>L.default.Children.toArray(a).filter(e=>p(e)).map(e=>e.props.value)||[],x=(e,t)=>{let a=[...f||[]],l=a.indexOf(e);t&&-1===l?a.push(e):!t&&l>-1&&a.splice(l,1),m(a);},h=u().length===(null==f?void 0:f.length),{expandText:g="\u5C55\u5F00",collapseText:j="\u6536\u8D77",selectAllText:v="\u5168\u90E8"}=o,b=(0,U.default)(t.tagSelect,n,{[t.hasExpandTag]:d,[t.expanded]:s});return(0,i.jsxs)("div",{className:b,style:r,children:[l?null:(0,i.jsx)(X,{checked:h,onChange:e=>{let t=[];e&&(t=u()),m(t);},children:v},"tag-select-__all__"),a&&L.default.Children.map(a,e=>p(e)?L.default.cloneElement(e,{key:`tag-select-${e.props.value}`,value:e.props.value,checked:f&&f.indexOf(e.props.value)>-1,onChange:x}):e),d&&(0,i.jsx)("a",{className:t.trigger,onClick:()=>{c(!s);},children:s?(0,i.jsxs)(i.Fragment,{children:[j," ",(0,i.jsx)(K.default,{})]}):(0,i.jsxs)(i.Fragment,{children:[g,(0,i.jsx)(G.default,{})]})})]});};async function ee(e){return(0,u.request)("/api/fake_list",{params:e});}Z.Option=Y;let et=(0,V.createStyles)(({token:e})=>({filterCardList:{".ant-card-meta-content":{marginTop:"0"},".ant-card-meta-avatar":{fontSize:"0"},".ant-list .ant-list-item-content-single":{maxWidth:"100%"}},cardInfo:{marginTop:"16px",marginLeft:"40px",zoom:"1","&::before, &::after":{display:"table",content:"' '"},"&::after":{clear:"both",height:"0",fontSize:"0",visibility:"hidden"},"& > div":{position:"relative",float:"left",width:"50%",textAlign:"left",p:{margin:"0",fontSize:"24px",lineHeight:"32px"},"p:first-child":{marginBottom:"4px",color:e.colorTextSecondary,fontSize:"12px",lineHeight:"20px"}}}}));function ea(e){let t=1*e;if(!t||Number.isNaN(t))return"";let a=e;return e>1e4&&(a=(0,i.jsxs)("span",{children:[Math.floor(e/1e4),(0,i.jsx)("span",{style:{position:"relative",top:-2,fontSize:14,fontStyle:"normal",marginLeft:2},children:"\u4E07"})]})),a;}let el={wrapperCol:{xs:{span:24},sm:{span:16}}},en=({activeUser:e,newUser:t})=>{let{styles:a}=et();return(0,i.jsxs)("div",{className:a.cardInfo,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{children:"\u6D3B\u8DC3\u7528\u6237"}),(0,i.jsx)("p",{children:e})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{children:"\u65B0\u589E\u7528\u6237"}),(0,i.jsx)("p",{children:t})]})]});},ei=()=>{let{styles:e}=et(),{data:t,loading:a,run:l}=(0,u.useRequest)(e=>(console.log("form data",e),ee({count:8}))),n=(null==t?void 0:t.list)||[];return(0,i.jsxs)("div",{className:e.filterCardList,children:[(0,i.jsx)(j.default,{variant:"borderless",children:(0,i.jsxs)(w.default,{onValuesChange:(e,t)=>{l(t);},children:[(0,i.jsx)(E,{title:"\u6240\u5C5E\u7C7B\u76EE",block:!0,style:{paddingBottom:11},children:(0,i.jsx)(w.default.Item,{name:"category",children:(0,i.jsx)(Z,{expandable:!0,children:A.categoryOptions.filter(e=>void 0!==e.value&&null!==e.value).map(e=>(0,i.jsx)(Z.Option,{value:e.value,children:e.label},e.value))})})}),(0,i.jsx)(E,{title:"\u5176\u5B83\u9009\u9879",grid:!0,last:!0,children:(0,i.jsxs)(T.default,{gutter:16,children:[(0,i.jsx)(b.default,{lg:8,md:10,sm:10,xs:24,children:(0,i.jsx)(w.default.Item,{...el,name:"author",label:"\u4F5C\u8005",children:(0,i.jsx)(N.default,{placeholder:"\u4E0D\u9650",style:{maxWidth:200,width:"100%"},options:[{label:"\u738B\u662D\u541B",value:"lisa"}]})})}),(0,i.jsx)(b.default,{lg:8,md:10,sm:10,xs:24,children:(0,i.jsx)(w.default.Item,{...el,name:"rate",label:"\u597D\u8BC4\u5EA6",children:(0,i.jsx)(N.default,{placeholder:"\u4E0D\u9650",style:{maxWidth:200,width:"100%"},options:[{label:"\u4F18\u79C0",value:"good"},{label:"\u666E\u901A",value:"normal"}]})})})]})})]})}),(0,i.jsx)("br",{}),(0,i.jsx)(R.default,{rowKey:"id",grid:{gutter:16,xs:1,sm:2,md:3,lg:3,xl:4,xxl:4},loading:a,dataSource:n,renderItem:e=>(0,i.jsx)(R.default.Item,{children:(0,i.jsxs)(j.default,{hoverable:!0,styles:{body:{paddingBottom:20}},actions:[(0,i.jsx)(F.default,{title:"\u4E0B\u8F7D",children:(0,i.jsx)(d.default,{})},"download"),(0,i.jsx)(F.default,{title:"\u7F16\u8F91",children:(0,i.jsx)(s.default,{})},"edit"),(0,i.jsx)(F.default,{title:"\u5206\u4EAB",children:(0,i.jsx)(p.default,{})},"share"),(0,i.jsx)(_.default,{menu:{items:[{key:"1",title:"1st menu item"},{key:"2",title:"2st menu item"}]},children:(0,i.jsx)(f.default,{})},"ellipsis")],children:[(0,i.jsx)(j.default.Meta,{avatar:(0,i.jsx)(h.default,{size:"small",src:e.avatar}),title:e.title}),(0,i.jsx)("div",{children:(0,i.jsx)(en,{activeUser:ea(e.activeUser),newUser:(0,O.default)(e.newUser).format("0,0")})})]})},e.id)})]});};}}]);
//# sourceMappingURL=98b0a28d-async.9c86e095.js.map