forked from Gitlink/build
1 line
4.4 KiB
JavaScript
1 line
4.4 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[157],{DNEU:function(e,a,t){"use strict";t.r(a),t("DjyN");var n=t("NUBc"),c=t("zLi2"),o=t.n(c),i=(t("OaEy"),t("2fM7")),l=t("ZbhI"),r=t.n(l),s=t("FLGM"),m=t.n(s),u=t("o+MX"),p=t.n(u),d=t("cDcd"),f=t.n(d),h=t("9C/b"),g=t("sYIF"),E=t("1thW"),v=t("5A3O"),N=(t("ITD6"),t("vDqi")),_=t.n(N),b=t("2iEm"),j=t("2CTR"),y=i.a.Option;a.default=Object(h.a)(Object(E.a)()(Object(g.b)()(Object(v.a)((function(e){var a=e.match.params,t=a.name,c=a.id,l=e.current_user.user_id,s=Object(d.useState)(void 0),u=o()(s,2),h=u[0],E=u[1],v=Object(d.useState)(void 0),N=o()(v,2),O=N[0],x=N[1],T=Object(d.useState)("praises_count"),k=o()(T,2),C=k[0],I=k[1],S=Object(d.useState)(1),w=o()(S,2),L=w[0],R=w[1],B=Object(d.useState)(15),D=o()(B,2),U=D[0],z=(D[1],Object(d.useState)(void 0)),F=o()(z,2),J=F[0],M=F[1],W=Object(d.useState)(void 0),H=o()(W,2),V=H[0],q=H[1];return Object(d.useEffect)((function(){t&&(document.title="项目标签-".concat(decodeURIComponent(t))),_.a.get("/project_languages.json").then((function(e){e&&E(e.data.project_languages)}))}),[]),Object(d.useEffect)((function(){_.a.get("/projects.json",{params:{user_id:l,page:L,limit:U,sort_by:C,language_id:O||void 0,topic_id:c}}).then((function(e){e&&(M(e.data.projects),q(e.data.total_count))})).catch((function(e){}))}),[C,L,O]),f.a.createElement("div",{className:"topicRepoList pb50"},f.a.createElement("h2",{className:"mt30 pl15"},"#",decodeURIComponent(t)),f.a.createElement("div",{className:"flexBoxTopic topicRepoHead"},f.a.createElement("span",null,"平台共",V,"个公开项目与此标签相匹配"),f.a.createElement("div",null,f.a.createElement(i.a,{defaultValue:0,showSearch:!0,placeholder:"请选择语言",style:{minWidth:"104px",marginRight:"20px"},onChange:function(e){x(e)},optionFilterProp:"children",filterOption:function(e,a){var t;return r()(t=a.props.children.toLowerCase()).call(t,e.toLowerCase())>=0}},f.a.createElement(y,{key:0,value:0},"全部语言"),h&&h.length>0&&m()(h).call(h,(function(e,a){return f.a.createElement(y,{key:e.id,value:e.id},e.name)}))),f.a.createElement(i.a,{defaultValue:"praises_count",onChange:function(e){I(e)},style:{minWidth:"104px"}},f.a.createElement(y,{value:"praises_count"},"最多点赞"),f.a.createElement(y,{value:"updated_on"},"最近更新"),f.a.createElement(y,{value:"forked_count"},"最多fork"),f.a.createElement(y,{value:"watched_count"},"最多关注"),f.a.createElement(y,{value:"created_on"},"最近创建")))),J&&0===J.length&&f.a.createElement("div",{className:"repoByTopicNodata"},f.a.createElement(j.a,{_html:"暂无数据"})),J&&J.length>0&&m()(J).call(J,(function(e){var a,t;return f.a.createElement("div",{key:e.id,className:"flexBoxTopic repoTopic"},f.a.createElement(b.a,{to:"/".concat(e.author&&e.author.login)},f.a.createElement("img",{src:Object(g.h)("/".concat(e.author&&e.author.image_url)),alt:"",className:"repoImg mr10"})),f.a.createElement("div",{className:"rightInfo"},f.a.createElement("div",{className:"flexBoxTopic"},f.a.createElement(b.a,{to:p()(a="/".concat(e.author&&e.author.login,"/")).call(a,e.identifier),className:"repoTitle task-hide font-15"},e.author&&e.author.name,"/",e.name),e.praises_count>0?f.a.createElement("span",{className:"mr10"},f.a.createElement("i",{className:"iconfont icon-xingzhuang mr3 font-14"}),e.praises_count):"",e.forked_count>0?f.a.createElement("span",null,f.a.createElement("i",{className:"iconfont icon-yifuke_icon mr3 font-14"}),e.forked_count):""),f.a.createElement("div",{className:"descTopic task-hide-2 mb5"},e.description),e.topics&&f.a.createElement("div",{className:"proListTopics"},m()(t=e.topics).call(t,(function(e){var a;return f.a.createElement(b.a,{to:p()(a="/explore/topic/".concat(e.id,"/")).call(a,encodeURIComponent(e.name)),className:"proListTopic mr15 font-13 task-hide"},e.name)}))),f.a.createElement("div",{className:"flexBoxTopic info3 font-13 mt5"},e.category&&e.category.id?f.a.createElement("span",{className:"category"},e.category.name):"",e.language&&e.language.id?f.a.createElement("span",{className:"language mr30 ".concat(e.category&&e.category.id?"hasCate":"")},e.language.name):"",f.a.createElement("span",{style:{lineHeight:"15px",display:"flex"}},f.a.createElement("i",{className:"iconfont icon-shijian font-15 mr5"}),"更新于",e.time_ago))))})),V>U&&f.a.createElement(n.a,{className:"mt20 pagTopic",pageSize:U,showQuickJumper:V>U,onChange:function(e){R(e)},current:L,total:V,showTotal:function(e){return"共 ".concat(e," 条")}}))})))))},ITD6:function(e,a,t){}}]); |