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
8.1 KiB
1 lines
8.1 KiB
(globalThis.utooChunk_ant_design_pro||(globalThis.utooChunk_ant_design_pro=[])).push(["object"==typeof document?document.currentScript:void 0,76820,245538,e=>{"use strict";var t=e.i(84443).Col;e.s(["Col",()=>t],76820);var l=e.i(247699).Row;e.s(["Row",()=>l],245538)},184897,e=>{"use strict";let t=Array.from({length:12}).map((e,t)=>({value:`cat${t+1}`,label:`类目${t+1}`}));e.s(["categoryOptions",0,t])},600802,e=>{"use strict";var t=e.i(391398),l=e.i(82275),r=e.i(946077),i=e.i(76820),o=e.i(882474),n=e.i(326440),a=e.i(245538),s=e.i(847942),d=e.i(560370),c=e.i(494834),u=e.i(191788),h=e.i(157413),m=e.i(184897),f=e.i(535898);async function p(e){return(0,f.request)("/api/fake_list",{params:e})}let g=(0,e.i(827830).createStyles)(({token:e})=>({card:{".ant-card-meta-title":{marginBottom:"4px","& > a":{display:"inline-block",maxWidth:"100%",color:e.colorTextHeading}},".ant-card-meta-description":{height:"44px",overflow:"hidden",lineHeight:"22px"},"&:hover":{".ant-card-meta-title > a":{color:e.colorPrimary}}},cardItemContent:{display:"flex",height:"20px",marginTop:"16px",marginBottom:"-4px",lineHeight:"20px","& > span":{flex:"1",color:e.colorTextSecondary,fontSize:"12px"}},avatarList:{flex:"0 1 auto"},cardList:{marginTop:"24px"},coverCardList:{".ant-list .ant-list-item-content-single":{maxWidth:"100%"}}})),x=o.Form.Item,{Paragraph:v}=d.Typography;var b=()=>{let{styles:e}=g(),[d,f]=(0,u.useState)({}),{data:b,isLoading:y}=(0,l.useQuery)({queryKey:["search-projects",d],queryFn:()=>p({count:8,...d}).then(e=>e.data)}),w=b?.list||[],j=w&&(0,t.jsx)(n.List,{rowKey:"id",loading:y,grid:{gutter:16,xs:1,sm:2,md:3,lg:3,xl:4,xxl:4},dataSource:w,renderItem:l=>(0,t.jsx)(n.List.Item,{children:(0,t.jsxs)(r.Card,{className:e.card,hoverable:!0,cover:(0,t.jsx)("img",{alt:l.title,src:l.cover}),children:[(0,t.jsx)(r.Card.Meta,{title:(0,t.jsx)("a",{children:l.title}),description:(0,t.jsx)(v,{ellipsis:{rows:2},children:l.subDescription})}),(0,t.jsxs)("div",{className:e.cardItemContent,children:[(0,t.jsx)("span",{children:(0,c.default)(l.updatedAt).fromNow()}),(0,t.jsx)("div",{className:e.avatarList,children:(0,t.jsx)(h.AvatarList,{size:"small",children:l.members.map((e,r)=>{let i;return(0,t.jsx)(h.AvatarList.Item,{src:e.avatar,tips:e.name},(i=l.id,`${i}-${r}`))})})})]})]})})}),C={wrapperCol:{xs:{span:24},sm:{span:16}}};return(0,t.jsxs)("div",{className:e.coverCardList,children:[(0,t.jsx)(r.Card,{variant:"borderless",children:(0,t.jsxs)(o.Form,{layout:"inline",onValuesChange:(e,t)=>{f(t)},children:[(0,t.jsx)(h.StandardFormRow,{title:"所属类目",block:!0,style:{paddingBottom:11},children:(0,t.jsx)(x,{name:"category",children:(0,t.jsx)(h.TagSelect,{expandable:!0,children:m.categoryOptions.filter(e=>void 0!==e.value&&null!==e.value).map(e=>(0,t.jsx)(h.TagSelect.Option,{value:e.value,children:e.label},e.value))})})}),(0,t.jsx)(h.StandardFormRow,{title:"其它选项",grid:!0,last:!0,children:(0,t.jsxs)(a.Row,{gutter:16,children:[(0,t.jsx)(i.Col,{lg:8,md:10,sm:10,xs:24,children:(0,t.jsx)(x,{...C,label:"作者",name:"author",children:(0,t.jsx)(s.Select,{placeholder:"不限",style:{maxWidth:200,width:"100%"},options:[{label:"王昭君",value:"lisa"}]})})}),(0,t.jsx)(i.Col,{lg:8,md:10,sm:10,xs:24,children:(0,t.jsx)(x,{...C,label:"好评度",name:"rate",children:(0,t.jsx)(s.Select,{placeholder:"不限",style:{maxWidth:200,width:"100%"},options:[{label:"优秀",value:"good"},{label:"普通",value:"normal"}]})})})]})})]})}),(0,t.jsx)("div",{className:e.cardList,children:j})]})};e.s(["default",()=>b],600802)},749344,236107,e=>{"use strict";var t=e.i(191788),l=e.i(316419),r=e.i(938667);let i=e=>"object"==typeof e&&null!=e&&1===e.nodeType,o=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,n=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let l,r=getComputedStyle(e,null);return o(r.overflowY,t)||o(r.overflowX,t)||!!(l=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e))&&(l.clientHeight<e.scrollHeight||l.clientWidth<e.scrollWidth)}return!1},a=(e,t,l,r,i,o,n,a)=>o<e&&n>t||o>e&&n<t?0:o<=e&&a<=l||n>=t&&a>=l?o-e-r:n>t&&a<l||o<e&&a>l?n-t+i:0,s=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},d=(e,t)=>{var l,r,o,d;let c;if("u"<typeof document)return[];let{scrollMode:u,block:h,inline:m,boundary:f,skipOverflowHiddenElements:p}=t,g="function"==typeof f?f:e=>e!==f;if(!i(e))throw TypeError("Invalid target");let x=document.scrollingElement||document.documentElement,v=[],b=e;for(;i(b)&&g(b);){if((b=s(b))===x){v.push(b);break}null!=b&&b===document.body&&n(b)&&!n(document.documentElement)||null!=b&&n(b,p)&&v.push(b)}let y=null!=(r=null==(l=window.visualViewport)?void 0:l.width)?r:innerWidth,w=null!=(d=null==(o=window.visualViewport)?void 0:o.height)?d:innerHeight,{scrollX:j,scrollY:C}=window,{height:F,width:W,top:_,right:M,bottom:S,left:I}=e.getBoundingClientRect(),{top:N,right:T,bottom:L,left:H}={top:parseFloat((c=window.getComputedStyle(e)).scrollMarginTop)||0,right:parseFloat(c.scrollMarginRight)||0,bottom:parseFloat(c.scrollMarginBottom)||0,left:parseFloat(c.scrollMarginLeft)||0},R="start"===h||"nearest"===h?_-N:"end"===h?S+L:_+F/2-N+L,k="center"===m?I+W/2-H+T:"end"===m?M+T:I-H,E=[];for(let e=0;e<v.length;e++){let t=v[e],{height:l,width:r,top:i,right:o,bottom:s,left:d}=t.getBoundingClientRect();if("if-needed"===u&&_>=0&&I>=0&&S<=w&&M<=y&&(t===x&&!n(t)||_>=i&&S<=s&&I>=d&&M<=o))break;let c=getComputedStyle(t),f=parseInt(c.borderLeftWidth,10),p=parseInt(c.borderTopWidth,10),g=parseInt(c.borderRightWidth,10),b=parseInt(c.borderBottomWidth,10),N=0,T=0,L="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-g:0,H="offsetHeight"in t?t.offsetHeight-t.clientHeight-p-b:0,A="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:l/t.offsetHeight:0;if(x===t)N="start"===h?R:"end"===h?R-w:"nearest"===h?a(C,C+w,w,p,b,C+R,C+R+F,F):R-w/2,T="start"===m?k:"center"===m?k-y/2:"end"===m?k-y:a(j,j+y,y,f,g,j+k,j+k+W,W),N=Math.max(0,N+C),T=Math.max(0,T+j);else{N="start"===h?R-i-p:"end"===h?R-s+b+H:"nearest"===h?a(i,s,l,p,b+H,R,R+F,F):R-(i+l/2)+H/2,T="start"===m?k-d-f:"center"===m?k-(d+r/2)+L/2:"end"===m?k-o+g+L:a(d,o,r,f,g+L,k,k+W,W);let{scrollLeft:e,scrollTop:n}=t;N=0===B?0:Math.max(0,Math.min(n+N/B,t.scrollHeight-l/B+H)),T=0===A?0:Math.max(0,Math.min(e+T/A,t.scrollWidth-r/A+L)),R+=n-N,k+=e-T}E.push({el:t,top:N,left:T})}return E},c=["parentNode"];function u(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function h(e,t){if(!e.length)return;let l=e.join("_");return t?`${t}_${l}`:c.includes(l)?`form_item_${l}`:l}function m(e){return u(e).join("_")}function f(e,t){let l=t.getFieldInstance(e),i=(0,r.getDOM)(l);if(i)return i;let o=h(u(e),t.__INTERNAL__.name);if(o)return document.getElementById(o)}e.s(["getFieldId",0,h,"getStatus",0,function(e,t,l,r,i,o){let n=r;return void 0!==o?n=o:l.validating?n="validating":e.length?n="error":t.length?n="warning":(l.touched||i&&l.validated)&&(n="success"),n},"toArray",0,u],236107),e.s(["default",0,function(e){let[r]=(0,l.useForm)(),i=t.useRef({}),o=t.useMemo(()=>e??{...r,__INTERNAL__:{itemRef:e=>t=>{let l=m(e);t?i.current[l]=t:delete i.current[l]}},scrollToField:(e,t={})=>{let{focus:l,...r}=t,i=f(e,o);i&&(!function(e,t){let l;if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let r={top:parseFloat((l=window.getComputedStyle(e)).scrollMarginTop)||0,right:parseFloat(l.scrollMarginRight)||0,bottom:parseFloat(l.scrollMarginBottom)||0,left:parseFloat(l.scrollMarginLeft)||0};if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(d(e,t));let i="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:l,top:o,left:n}of d(e,!1===t?{block:"end",inline:"nearest"}:t===Object(t)&&0!==Object.keys(t).length?t:{block:"start",inline:"nearest"})){let e=o-r.top+r.bottom,t=n-r.left+r.right;l.scroll({top:e,left:t,behavior:i})}}(i,{scrollMode:"if-needed",block:"nearest",...r}),l&&o.focusField(e))},focusField:e=>{let t=o.getFieldInstance(e);"function"==typeof t?.focus?t.focus():f(e,o)?.focus?.()},getFieldInstance:e=>{let t=m(e);return i.current[t]}},[e,r]);return[o]},"toNamePathStr",0,m],749344)}]);
|